mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
Compare commits
1491 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb35dae1d1 | ||
|
|
cc0a144169 | ||
|
|
b973f9e0ec | ||
|
|
d62068025c | ||
|
|
b2952d2ddf | ||
|
|
a21244816d | ||
|
|
a9aeb57dc4 | ||
|
|
00537ed199 | ||
|
|
c2df3e0e0a | ||
|
|
e3afb1cffc | ||
|
|
b475311f85 | ||
|
|
45005d61e0 | ||
|
|
adfddeae27 | ||
|
|
a7429267bb | ||
|
|
ff415d6a03 | ||
|
|
b4dc35a4de | ||
|
|
29c7ccad39 | ||
|
|
1da3635d03 | ||
|
|
1f50015ed2 | ||
|
|
01892422cb | ||
|
|
afce60b06f | ||
|
|
a2b87f6158 | ||
|
|
76a2f92daf | ||
|
|
5b09d57196 | ||
|
|
95bf18f859 | ||
|
|
1fc648ff37 | ||
|
|
37ba956bad | ||
|
|
697f887539 | ||
|
|
7b42141958 | ||
|
|
158b00f9b4 | ||
|
|
43ac8dfd20 | ||
|
|
34d8d52e7a | ||
|
|
c738b26c04 | ||
|
|
6090e7173f | ||
|
|
7ebf746584 | ||
|
|
e9d04d75ac | ||
|
|
605160a1ba | ||
|
|
82b8750b63 | ||
|
|
61f7f19d12 | ||
|
|
9bd7e30d18 | ||
|
|
572010ded1 | ||
|
|
1f22326e78 | ||
|
|
504d5c91bc | ||
|
|
a34692b6f2 | ||
|
|
73b5d23210 | ||
|
|
e31de8b137 | ||
|
|
cef5bbb2be | ||
|
|
80a8e1a4da | ||
|
|
fcb8fe50fe | ||
|
|
5235c8aad6 | ||
|
|
5b67525211 | ||
|
|
fb697729c0 | ||
|
|
76fe0fef49 | ||
|
|
6295d03801 | ||
|
|
07166fb3cd | ||
|
|
219dfe66d0 | ||
|
|
22c62fb524 | ||
|
|
f8706abebe | ||
|
|
e83a6f9c2e | ||
|
|
63485c8c78 | ||
|
|
72ef024678 | ||
|
|
414c736655 | ||
|
|
fdbfbb9238 | ||
|
|
a766e5d334 | ||
|
|
2faf01eb9d | ||
|
|
a4c2463b2f | ||
|
|
ddbd8033f9 | ||
|
|
6da66cf367 | ||
|
|
c7bc37d010 | ||
|
|
e0ec3c5035 | ||
|
|
d4f287298f | ||
|
|
e70d5838a8 | ||
|
|
b04ca0fdbd | ||
|
|
a064da642d | ||
|
|
37ce37979a | ||
|
|
cb3cbd0d78 | ||
|
|
1415aa1c03 | ||
|
|
7eb17f6abc | ||
|
|
fdb471d506 | ||
|
|
e6785ffe95 | ||
|
|
cc2951265e | ||
|
|
ee413f3b24 | ||
|
|
fc664a850d | ||
|
|
55efe76b2e | ||
|
|
dd8922ce4d | ||
|
|
102b48c302 | ||
|
|
a360bebd9d | ||
|
|
37ab493b78 | ||
|
|
46b7afe558 | ||
|
|
eac3420583 | ||
|
|
e1e9c08242 | ||
|
|
5ac6cf3b74 | ||
|
|
d6a58136da | ||
|
|
819b7b93d1 | ||
|
|
bceeda1cfd | ||
|
|
0d8ef9583b | ||
|
|
b1393ae615 | ||
|
|
464109313b | ||
|
|
83c8baf8e3 | ||
|
|
1bac929ab3 | ||
|
|
b27417da41 | ||
|
|
ef1f72f69b | ||
|
|
784fd57410 | ||
|
|
1dd0afcf80 | ||
|
|
ddce7731b9 | ||
|
|
d00c3780a6 | ||
|
|
4a87a24235 | ||
|
|
f5c9174c2f | ||
|
|
8d5f676039 | ||
|
|
71db7e10b6 | ||
|
|
756f77063a | ||
|
|
5f637036bc | ||
|
|
24b5f41065 | ||
|
|
b00352570b | ||
|
|
0b44b7d384 | ||
|
|
82da64d66d | ||
|
|
ee5a76bb0c | ||
|
|
b65ee5b42e | ||
|
|
8298db7d13 | ||
|
|
5b0e86b179 | ||
|
|
ed2641ea02 | ||
|
|
66939636dc | ||
|
|
2c331d929a | ||
|
|
4472764f3a | ||
|
|
6cb7153bdd | ||
|
|
5142f69655 | ||
|
|
dfe23f7bfe | ||
|
|
6873353cd4 | ||
|
|
025c97673f | ||
|
|
c814b92557 | ||
|
|
87765e8673 | ||
|
|
833d197412 | ||
|
|
5e72cd12d1 | ||
|
|
330fb6dff5 | ||
|
|
6d7d485a38 | ||
|
|
0160901060 | ||
|
|
9313140c59 | ||
|
|
25b1d4b673 | ||
|
|
b9d0602f55 | ||
|
|
ec0a3bbc95 | ||
|
|
50f63a2f72 | ||
|
|
cb47cb7dbf | ||
|
|
c9ac49c758 | ||
|
|
c4e8aba1c9 | ||
|
|
ba6b8b1f69 | ||
|
|
09af2fc2cb | ||
|
|
5caf0b02f0 | ||
|
|
86bac90001 | ||
|
|
7d31575149 | ||
|
|
7223b28829 | ||
|
|
4014c1d0ab | ||
|
|
0bf0e795ca | ||
|
|
0bc3716f74 | ||
|
|
ca23ea0f69 | ||
|
|
efaa2c0e3f | ||
|
|
d91f4d5748 | ||
|
|
6f1a03587a | ||
|
|
7973f0f178 | ||
|
|
11f0ca371b | ||
|
|
0131746919 | ||
|
|
5774b1f69a | ||
|
|
34d36c1de1 | ||
|
|
cca84e6455 | ||
|
|
82ce1ace28 | ||
|
|
e59d5a766f | ||
|
|
98a8103f5a | ||
|
|
81a8593eb6 | ||
|
|
b6584c9ddf | ||
|
|
08d4cc9690 | ||
|
|
0565162fde | ||
|
|
31614247cf | ||
|
|
e9390dcd48 | ||
|
|
c9b3e2b156 | ||
|
|
ace6012c1c | ||
|
|
17901fbf3d | ||
|
|
2c7b5578e7 | ||
|
|
b2b7d18802 | ||
|
|
965da0535a | ||
|
|
ebd187ec06 | ||
|
|
b495fb7a37 | ||
|
|
58e5125cde | ||
|
|
dadfbd2ddb | ||
|
|
9fdeec6128 | ||
|
|
e783aeab66 | ||
|
|
53a94cc7bb | ||
|
|
839a9b6cb8 | ||
|
|
2557d77ae3 | ||
|
|
6a7df2f1ae | ||
|
|
2db83b3892 | ||
|
|
08c7cc0918 | ||
|
|
d555dcb6d7 | ||
|
|
7226f25c67 | ||
|
|
77a3be6fd7 | ||
|
|
2397df7f22 | ||
|
|
118d2c7273 | ||
|
|
b44d2b1bb3 | ||
|
|
9867d88067 | ||
|
|
037c49e2c6 | ||
|
|
1e989060f9 | ||
|
|
4d6271c161 | ||
|
|
c3900f6984 | ||
|
|
aa1a036f66 | ||
|
|
26274e6c5d | ||
|
|
bcfbe5a284 | ||
|
|
496243fbc7 | ||
|
|
036ffe595a | ||
|
|
2a903e9f03 | ||
|
|
36e5bbb752 | ||
|
|
96a976d826 | ||
|
|
ff514a0568 | ||
|
|
a4d99b78d5 | ||
|
|
029c69ecd3 | ||
|
|
9e1f04e476 | ||
|
|
c8bde41451 | ||
|
|
e16c01623d | ||
|
|
7de294a58e | ||
|
|
060343f096 | ||
|
|
addba0d007 | ||
|
|
68418f2c8f | ||
|
|
428dd17d54 | ||
|
|
7344b41f47 | ||
|
|
5f003b0dd7 | ||
|
|
b8f454b8ac | ||
|
|
b45e03a45a | ||
|
|
0a268f35bc | ||
|
|
e3709533b4 | ||
|
|
acc8d5f7b2 | ||
|
|
da06a96630 | ||
|
|
7eaf8cfd2f | ||
|
|
5248c8f78d | ||
|
|
f4365dbd3a | ||
|
|
2309b16bd4 | ||
|
|
c65af61a68 | ||
|
|
a48e9bc64c | ||
|
|
b4984d7f2d | ||
|
|
1017d62f0d | ||
|
|
ebc208cacd | ||
|
|
0236c8e7f8 | ||
|
|
db8a92f5c2 | ||
|
|
c1e5408492 | ||
|
|
84890eb1b4 | ||
|
|
220685a522 | ||
|
|
8ebf5dbcb4 | ||
|
|
dad807d62d | ||
|
|
8e52ffa30e | ||
|
|
18970ff0b9 | ||
|
|
630698459b | ||
|
|
f8e854a087 | ||
|
|
3b2274b0aa | ||
|
|
0d1ebce1a1 | ||
|
|
70d86ce9a2 | ||
|
|
291f591af3 | ||
|
|
5a48c52a95 | ||
|
|
5625ef956d | ||
|
|
969733ab77 | ||
|
|
12a1ac1a7d | ||
|
|
4da322a03f | ||
|
|
d5754c00e2 | ||
|
|
2e9b5f3a2b | ||
|
|
b11a8e9c0c | ||
|
|
e37533afbb | ||
|
|
4a476673ac | ||
|
|
fe5386cc08 | ||
|
|
8bfb1a9d39 | ||
|
|
109aafcbc0 | ||
|
|
e289c06d8d | ||
|
|
78c1c318c5 | ||
|
|
07983d75ea | ||
|
|
d0a4a4242d | ||
|
|
a71be2b193 | ||
|
|
779ca13d48 | ||
|
|
f3b0a50db7 | ||
|
|
c831596e02 | ||
|
|
2ae369fbdb | ||
|
|
f2c9d968a4 | ||
|
|
c3f02980a0 | ||
|
|
7d5ce7b5d7 | ||
|
|
8bb71eeb51 | ||
|
|
5a88598811 | ||
|
|
da3fbd386d | ||
|
|
1e915aad20 | ||
|
|
889d5e5b28 | ||
|
|
51cf2df2f8 | ||
|
|
e690285d9d | ||
|
|
81d6423f24 | ||
|
|
046dee7389 | ||
|
|
a33a24dddf | ||
|
|
636bdbd12c | ||
|
|
0ab3492afd | ||
|
|
666ae11639 | ||
|
|
826856c390 | ||
|
|
a764a481f3 | ||
|
|
e345090015 | ||
|
|
cc97198fe4 | ||
|
|
5a146e34fa | ||
|
|
70838c3e24 | ||
|
|
2dd71cbe26 | ||
|
|
32c013a72c | ||
|
|
db6e1ae558 | ||
|
|
4117da6e93 | ||
|
|
02b1ba03ed | ||
|
|
1f501f4553 | ||
|
|
0205d0afb5 | ||
|
|
ccf9bf4613 | ||
|
|
d4704e39ac | ||
|
|
4a82abc19b | ||
|
|
3ae32ab0a0 | ||
|
|
1cc6a108a7 | ||
|
|
d4ffe53dbd | ||
|
|
f43b3508e9 | ||
|
|
ea0c326d3d | ||
|
|
4843480fbf | ||
|
|
930e14e258 | ||
|
|
87bbb41fb6 | ||
|
|
e767f68f89 | ||
|
|
b4d304c21e | ||
|
|
db1f412dae | ||
|
|
a73f5e83ec | ||
|
|
49b2e98a8f | ||
|
|
b3a16fd0ce | ||
|
|
dd6735ec04 | ||
|
|
9ebf1436d2 | ||
|
|
0aa71b5237 | ||
|
|
7ef2d52efd | ||
|
|
a5c6dfe62b | ||
|
|
4a606e0cb2 | ||
|
|
27370c655d | ||
|
|
887f4e8985 | ||
|
|
c91c4b01f9 | ||
|
|
5f198dba08 | ||
|
|
67f9a7f5e4 | ||
|
|
62404721ed | ||
|
|
6d37329e74 | ||
|
|
0c316d3225 | ||
|
|
131644477d | ||
|
|
b964dd0895 | ||
|
|
7dd32ed44b | ||
|
|
0b6aedfc93 | ||
|
|
b692088c94 | ||
|
|
160ab8d0ae | ||
|
|
a599cb436a | ||
|
|
294aa81298 | ||
|
|
ddc4b3dd6e | ||
|
|
4c5bf3ad2b | ||
|
|
88c33214c6 | ||
|
|
393be65aa6 | ||
|
|
9ce9a1598f | ||
|
|
d9079fe18e | ||
|
|
3cde070d3b | ||
|
|
b2a5f65a77 | ||
|
|
69dff5a2cb | ||
|
|
40e0d5cfbf | ||
|
|
5a0100757f | ||
|
|
f9fe88898d | ||
|
|
a2d6955f79 | ||
|
|
8fa247145e | ||
|
|
04bb65dcf7 | ||
|
|
e4884c7835 | ||
|
|
8b9ce3e8de | ||
|
|
327a5f5fae | ||
|
|
50b971477b | ||
|
|
07c7eea2df | ||
|
|
42135d3e53 | ||
|
|
d74e5e6457 | ||
|
|
a2c7377134 | ||
|
|
0e54393d5a | ||
|
|
8cf8cefc92 | ||
|
|
098c40e9ac | ||
|
|
80c1c4c6c8 | ||
|
|
ef8afab7e8 | ||
|
|
84e0e08aec | ||
|
|
2fce771214 | ||
|
|
15929e8cf2 | ||
|
|
f1c8ec141a | ||
|
|
a62393e0ed | ||
|
|
a6defd9b62 | ||
|
|
374212beaa | ||
|
|
5132e62045 | ||
|
|
9504ede1f3 | ||
|
|
afb6e6b5ba | ||
|
|
60b2b92803 | ||
|
|
6113311fda | ||
|
|
ecac6201d0 | ||
|
|
90d8c37f91 | ||
|
|
c43085beab | ||
|
|
d9c383b2ef | ||
|
|
100938b0e5 | ||
|
|
83a6ee0a22 | ||
|
|
0dab7f02ed | ||
|
|
0e6f2eb1cd | ||
|
|
9a371f8998 | ||
|
|
8a7bbd1795 | ||
|
|
d1fef24723 | ||
|
|
3ddc5e7846 | ||
|
|
b439ea45ec | ||
|
|
5680785f86 | ||
|
|
e8eb7bec1b | ||
|
|
565b7404f9 | ||
|
|
9cffe4d476 | ||
|
|
43be88a37c | ||
|
|
ea67859de7 | ||
|
|
c8986464ec | ||
|
|
7804f94d8b | ||
|
|
bfa77aebfc | ||
|
|
487fb02313 | ||
|
|
ef64038107 | ||
|
|
5d336accbc | ||
|
|
99047b2866 | ||
|
|
f611cf3b5a | ||
|
|
4ad059605c | ||
|
|
dc2ff97dd8 | ||
|
|
2b5265c103 | ||
|
|
2e98fde053 | ||
|
|
d5176e0eb7 | ||
|
|
eb0b2a847b | ||
|
|
cff5482f69 | ||
|
|
afc37973d0 | ||
|
|
3eada6c6ab | ||
|
|
7c39268fe5 | ||
|
|
eb67b299de | ||
|
|
3e7a09c1e3 | ||
|
|
637dc9b9b2 | ||
|
|
1de16d4715 | ||
|
|
49090d774d | ||
|
|
9a695b5cdd | ||
|
|
e0339b50c0 | ||
|
|
d0c584672f | ||
|
|
27816acaeb | ||
|
|
4de3cc8a09 | ||
|
|
5c16ceb2fa | ||
|
|
9db3f73413 | ||
|
|
e0ceddce09 | ||
|
|
6dc4096299 | ||
|
|
1fa03b5c74 | ||
|
|
f8f57a93c3 | ||
|
|
960fe63312 | ||
|
|
7545b94128 | ||
|
|
1263a27c1c | ||
|
|
e1c084d365 | ||
|
|
7465ec0bbd | ||
|
|
17ed57836f | ||
|
|
d0acb51fd7 | ||
|
|
71c1ed6c49 | ||
|
|
bfb68254a4 | ||
|
|
18f7662209 | ||
|
|
a0d84f383c | ||
|
|
1f447ae681 | ||
|
|
8bd6691331 | ||
|
|
42afcf9322 | ||
|
|
3d3694bb8d | ||
|
|
589b913960 | ||
|
|
7ba4f42494 | ||
|
|
c96118d2b5 | ||
|
|
0285d8cd38 | ||
|
|
ee87604a4d | ||
|
|
2235ebaf20 | ||
|
|
954d0d954f | ||
|
|
e31747d087 | ||
|
|
fc581253a4 | ||
|
|
47c4609f23 | ||
|
|
2d52bc2a49 | ||
|
|
5367101330 | ||
|
|
db145b4999 | ||
|
|
7f950ddb80 | ||
|
|
50e2251e74 | ||
|
|
33d5455b6f | ||
|
|
ac018500cd | ||
|
|
3e661db283 | ||
|
|
18fb78b3ec | ||
|
|
58ff13d399 | ||
|
|
0ac0175bb1 | ||
|
|
f39007cd2d | ||
|
|
2349aa4df8 | ||
|
|
a93a173183 | ||
|
|
42e55dd2dd | ||
|
|
ca3146d38f | ||
|
|
7f6cd514a5 | ||
|
|
88e24e92b5 | ||
|
|
8b447e361f | ||
|
|
a92dd2d4e4 | ||
|
|
852ec44567 | ||
|
|
b6e32cdeb4 | ||
|
|
4bd264d9be | ||
|
|
4a4b8574d0 | ||
|
|
ded073edd9 | ||
|
|
568f95e7a3 | ||
|
|
5adcabc8de | ||
|
|
e3bce7172c | ||
|
|
96fb618390 | ||
|
|
2d4fdcb661 | ||
|
|
7a84cff5b4 | ||
|
|
2af627b704 | ||
|
|
77fdf18686 | ||
|
|
944a77fe42 | ||
|
|
049678b32e | ||
|
|
3325e4d854 | ||
|
|
1e90e88d4b | ||
|
|
8aeb33c98c | ||
|
|
3b08721835 | ||
|
|
5a30878599 | ||
|
|
c8a8935db0 | ||
|
|
ec196f57bb | ||
|
|
f7809ec3a7 | ||
|
|
71d3ec3616 | ||
|
|
4a7cf8d870 | ||
|
|
4bf8836c0a | ||
|
|
1ca36ee29c | ||
|
|
3446ff88cf | ||
|
|
de5a91a13f | ||
|
|
814cd73019 | ||
|
|
c21611661b | ||
|
|
8f817ce689 | ||
|
|
971b5111e7 | ||
|
|
07069a64ae | ||
|
|
6acea51f12 | ||
|
|
7aa2dab307 | ||
|
|
3091be8f67 | ||
|
|
487531cc52 | ||
|
|
58bfcb4273 | ||
|
|
8d8be27f22 | ||
|
|
27a978cba5 | ||
|
|
71b4e6afa4 | ||
|
|
e1f3b19c0c | ||
|
|
649c2aa5a6 | ||
|
|
cac8cc99e1 | ||
|
|
cb162b16f2 | ||
|
|
86e54ce145 | ||
|
|
efd809971f | ||
|
|
38ae14cc4d | ||
|
|
c7e33a90fe | ||
|
|
5add835750 | ||
|
|
734c614cba | ||
|
|
f6b347fa62 | ||
|
|
08d2f3125e | ||
|
|
385c48dcad | ||
|
|
0926057bfe | ||
|
|
6912e3893e | ||
|
|
d3052657df | ||
|
|
a5ca4d8edf | ||
|
|
afb1ebebd5 | ||
|
|
a04a9eb5ad | ||
|
|
027badd21f | ||
|
|
1affc760e6 | ||
|
|
3ca72b7398 | ||
|
|
702dbddd78 | ||
|
|
8fbecc0227 | ||
|
|
421271acfa | ||
|
|
98af76b3ac | ||
|
|
3952fdbe2d | ||
|
|
bc13beaa85 | ||
|
|
59b2e706ca | ||
|
|
8bf835c531 | ||
|
|
087ed7c132 | ||
|
|
4c075df327 | ||
|
|
9ea8baca05 | ||
|
|
9b6784720e | ||
|
|
3761e1dd60 | ||
|
|
b3eb809550 | ||
|
|
cb72865dcc | ||
|
|
d646b4729b | ||
|
|
a2dd903d0d | ||
|
|
28ed378ee7 | ||
|
|
15ae55136f | ||
|
|
b18abd954f | ||
|
|
b45f79a1f8 | ||
|
|
01a03b4c84 | ||
|
|
e48328af34 | ||
|
|
8925d44807 | ||
|
|
213283510f | ||
|
|
9f8190dc28 | ||
|
|
c32d4ee2f7 | ||
|
|
2c867a4b2c | ||
|
|
da5194bdcb | ||
|
|
bbb27aed10 | ||
|
|
c02fbaeae7 | ||
|
|
847218da73 | ||
|
|
90dc788893 | ||
|
|
f3525cc555 | ||
|
|
198f243181 | ||
|
|
8e049f4af5 | ||
|
|
ff465a59b6 | ||
|
|
68b4f3ca04 | ||
|
|
6b31f2b3f2 | ||
|
|
63cf0f1548 | ||
|
|
e607f68b3e | ||
|
|
db3bb82dbd | ||
|
|
5889c600fa | ||
|
|
d7d4c7236c | ||
|
|
f54d8ce36f | ||
|
|
43faa13cb5 | ||
|
|
85a2d994f3 | ||
|
|
d8cd78cd6b | ||
|
|
3e59a5bcd2 | ||
|
|
0efb89d6ff | ||
|
|
6697c075cb | ||
|
|
06660160e7 | ||
|
|
0b571737b7 | ||
|
|
0a486a280d | ||
|
|
bd53e685d0 | ||
|
|
a2bbf3f44e | ||
|
|
410bb62906 | ||
|
|
cbb4ac3e20 | ||
|
|
7508192ab9 | ||
|
|
bbf6cbd8fb | ||
|
|
9765269d27 | ||
|
|
61746b7ff7 | ||
|
|
e6066c2cb5 | ||
|
|
633a918590 | ||
|
|
71c14a0837 | ||
|
|
9bbed2c275 | ||
|
|
d9ba4d9130 | ||
|
|
ecd40de7ec | ||
|
|
e2bd6c06ec | ||
|
|
a26be76d79 | ||
|
|
3b68c1eb69 | ||
|
|
f7879bdbf9 | ||
|
|
dbb0fc519f | ||
|
|
b931ccfabf | ||
|
|
eeab048f46 | ||
|
|
5da89ac05b | ||
|
|
e2b446be1c | ||
|
|
5f2e17a738 | ||
|
|
399d6d0045 | ||
|
|
f36f3ffd21 | ||
|
|
3c785ae7d8 | ||
|
|
00cd772cbc | ||
|
|
d434724a54 | ||
|
|
b6c9a3bb89 | ||
|
|
fc3bf45a7f | ||
|
|
cbf6c06e4b | ||
|
|
cff21124da | ||
|
|
ce7893c2e5 | ||
|
|
f7dcaa38ff | ||
|
|
8ce1013a26 | ||
|
|
114d67b408 | ||
|
|
56c2d16560 | ||
|
|
2238c42432 | ||
|
|
64f6cf6747 | ||
|
|
c0e9f1ca43 | ||
|
|
7f66087d8c | ||
|
|
18671b7cca | ||
|
|
233156c744 | ||
|
|
ac0ffab99c | ||
|
|
5e964d2105 | ||
|
|
59e7a5fa4b | ||
|
|
8452f577d2 | ||
|
|
726eb8d0e1 | ||
|
|
2c0d6b93ee | ||
|
|
98d06b2892 | ||
|
|
533f2734f1 | ||
|
|
856c19fa17 | ||
|
|
3237507bb2 | ||
|
|
ff5a248240 | ||
|
|
fc3bdc9037 | ||
|
|
533c0bf0b1 | ||
|
|
afb6862035 | ||
|
|
92d9d04a78 | ||
|
|
0704e5ee67 | ||
|
|
7dfcd89a04 | ||
|
|
2859bee4c0 | ||
|
|
724c49f5c4 | ||
|
|
48c4a473df | ||
|
|
3d39272536 | ||
|
|
0a63966cbd | ||
|
|
89e959c2e3 | ||
|
|
c56dd2cdbd | ||
|
|
363f28a46b | ||
|
|
5549f51a13 | ||
|
|
972f857c71 | ||
|
|
d2eb1488fd | ||
|
|
82486ee22e | ||
|
|
29cc57f52a | ||
|
|
f7d92caae5 | ||
|
|
201174e293 | ||
|
|
dc2f6235a1 | ||
|
|
0824c779db | ||
|
|
e002ad3b6a | ||
|
|
8a570069f8 | ||
|
|
bfe44c1621 | ||
|
|
b17882a1c1 | ||
|
|
f309979126 | ||
|
|
5a0490e81f | ||
|
|
2c007115f7 | ||
|
|
508e4eac61 | ||
|
|
ac47fb84a8 | ||
|
|
7ba14a3925 | ||
|
|
67514ccc5f | ||
|
|
6ee3886ecf | ||
|
|
76282ed1ef | ||
|
|
fd1d807012 | ||
|
|
906c4c7f39 | ||
|
|
bfa9e8c495 | ||
|
|
425eecf692 | ||
|
|
ac1f7542a9 | ||
|
|
225d168fdd | ||
|
|
e073b2cf42 | ||
|
|
1cb366d822 | ||
|
|
c9c8e30ced | ||
|
|
c50941ac7d | ||
|
|
58f950ffbd | ||
|
|
a1341ba503 | ||
|
|
620f4a8bfb | ||
|
|
668e43f57c | ||
|
|
7f11d44130 | ||
|
|
5c77e752f6 | ||
|
|
6d260c195f | ||
|
|
fdfecbb3f7 | ||
|
|
1d8132bcaa | ||
|
|
5f1bde5885 | ||
|
|
0adb025573 | ||
|
|
f8e7623f23 | ||
|
|
9243cceb9a | ||
|
|
5a62035ed7 | ||
|
|
c3a81b5bf3 | ||
|
|
34f6811eea | ||
|
|
c800e70ec1 | ||
|
|
7aa2ee08bf | ||
|
|
933aa88dc7 | ||
|
|
4b79ecc3d9 | ||
|
|
0bd179c6ca | ||
|
|
70141bd049 | ||
|
|
65cc585697 | ||
|
|
bd39468b96 | ||
|
|
dad831bc8c | ||
|
|
8a8745701b | ||
|
|
48b899b5d0 | ||
|
|
210447cd37 | ||
|
|
e672fbf6e2 | ||
|
|
004464c699 | ||
|
|
6f39a37656 | ||
|
|
b097b54792 | ||
|
|
0693080630 | ||
|
|
75d27837c2 | ||
|
|
597f29e90a | ||
|
|
a77bb50b9e | ||
|
|
3f84e8e652 | ||
|
|
1df7f25cad | ||
|
|
a0c30517bd | ||
|
|
dc36a9c3e7 | ||
|
|
0e61ad27da | ||
|
|
b3009c3366 | ||
|
|
810073a79b | ||
|
|
79c69d03fa | ||
|
|
22996da737 | ||
|
|
82d0b6c9f0 | ||
|
|
77c997b91e | ||
|
|
bb5d52d72c | ||
|
|
1474bab34a | ||
|
|
05f6f4ea5b | ||
|
|
05feb39501 | ||
|
|
ce92c3329b | ||
|
|
216b6eecc0 | ||
|
|
c0917e9276 | ||
|
|
0bbcbf0d2d | ||
|
|
9b998e3fca | ||
|
|
d7d65cdf21 | ||
|
|
27925289d4 | ||
|
|
03ea265bab | ||
|
|
917f9eead3 | ||
|
|
08f2e72af8 | ||
|
|
a2fb0ec029 | ||
|
|
084042ad13 | ||
|
|
8da3defe24 | ||
|
|
58f9cd32a5 | ||
|
|
f7abf5a2d5 | ||
|
|
c8c6d072f6 | ||
|
|
4d9cc604b9 | ||
|
|
1dc76fa171 | ||
|
|
1d37b9ae9c | ||
|
|
26828602a8 | ||
|
|
e253f3ac89 | ||
|
|
4d59fdea1b | ||
|
|
98a313eb5b | ||
|
|
77e1cd8b32 | ||
|
|
dede5c5ef5 | ||
|
|
d156c0be3d | ||
|
|
dc0bc6e606 | ||
|
|
05040425df | ||
|
|
36f7c283b8 | ||
|
|
9fe4237033 | ||
|
|
b03c0a3e2d | ||
|
|
87946996ed | ||
|
|
cc55023440 | ||
|
|
1f19dfc50d | ||
|
|
950a440350 | ||
|
|
c92b88bfaf | ||
|
|
10875f26dc | ||
|
|
d62e809c18 | ||
|
|
d85bf4f6dd | ||
|
|
801e201cc3 | ||
|
|
e18e0da0c1 | ||
|
|
d046b0a412 | ||
|
|
72084b8fc1 | ||
|
|
2639b2bd2c | ||
|
|
82aa493dfd | ||
|
|
6c3c7c40b5 | ||
|
|
5616751c04 | ||
|
|
7d898ca34d | ||
|
|
e26556b21a | ||
|
|
89e6d363e2 | ||
|
|
c559ac7be9 | ||
|
|
b3fbe47f0a | ||
|
|
c73af4c480 | ||
|
|
8887fe1eac | ||
|
|
ed861a6c96 | ||
|
|
e63bb6a8ec | ||
|
|
8ec09d25ce | ||
|
|
a9a01ae479 | ||
|
|
31a3864789 | ||
|
|
a5c537197c | ||
|
|
4ea13bdbc0 | ||
|
|
b06ddf2dc7 | ||
|
|
2c45ac9df3 | ||
|
|
7735f68502 | ||
|
|
ffb0f5a1c7 | ||
|
|
80c7f9e855 | ||
|
|
709ef4e39f | ||
|
|
4ceb869420 | ||
|
|
432a209184 | ||
|
|
8444271c58 | ||
|
|
2bc97c23d4 | ||
|
|
9ea02bf125 | ||
|
|
2b4de52af4 | ||
|
|
d3492ebf2f | ||
|
|
ff8698f619 | ||
|
|
16bc218ea7 | ||
|
|
72d2920dc3 | ||
|
|
fb8de0d753 | ||
|
|
352afc9827 | ||
|
|
ce699a1c84 | ||
|
|
cde20d338e | ||
|
|
8ab22e9cc8 | ||
|
|
0f2442a7a5 | ||
|
|
ba91140ea5 | ||
|
|
10f05e75ce | ||
|
|
287811f4ab | ||
|
|
a68462c7cb | ||
|
|
005c28dd3a | ||
|
|
197e1c651f | ||
|
|
c01da0f263 | ||
|
|
81ff542d0b | ||
|
|
efee27559b | ||
|
|
dc5408f874 | ||
|
|
7cf9217158 | ||
|
|
401fc8161a | ||
|
|
be2f9a6099 | ||
|
|
21989aa88e | ||
|
|
461d041a50 | ||
|
|
de8662c52f | ||
|
|
0dbbbad370 | ||
|
|
2e05c0a7d9 | ||
|
|
f12f1cb392 | ||
|
|
b6891850a7 | ||
|
|
f147d799e0 | ||
|
|
534bbe9b9a | ||
|
|
b7f4f6af3a | ||
|
|
ac96919caf | ||
|
|
05cf06656d | ||
|
|
1356f0bcf6 | ||
|
|
ce0c955c29 | ||
|
|
0e7f89169e | ||
|
|
81329fa7fa | ||
|
|
3763278366 | ||
|
|
8600dbb04e | ||
|
|
b27f69aace | ||
|
|
8e0c19fc8d | ||
|
|
54ee1c23f0 | ||
|
|
39b33160c2 | ||
|
|
d94f86b44a | ||
|
|
4ae0daa17f | ||
|
|
8d548413bd | ||
|
|
f2e7a99b1e | ||
|
|
a8c31f68b3 | ||
|
|
db49b42e4a | ||
|
|
e77c2fc9bb | ||
|
|
5197ef591a | ||
|
|
898f8ec006 | ||
|
|
37ff96ba95 | ||
|
|
fa961832f3 | ||
|
|
b66ac2781c | ||
|
|
86a0f2d4a7 | ||
|
|
f5e2a67924 | ||
|
|
45cf626230 | ||
|
|
9717b7516d | ||
|
|
b92c23df2b | ||
|
|
df617f19e0 | ||
|
|
fb565c2548 | ||
|
|
2bfc3a6c85 | ||
|
|
4ab5d84b94 | ||
|
|
154213b705 | ||
|
|
4cce29ea9d | ||
|
|
9d5d00aa8f | ||
|
|
70d47c1757 | ||
|
|
befa34790f | ||
|
|
84da9d289b | ||
|
|
7a30d535e8 | ||
|
|
199701d26b | ||
|
|
3ac2cfa528 | ||
|
|
78d68aa1b9 | ||
|
|
8042b78f1e | ||
|
|
000d064276 | ||
|
|
600a78f35f | ||
|
|
6f5e4c30dc | ||
|
|
8e7457911e | ||
|
|
43b3207937 | ||
|
|
22f2151c21 | ||
|
|
7c744f2307 | ||
|
|
08d57fed86 | ||
|
|
6e8a0fe0ef | ||
|
|
6668ec4b5d | ||
|
|
08a8288293 | ||
|
|
3001640eec | ||
|
|
efa3658ced | ||
|
|
92bc253cf7 | ||
|
|
a190190843 | ||
|
|
9c40bd1a23 | ||
|
|
dc2193138d | ||
|
|
033c8cb8b1 | ||
|
|
21c4429c6e | ||
|
|
348a96b033 | ||
|
|
0c930d7c0f | ||
|
|
98aca2b988 | ||
|
|
8d7f497e0c | ||
|
|
1b6328b451 | ||
|
|
d10e08e63e | ||
|
|
a8f21b56f0 | ||
|
|
173842510c | ||
|
|
19c08fe0eb | ||
|
|
db817a7192 | ||
|
|
2c8e93cc96 | ||
|
|
44e9a97f09 | ||
|
|
298ddc4195 | ||
|
|
d9134d6085 | ||
|
|
b17b4ce880 | ||
|
|
2304c32453 | ||
|
|
2b68e4a7df | ||
|
|
8f06e72318 | ||
|
|
5fa740ead4 | ||
|
|
e5096e61e5 | ||
|
|
2a3195636e | ||
|
|
5fb9b8ccd3 | ||
|
|
7089e2299a | ||
|
|
b553cbb68c | ||
|
|
c712411e77 | ||
|
|
48d5cc554c | ||
|
|
39bfd69dc9 | ||
|
|
d690b80493 | ||
|
|
eb48a9f993 | ||
|
|
5a54abaf44 | ||
|
|
47c161f9f1 | ||
|
|
807f8e68f3 | ||
|
|
fba8536c33 | ||
|
|
36fc1bb71a | ||
|
|
ccaa96c81e | ||
|
|
ac2f279c88 | ||
|
|
91cb99b8c8 | ||
|
|
02b1a525e3 | ||
|
|
9bf4a4b18c | ||
|
|
8a01553c49 | ||
|
|
21b913845f | ||
|
|
220e4feb1d | ||
|
|
13884c0457 | ||
|
|
b3bb6ebc6e | ||
|
|
424eb90dd8 | ||
|
|
df804d0729 | ||
|
|
79269cdfd5 | ||
|
|
2a650d4d74 | ||
|
|
017b4ecdb3 | ||
|
|
9c84bf3fd5 | ||
|
|
397b54a8c3 | ||
|
|
cb3604c0a1 | ||
|
|
1a7f0673ea | ||
|
|
0d043207b9 | ||
|
|
f995dea971 | ||
|
|
49e20488bc | ||
|
|
3e47b27192 | ||
|
|
f4fa18ec05 | ||
|
|
c6d1fa2b7d | ||
|
|
c4df7667ff | ||
|
|
6a303cfa25 | ||
|
|
4ffa5cc1da | ||
|
|
172e1cf3bf | ||
|
|
e6a32e52f5 | ||
|
|
d2b6f6844d | ||
|
|
e9ef95ef1f | ||
|
|
10eeb5374f | ||
|
|
332951bc8e | ||
|
|
4daf3280ff | ||
|
|
87bb2c74d9 | ||
|
|
ba011853a0 | ||
|
|
461a158ac3 | ||
|
|
85f59f1103 | ||
|
|
335b9f445f | ||
|
|
7cda45c904 | ||
|
|
4159fdc1a3 | ||
|
|
190da30979 | ||
|
|
ed9c74b900 | ||
|
|
6783766c33 | ||
|
|
b27018b379 | ||
|
|
021d07e04a | ||
|
|
bf0baec392 | ||
|
|
923cbac400 | ||
|
|
ab938f2536 | ||
|
|
a55b1804e9 | ||
|
|
4bfa6b3a5d | ||
|
|
d20f24be18 | ||
|
|
8a17bae7a6 | ||
|
|
d14c73fad5 | ||
|
|
ce878e1def | ||
|
|
a64a0d1db6 | ||
|
|
feab43f16d | ||
|
|
0d60fe775f | ||
|
|
6680be6a73 | ||
|
|
e026ab85a7 | ||
|
|
e53c903205 | ||
|
|
03dbe8565f | ||
|
|
708793cb23 | ||
|
|
43ae4fb0aa | ||
|
|
6b1d552277 | ||
|
|
f24f576b72 | ||
|
|
c23328564f | ||
|
|
cd6dd3dafa | ||
|
|
4081e15bef | ||
|
|
b05e3813d1 | ||
|
|
3048311f40 | ||
|
|
1045392d91 | ||
|
|
7b23ca8ee7 | ||
|
|
4d67eca8bb | ||
|
|
74c4b7311e | ||
|
|
713c74adfd | ||
|
|
408a8a6f19 | ||
|
|
e1485e49d3 | ||
|
|
30b66934cd | ||
|
|
fd49c081c2 | ||
|
|
1327120024 | ||
|
|
d2b5043972 | ||
|
|
a0e55ea3fd | ||
|
|
1f32de29c1 | ||
|
|
12be06d682 | ||
|
|
27ca9b13f8 | ||
|
|
be45905830 | ||
|
|
05d0a89655 | ||
|
|
3ba575dcd0 | ||
|
|
3e200b7f0f | ||
|
|
cbce1f7008 | ||
|
|
e99101447e | ||
|
|
0ddb326e44 | ||
|
|
460446a15c | ||
|
|
4eea24997f | ||
|
|
0b1e9c7c66 | ||
|
|
d51a7a9eb7 | ||
|
|
0f0b959e14 | ||
|
|
b2ceb09e4d | ||
|
|
53953f5cda | ||
|
|
fbd5e819a2 | ||
|
|
bdc391d376 | ||
|
|
6b618fb121 | ||
|
|
1f3e59c9f9 | ||
|
|
1956078c8c | ||
|
|
11230f59fc | ||
|
|
21bad7a01f | ||
|
|
6f9a27ecc7 | ||
|
|
c504113d13 | ||
|
|
c92ff60592 | ||
|
|
e9013d1a2a | ||
|
|
9c4580fe40 | ||
|
|
cb060cb5db | ||
|
|
6c3d85cc45 | ||
|
|
14ae89e87c | ||
|
|
24c48f025d | ||
|
|
f0a556f004 | ||
|
|
fd4d6abb4d | ||
|
|
41cc839380 | ||
|
|
c2a4380b96 | ||
|
|
6f402ac79f | ||
|
|
bf7c1306b1 | ||
|
|
c1509cf09d | ||
|
|
014bca031c | ||
|
|
4f864fd5bd | ||
|
|
2da67567e4 | ||
|
|
5b19d2b1fc | ||
|
|
a6837dcd40 | ||
|
|
af80751a1f | ||
|
|
dd02597c3b | ||
|
|
2926a3cbd8 | ||
|
|
b02bb3bfd4 | ||
|
|
67a4683bb1 | ||
|
|
9baee1c22c | ||
|
|
8cb67b4f9d | ||
|
|
0cd47bc328 | ||
|
|
07fb58d5e1 | ||
|
|
2d80d5e611 | ||
|
|
4bd63b615b | ||
|
|
335f667507 | ||
|
|
1819036d7d | ||
|
|
4f76f116ac | ||
|
|
1eba7c7d2a | ||
|
|
83234dd52c | ||
|
|
bae23b7fce | ||
|
|
3db61eaa82 | ||
|
|
5cf85a0361 | ||
|
|
ffe27f5bde | ||
|
|
78bcd9d54c | ||
|
|
1a9797f0ff | ||
|
|
0de94ff8a4 | ||
|
|
472233d9a7 | ||
|
|
f69e31b0d5 | ||
|
|
60b696cc31 | ||
|
|
549037f744 | ||
|
|
ca5e1e6133 | ||
|
|
3e3ff163db | ||
|
|
ca755365ce | ||
|
|
ea979de19f | ||
|
|
473ddfcdf1 | ||
|
|
a627285a4c | ||
|
|
322847469d | ||
|
|
6c5fac997f | ||
|
|
1871fd383e | ||
|
|
f5b147ca4b | ||
|
|
9d2b206156 | ||
|
|
a372c76e07 | ||
|
|
b1ce07d3ae | ||
|
|
bc09fb30d8 | ||
|
|
c13f219318 | ||
|
|
6b018c5d06 | ||
|
|
e69158d9b2 | ||
|
|
520cfb780a | ||
|
|
e686fed209 | ||
|
|
80ab19ac23 | ||
|
|
25228fa58e | ||
|
|
676d35090f | ||
|
|
e1a36a356c | ||
|
|
3274c0b734 | ||
|
|
9c95e1289f | ||
|
|
ef29871b62 | ||
|
|
a2a87f8d2b | ||
|
|
83c01c6bcb | ||
|
|
c1d850804c | ||
|
|
6590d5f58a | ||
|
|
a225925bc4 | ||
|
|
ab39f1f44f | ||
|
|
8d89364d72 | ||
|
|
af2bc859d1 | ||
|
|
8e72fdaa52 | ||
|
|
e9661f90d0 | ||
|
|
30b111034d | ||
|
|
df18359309 | ||
|
|
03857e0afd | ||
|
|
eaf1e08752 | ||
|
|
d39ceffa94 | ||
|
|
406b171c66 | ||
|
|
6d89b9e203 | ||
|
|
733bb69d25 | ||
|
|
4609694141 | ||
|
|
3be0c5130a | ||
|
|
e50b512580 | ||
|
|
eb62d054de | ||
|
|
e870a309c0 | ||
|
|
3afd3b0ff3 | ||
|
|
e3a2ed95d4 | ||
|
|
20c4f085c8 | ||
|
|
02af7e9299 | ||
|
|
0ae9b36d93 | ||
|
|
2bbb2842e5 | ||
|
|
a5b4eeb932 | ||
|
|
44de602e52 | ||
|
|
63fb4e2827 | ||
|
|
0a839c7321 | ||
|
|
e9747a61ac | ||
|
|
43c3bf4d24 | ||
|
|
0bf642d200 | ||
|
|
b2b69376c4 | ||
|
|
38ad60478c | ||
|
|
cf6a7198f9 | ||
|
|
ac8a926a70 | ||
|
|
aef7244939 | ||
|
|
628e2adc64 | ||
|
|
0c58f09e59 | ||
|
|
e3baf5c443 | ||
|
|
f70bf590cd | ||
|
|
473a414bc3 | ||
|
|
9ad4ec6464 | ||
|
|
a15c315a1c | ||
|
|
58036bb364 | ||
|
|
8a3509e006 | ||
|
|
1d3ead4031 | ||
|
|
498bb47d7f | ||
|
|
f2df9f3917 | ||
|
|
0414ab6e6a | ||
|
|
14a7a5534f | ||
|
|
edc60e0ad1 | ||
|
|
1a97e3de06 | ||
|
|
f5b1bd0bc2 | ||
|
|
05d7e24e66 | ||
|
|
83842ee9e1 | ||
|
|
a13039b14b | ||
|
|
8fce79f385 | ||
|
|
2efea63000 | ||
|
|
c208abf0c5 | ||
|
|
1359354387 | ||
|
|
cd0f9b71c5 | ||
|
|
04ec9caad1 | ||
|
|
259306a8db | ||
|
|
36a8991682 | ||
|
|
1461929f86 | ||
|
|
4bfc549927 | ||
|
|
40db0d6f6f | ||
|
|
6aac0b6056 | ||
|
|
8e234d9b2d | ||
|
|
70819252a9 | ||
|
|
ba264d8311 | ||
|
|
5de002e5c1 | ||
|
|
0b771abad2 | ||
|
|
00041c8ecd | ||
|
|
0225d6d9f9 | ||
|
|
fb4260d71c | ||
|
|
fa253158f4 | ||
|
|
45e3c6ae49 | ||
|
|
d526fe0f7f | ||
|
|
5707b58fda | ||
|
|
1a9f72dfe0 | ||
|
|
078f3a2b54 | ||
|
|
5bcfb9ab32 | ||
|
|
9bd45cf66a | ||
|
|
89c48bbe75 | ||
|
|
6b549696c5 | ||
|
|
3aaf8a24bf | ||
|
|
41ffd6e8ae | ||
|
|
c0a6f3e012 | ||
|
|
eae8de0373 | ||
|
|
23ec6ac567 | ||
|
|
f4cfb4a5ef | ||
|
|
80a9c82813 | ||
|
|
bcd6178d67 | ||
|
|
f10e281ffc | ||
|
|
c2b32fd64a | ||
|
|
80f150dfb4 | ||
|
|
a5c5fcbde1 | ||
|
|
0d76e845d5 | ||
|
|
979d50eb0e | ||
|
|
7099922c35 | ||
|
|
b54b4a4445 | ||
|
|
03989a5af0 | ||
|
|
1847c2e322 | ||
|
|
f7371e9ed5 | ||
|
|
f696274740 | ||
|
|
1c48320ce0 | ||
|
|
96ecf79d32 | ||
|
|
6d243e0ac8 | ||
|
|
8bf60f133f | ||
|
|
3b9a3aba87 | ||
|
|
f0c986858a | ||
|
|
7ee13b4afb | ||
|
|
bca4102542 | ||
|
|
31ac8d6acc | ||
|
|
e82b7615b3 | ||
|
|
6f10f7a21a | ||
|
|
46fb68214f | ||
|
|
c2381424bc | ||
|
|
31328e79be | ||
|
|
96657e300a | ||
|
|
a2e6aa9e64 | ||
|
|
8c2d79e9cf | ||
|
|
cd140b5527 | ||
|
|
a0456bf4f7 | ||
|
|
55e3947cf7 | ||
|
|
db5156e4cd | ||
|
|
eece0677a7 | ||
|
|
24e8c20511 | ||
|
|
886717d330 | ||
|
|
26b27a616a | ||
|
|
0c663e5555 | ||
|
|
0f087915f6 | ||
|
|
a78fa9c0f2 | ||
|
|
b1752ea635 | ||
|
|
ec150917c2 | ||
|
|
7a9a69c439 | ||
|
|
9e9862c6f0 | ||
|
|
7b76d929cd | ||
|
|
1811dfa423 | ||
|
|
3abbc8fd97 | ||
|
|
4b88b67bed | ||
|
|
a2734807ca | ||
|
|
d0d4df313e | ||
|
|
1efd5e6502 | ||
|
|
b12cac0ac3 | ||
|
|
578aa6ccd2 | ||
|
|
3b90530717 | ||
|
|
f199c7a63c | ||
|
|
50a2526d1f | ||
|
|
7fb8a28b59 | ||
|
|
30a825438e | ||
|
|
f63da13210 | ||
|
|
08d73675d4 | ||
|
|
f0f6c00a0e | ||
|
|
965458ca74 | ||
|
|
b30f7ee41c | ||
|
|
a2eb53ce0b | ||
|
|
619c816e7f | ||
|
|
3d6fb7a8fa | ||
|
|
891624c085 | ||
|
|
a7c4686980 | ||
|
|
93aa052856 | ||
|
|
61d05f6782 | ||
|
|
60ccae48f1 | ||
|
|
4b454581fd | ||
|
|
f0aadebd2c | ||
|
|
d3f0ac7954 | ||
|
|
134f76c17f | ||
|
|
b9c877a109 | ||
|
|
aa243a8aae | ||
|
|
e5c1c6f544 | ||
|
|
9e9f85079e | ||
|
|
ae8e2e1f89 | ||
|
|
b2c70e9301 | ||
|
|
e022f4a0d1 | ||
|
|
8bc32e6371 | ||
|
|
f739c47984 | ||
|
|
13fb9fdfd2 | ||
|
|
9a5f51bfbf | ||
|
|
06bab6a38c | ||
|
|
c35a14d8fd | ||
|
|
b914073147 | ||
|
|
04ae18143b | ||
|
|
efe8e81b6e | ||
|
|
c33ddfabf9 | ||
|
|
8ec5451e64 | ||
|
|
20853ddf7e | ||
|
|
091d4cb924 | ||
|
|
cd0210c88a | ||
|
|
ed10f984b6 | ||
|
|
087a6a0810 | ||
|
|
495b4ee7c2 | ||
|
|
7833c28b7a | ||
|
|
bbfb68b082 | ||
|
|
b32e7a777c | ||
|
|
a327889d05 | ||
|
|
5ac89e5a49 | ||
|
|
849653927a | ||
|
|
3545483fc1 | ||
|
|
e5a1896414 | ||
|
|
bec8e72688 | ||
|
|
86748e6d69 | ||
|
|
596f09f754 | ||
|
|
563e25f073 | ||
|
|
1800d0baaf | ||
|
|
2182658301 | ||
|
|
3990719054 | ||
|
|
071b510fba | ||
|
|
d2d2ade9f7 | ||
|
|
d97d2e5c91 | ||
|
|
a6ba44e435 | ||
|
|
4967e630fb | ||
|
|
2508464fde | ||
|
|
782623cba9 | ||
|
|
36045c5381 | ||
|
|
7e49167530 | ||
|
|
a680a2a7dc | ||
|
|
4734451f5f | ||
|
|
dafb780987 | ||
|
|
5fba3e31b4 | ||
|
|
0315020cf0 | ||
|
|
6dca896768 | ||
|
|
90454fbe87 | ||
|
|
f9b2136494 | ||
|
|
3d1c1aefb3 | ||
|
|
e6a65599fd | ||
|
|
32ac907403 | ||
|
|
3af05d62b2 | ||
|
|
b5d8dfa509 | ||
|
|
612987d1e5 | ||
|
|
916598e029 | ||
|
|
c45c634938 | ||
|
|
1bed0d0733 | ||
|
|
e0075b7633 | ||
|
|
0029767561 | ||
|
|
93f9828d04 | ||
|
|
c484af0901 | ||
|
|
b2a96bbe50 | ||
|
|
2414f43757 | ||
|
|
22c54a9917 | ||
|
|
a14c0351ba | ||
|
|
31f75a46c8 | ||
|
|
08d1e9cd73 | ||
|
|
0da83b5d4b | ||
|
|
37d7266751 | ||
|
|
ddfb61b46a | ||
|
|
9a2e8cffed | ||
|
|
e9299d1991 | ||
|
|
08d97cc795 | ||
|
|
0de5d7a96a | ||
|
|
2f8f6064a1 | ||
|
|
d3526f8cf7 | ||
|
|
b045e536c1 | ||
|
|
ab91c88b34 | ||
|
|
f91010c398 | ||
|
|
cd0d0f911b | ||
|
|
bd67006f63 | ||
|
|
5aedd96276 | ||
|
|
751a89d839 | ||
|
|
a226e90c38 | ||
|
|
2eeb2b0d71 | ||
|
|
f2779f2a50 | ||
|
|
357bb1916e | ||
|
|
67a9ff3e16 | ||
|
|
7099b11651 | ||
|
|
27e9e8ec2b | ||
|
|
4d1e3263f4 | ||
|
|
cb1d630cfb | ||
|
|
d7b9e9ab78 | ||
|
|
cb7b8b956f | ||
|
|
a0608a51c1 | ||
|
|
217f5e7ee5 | ||
|
|
50c4fd79b7 | ||
|
|
4cfd9bdbc0 | ||
|
|
f76e8ae2c5 | ||
|
|
089577c5a8 | ||
|
|
c116f933e2 | ||
|
|
fe496ab03b | ||
|
|
3c3d8417e9 | ||
|
|
2b2672e4bd | ||
|
|
1bfc8c1914 | ||
|
|
2f854cce4a | ||
|
|
40550d0840 | ||
|
|
38bedea0bd | ||
|
|
75ab5c1a36 | ||
|
|
3d7c081068 | ||
|
|
c276bd8a37 | ||
|
|
890bece70c | ||
|
|
4a4fe584d5 | ||
|
|
bcd72d21c7 | ||
|
|
722f5e56cd | ||
|
|
f3c7b2416b | ||
|
|
383d74ceb4 | ||
|
|
64f61b2954 | ||
|
|
5c0002404a | ||
|
|
66f39fd3eb | ||
|
|
e79e3bdf1d | ||
|
|
9dd3ec9179 | ||
|
|
c06ab27d08 | ||
|
|
fab4185c1f | ||
|
|
bc4b399f87 | ||
|
|
52544fa953 | ||
|
|
8b2ea4f0a0 | ||
|
|
45b1ae1fb1 | ||
|
|
090ac6eab2 | ||
|
|
b7169f3da9 | ||
|
|
587c3ab436 | ||
|
|
80bbd9dbf3 | ||
|
|
c019175fff | ||
|
|
7f79ab47ac | ||
|
|
ba188189a8 | ||
|
|
8e6359b3a4 | ||
|
|
aac77ed982 | ||
|
|
1d284ea66a | ||
|
|
9f5268101d | ||
|
|
0bba972657 | ||
|
|
bab9fc01ea | ||
|
|
692ed02df8 | ||
|
|
2e67d03b56 | ||
|
|
56ca3406c4 | ||
|
|
94e8ce5185 | ||
|
|
bb54b0280a | ||
|
|
a99c34d817 | ||
|
|
c06f45cf0e | ||
|
|
8114498fb5 | ||
|
|
889b60a71b | ||
|
|
45023b2e71 | ||
|
|
1c08e64651 | ||
|
|
3432dac261 | ||
|
|
5adab4fafb | ||
|
|
d45aebcd19 | ||
|
|
6bf21e4340 | ||
|
|
7ee6dfa21e | ||
|
|
bd7341ddc2 | ||
|
|
f9d8f479b5 | ||
|
|
fdc956e116 | ||
|
|
a44df9adab | ||
|
|
dbc2ce0b3a | ||
|
|
51b8e02455 | ||
|
|
4f9dfe9afa | ||
|
|
db05ed840d | ||
|
|
8570910a43 | ||
|
|
8a9ee40524 | ||
|
|
c166ce112b | ||
|
|
cea52d2314 | ||
|
|
d1cc937f9d | ||
|
|
b61fbc806b | ||
|
|
dfc212369a | ||
|
|
47b855adf8 | ||
|
|
d1bffd0eb0 |
@@ -1,4 +1,4 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
@@ -6,7 +6,6 @@ root = true
|
||||
# Tab indentation
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# The indent size used in the `package.json` file cannot be changed
|
||||
|
||||
20
.eslintrc.json
Normal file
20
.eslintrc.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-cond-assign": 0,
|
||||
"no-unused-vars": 1,
|
||||
"no-extra-semi": "warn",
|
||||
"semi": "warn"
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true
|
||||
}
|
||||
}
|
||||
}
|
||||
10
.gitattributes
vendored
Normal file
10
.gitattributes
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
* text=auto
|
||||
|
||||
LICENSE.txt eol=crlf
|
||||
ThirdPartyNotices.txt eol=crlf
|
||||
|
||||
*.bat eol=crlf
|
||||
*.cmd eol=crlf
|
||||
*.ps1 eol=lf
|
||||
*.sh eol=lf
|
||||
*.rtf -text
|
||||
18
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
18
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: Bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please search existing issues to avoid creating duplicates. -->
|
||||
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed. -->
|
||||
|
||||
<!-- Use Help > Report Issue to prefill these. -->
|
||||
- Azure Data Studio Version:
|
||||
|
||||
Steps to Reproduce:
|
||||
|
||||
1.
|
||||
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: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: Enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution or feature you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
49
.github/classifier.yml
vendored
Normal file
49
.github/classifier.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
perform: false,
|
||||
alwaysRequireAssignee: false,
|
||||
labelsRequiringAssignee: [],
|
||||
autoAssignees: {
|
||||
accessibility: [],
|
||||
acquisition: [],
|
||||
agent: [],
|
||||
azure: [],
|
||||
backup: [],
|
||||
bcdr: [],
|
||||
'chart viewer': [],
|
||||
connection: [],
|
||||
dacfx: [],
|
||||
dashboard: [],
|
||||
'data explorer': [],
|
||||
documentation: [],
|
||||
'edit data': [],
|
||||
export: [],
|
||||
extensibility: [],
|
||||
extensionManager: [],
|
||||
globalization: [],
|
||||
grid: [],
|
||||
import: [],
|
||||
insights: [],
|
||||
intellisense: [],
|
||||
localization: [],
|
||||
'managed instance': [],
|
||||
notebooks: [],
|
||||
'object explorer': [],
|
||||
performance: [],
|
||||
profiler: [],
|
||||
'query editor': [],
|
||||
'query execution': [],
|
||||
reliability: [],
|
||||
restore: [],
|
||||
scripting: [],
|
||||
'server group': [],
|
||||
settings: [],
|
||||
setup: [],
|
||||
shell: [],
|
||||
showplan: [],
|
||||
snippet: [],
|
||||
sql2019Preview: [],
|
||||
sqldw: [],
|
||||
supportability: [],
|
||||
ux: []
|
||||
}
|
||||
}
|
||||
12
.github/commands.yml
vendored
Normal file
12
.github/commands.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
perform: false,
|
||||
commands: [
|
||||
{
|
||||
type: 'label',
|
||||
name: 'duplicate',
|
||||
allowTriggerByBot: true,
|
||||
action: 'close',
|
||||
comment: "Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues [here](https://aka.ms/vscodeissuesearch). See also our [issue reporting](https://aka.ms/vscodeissuereporting) guidelines.\n\nHappy Coding!"
|
||||
}
|
||||
]
|
||||
}
|
||||
5
.github/copycat.yml
vendored
Normal file
5
.github/copycat.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
perform: true,
|
||||
target_owner: 'anthonydresser',
|
||||
target_repo: 'testissues'
|
||||
}
|
||||
6
.github/locker.yml
vendored
Normal file
6
.github/locker.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
daysAfterClose: 45,
|
||||
daysSinceLastUpdate: 3,
|
||||
ignoredLabels: [],
|
||||
perform: true
|
||||
}
|
||||
6
.github/needs_more_info.yml
vendored
Normal file
6
.github/needs_more_info.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
daysUntilClose: 7,
|
||||
needsMoreInfoLabel: 'needs more info',
|
||||
perform: true,
|
||||
closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity in the last 7 days. If you have more info to help resolve the issue, leave a comment"
|
||||
}
|
||||
6
.github/new_release.yml
vendored
Normal file
6
.github/new_release.yml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
newReleaseLabel: 'new-release',
|
||||
newReleaseColor: '006b75',
|
||||
daysAfterRelease: 5,
|
||||
perform: true
|
||||
}
|
||||
5
.github/similarity.yml
vendored
Normal file
5
.github/similarity.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
perform: true,
|
||||
whenCreatedByTeam: true,
|
||||
comment: "Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:\n${potentialDuplicates}"
|
||||
}
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -3,9 +3,13 @@ npm-debug.log
|
||||
Thumbs.db
|
||||
node_modules/
|
||||
.build/
|
||||
extensions/**/dist/
|
||||
out/
|
||||
out-build/
|
||||
out-editor/
|
||||
out-editor-src/
|
||||
out-editor-build/
|
||||
out-editor-esm/
|
||||
out-editor-min/
|
||||
out-monaco-editor-core/
|
||||
out-vscode/
|
||||
@@ -13,4 +17,5 @@ out-vscode-min/
|
||||
build/node_modules
|
||||
coverage/
|
||||
test_data/
|
||||
yarn-error.log
|
||||
test-results/
|
||||
yarn-error.log
|
||||
|
||||
60
.travis.yml
60
.travis.yml
@@ -1,60 +0,0 @@
|
||||
sudo: false
|
||||
language: cpp
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/yarn
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
webhooks:
|
||||
- http://vscode-probot.westus.cloudapp.azure.com:3450/travis/notifications
|
||||
- http://vscode-test-probot.westus.cloudapp.azure.com:3450/travis/notifications
|
||||
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- gcc-4.9
|
||||
- g++-4.9
|
||||
- gcc-4.9-multilib
|
||||
- g++-4.9-multilib
|
||||
- zip
|
||||
- libgtk2.0-0
|
||||
- libx11-dev
|
||||
- libxkbfile-dev
|
||||
- libsecret-1-dev
|
||||
|
||||
before_install:
|
||||
- git submodule update --init --recursive
|
||||
- git clone --depth 1 https://github.com/creationix/nvm.git ./.nvm
|
||||
- source ./.nvm/nvm.sh
|
||||
- nvm install 8.9.1
|
||||
- nvm use 8.9.1
|
||||
- npm i -g yarn
|
||||
# - npm config set python `which python`
|
||||
- if [ $TRAVIS_OS_NAME == "linux" ]; then
|
||||
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0;
|
||||
sh -e /etc/init.d/xvfb start;
|
||||
sleep 3;
|
||||
fi
|
||||
# Make npm logs less verbose
|
||||
# - npm config set depth 0
|
||||
# - npm config set loglevel warn
|
||||
|
||||
install:
|
||||
- yarn
|
||||
|
||||
script:
|
||||
- node_modules/.bin/gulp electron --silent
|
||||
- node_modules/.bin/gulp compile --silent --max_old_space_size=4096
|
||||
- node_modules/.bin/gulp optimize-vscode --silent --max_old_space_size=4096
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
|
||||
|
||||
after_success:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then node_modules/.bin/coveralls < .build/coverage/lcov.info; fi
|
||||
23
.vscode/cglicenses.schema.json
vendored
Normal file
23
.vscode/cglicenses.schema.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"licenseDetail"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "The name of the dependency"
|
||||
},
|
||||
"licenseDetail": {
|
||||
"type": "array",
|
||||
"description": "The complete license text of the dependency",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
142
.vscode/cgmanifest.schema.json
vendored
Normal file
142
.vscode/cgmanifest.schema.json
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"registrations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"component": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"git"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"git"
|
||||
]
|
||||
},
|
||||
"git": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"repositoryUrl",
|
||||
"commitHash"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"repositoryUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"commitHash": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"npm"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"npm"
|
||||
]
|
||||
},
|
||||
"npm": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type",
|
||||
"other"
|
||||
],
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"other"
|
||||
]
|
||||
},
|
||||
"other": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"downloadUrl",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"downloadUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"version": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"repositoryUrl": {
|
||||
"type": "string",
|
||||
"description": "The git url of the component"
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "The version of the component"
|
||||
},
|
||||
"license": {
|
||||
"type": "string",
|
||||
"description": "The name of the license"
|
||||
},
|
||||
"developmentDependency": {
|
||||
"type": "boolean",
|
||||
"description": "This component is inlined in the vscode repo and **is not shipped**."
|
||||
},
|
||||
"isOnlyProductionDependency": {
|
||||
"type": "boolean",
|
||||
"description": "This component is shipped and **is not inlined in the vscode repo**."
|
||||
},
|
||||
"licenseDetail": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "The license text"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@@ -1,9 +1,9 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"eg2.tslint",
|
||||
"ms-vscode.vscode-typescript-tslint-plugin",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"msjsdiag.debugger-for-chrome"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
155
.vscode/launch.json
vendored
155
.vscode/launch.json
vendored
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
@@ -9,15 +8,13 @@
|
||||
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
|
||||
"stopOnEntry": true,
|
||||
"args": [
|
||||
"watch-extension:json-client"
|
||||
],
|
||||
"cwd": "${workspaceFolder}"
|
||||
"hygiene"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"name": "Attach to Extension Host",
|
||||
"protocol": "inspector",
|
||||
"port": 5870,
|
||||
"restart": true,
|
||||
"outFiles": [
|
||||
@@ -25,19 +22,15 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"name": "Attach to Shared Process",
|
||||
"protocol": "inspector",
|
||||
"port": 5871,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
"port": 9222,
|
||||
"urlFilter": "*"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"protocol": "inspector",
|
||||
"name": "Attach to Search Process",
|
||||
"port": 5876,
|
||||
"outFiles": [
|
||||
@@ -48,7 +41,6 @@
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"name": "Attach to CLI Process",
|
||||
"protocol": "inspector",
|
||||
"port": 5874,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
@@ -58,7 +50,6 @@
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"name": "Attach to Main Process",
|
||||
"protocol": "inspector",
|
||||
"port": 5875,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
@@ -67,13 +58,50 @@
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "attach",
|
||||
"name": "Attach to sqlops",
|
||||
"name": "Attach to azuredatastudio",
|
||||
"port": 9222
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch sqlops",
|
||||
"name": "Launch azuredatastudio",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat",
|
||||
"timeout": 20000
|
||||
},
|
||||
"osx": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
||||
},
|
||||
"linux": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh"
|
||||
},
|
||||
"env": {
|
||||
"VSCODE_EXTHOST_WILL_SEND_SOCKET": null
|
||||
},
|
||||
"breakOnLoad": false,
|
||||
"urlFilter": "*workbench.html*",
|
||||
"runtimeArgs": [
|
||||
"--inspect=5875",
|
||||
"--no-cached-data"
|
||||
],
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch ADS (Main Process)",
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.sh",
|
||||
"runtimeArgs": [
|
||||
"--no-cached-data"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch azuredatastudio with new notebook command",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/sql.bat"
|
||||
},
|
||||
@@ -85,52 +113,107 @@
|
||||
},
|
||||
"urlFilter": "*index.html*",
|
||||
"runtimeArgs": [
|
||||
"--inspect=5875"
|
||||
"--inspect=5875",
|
||||
"--command=notebook.command.new"
|
||||
],
|
||||
"webRoot": "${workspaceFolder}"
|
||||
"skipFiles": [
|
||||
"**/winjs*.js"
|
||||
],
|
||||
"webRoot": "${workspaceFolder}",
|
||||
"timeout": 45000
|
||||
},
|
||||
{
|
||||
"name": "Launch Built-in Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}/extensions/debug-auto-launch"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Unit Tests",
|
||||
"protocol": "inspector",
|
||||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/SQL Operations Studio.app/Contents/MacOS/Electron",
|
||||
"name": "Launch Smoke Test",
|
||||
"program": "${workspaceFolder}/test/smoke/test/index.js",
|
||||
"cwd": "${workspaceFolder}/test/smoke",
|
||||
"env": {
|
||||
"BUILD_ARTIFACTSTAGINGDIRECTORY": "${workspaceFolder}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Run Unit Tests",
|
||||
"program": "${workspaceFolder}/test/electron/index.js",
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/Azure Data Studio.app/Contents/MacOS/Electron",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/sqlops.exe"
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio.exe"
|
||||
},
|
||||
"linux": {
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/sqlops"
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio"
|
||||
},
|
||||
"stopOnEntry": false,
|
||||
"outputCapture": "std",
|
||||
"args": [
|
||||
"--delay",
|
||||
"--timeout",
|
||||
"2000"
|
||||
"--remote-debugging-port=9222"
|
||||
],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"ELECTRON_RUN_AS_NODE": "true"
|
||||
},
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Run Extension Unit Tests",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.bat"
|
||||
},
|
||||
"osx": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
|
||||
},
|
||||
"linux": {
|
||||
"runtimeExecutable": "${workspaceFolder}/scripts/test-extensions-unit.sh"
|
||||
},
|
||||
"webRoot": "${workspaceFolder}",
|
||||
"timeout": 45000
|
||||
},
|
||||
],
|
||||
"compounds": [
|
||||
{
|
||||
"name": "Debug sqlops Main and Renderer",
|
||||
"name": "Debug Unit Tests",
|
||||
"configurations": [
|
||||
"Launch sqlops",
|
||||
"Attach to azuredatastudio",
|
||||
"Run Unit Tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug Extension Unit Tests",
|
||||
"configurations": [
|
||||
"Attach to Extension Host",
|
||||
"Run Extension Unit Tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug azuredatastudio Main and Renderer",
|
||||
"configurations": [
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Main Process"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Search and Renderer processes",
|
||||
"configurations": [
|
||||
"Launch sqlops",
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Search Process"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Renderer and Extension Host processes",
|
||||
"configurations": [
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Extension Host"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
26
.vscode/settings.json
vendored
26
.vscode/settings.json
vendored
@@ -10,6 +10,9 @@
|
||||
"when": "$(basename).ts"
|
||||
}
|
||||
},
|
||||
"files.associations": {
|
||||
"cglicenses.json": "jsonc"
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/bower_components": true,
|
||||
@@ -19,9 +22,9 @@
|
||||
"out-vscode/**": true,
|
||||
"i18n/**": true,
|
||||
"extensions/**/out/**": true,
|
||||
"test/smoke/out/**": true
|
||||
"test/smoke/out/**": true,
|
||||
"src/vs/base/test/node/uri.test.data.txt": true
|
||||
},
|
||||
"tslint.enable": true,
|
||||
"lcov.path": [
|
||||
"./.build/coverage/lcov.info",
|
||||
"./.build/coverage-single/lcov.info"
|
||||
@@ -36,5 +39,24 @@
|
||||
}
|
||||
],
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"npm.exclude": "**/extensions/**",
|
||||
"git.ignoreLimitWarning": true,
|
||||
"emmet.excludeLanguages": [],
|
||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||
"typescript.preferences.quoteStyle": "single",
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": [
|
||||
"cgmanifest.json"
|
||||
],
|
||||
"url": "./.vscode/cgmanifest.schema.json"
|
||||
},
|
||||
{
|
||||
"fileMatch": [
|
||||
"cglicenses.json"
|
||||
],
|
||||
"url": "./.vscode/cglicenses.schema.json"
|
||||
}
|
||||
],
|
||||
"git.ignoreLimitWarning": true
|
||||
}
|
||||
40
.vscode/shared.code-snippets
vendored
Normal file
40
.vscode/shared.code-snippets
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
// Each snippet is defined under a snippet name and has a scope, prefix, body and
|
||||
// description. The scope defines in watch languages the snippet is applicable. The prefix is what is
|
||||
// used to trigger the snippet and the body will be expanded and inserted.Possible variables are:
|
||||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
|
||||
// Placeholders with the same ids are connected.
|
||||
// Example:
|
||||
"MSFT Copyright Header": {
|
||||
"scope": "javascript,typescript,css",
|
||||
"prefix": [
|
||||
"header",
|
||||
"stub",
|
||||
"copyright"
|
||||
],
|
||||
"body": [
|
||||
"/*---------------------------------------------------------------------------------------------",
|
||||
" * Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
" * Licensed under the Source EULA. See License.txt in the project root for license information.",
|
||||
" *--------------------------------------------------------------------------------------------*/",
|
||||
"",
|
||||
"$0"
|
||||
],
|
||||
"description": "Insert Copyright Statement"
|
||||
},
|
||||
"TS -> Inject Service": {
|
||||
"scope": "typescript",
|
||||
"description": "Constructor Injection Pattern",
|
||||
"prefix": "@inject",
|
||||
"body": "@$1 private readonly _$2: ${1},$0"
|
||||
},
|
||||
"TS -> Event & Emitter": {
|
||||
"scope": "typescript",
|
||||
"prefix": "emitter",
|
||||
"description": "Add emitter and event properties",
|
||||
"body": [
|
||||
"private readonly _onDid$1 = new Emitter<$2>();",
|
||||
"readonly onDid$1: Event<$2> = this._onDid$1.event;"
|
||||
],
|
||||
}
|
||||
}
|
||||
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@@ -69,4 +69,4 @@
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
2
.yarnrc
2
.yarnrc
@@ -1,3 +1,3 @@
|
||||
disturl "https://atom.io/download/electron"
|
||||
target "1.7.11"
|
||||
target "3.1.6"
|
||||
runtime "electron"
|
||||
|
||||
266
CHANGELOG.md
266
CHANGELOG.md
@@ -1,5 +1,271 @@
|
||||
# Change Log
|
||||
|
||||
## Version 1.5.1
|
||||
* Release date: March 18, 2019
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Announcing T-SQL Notebooks
|
||||
* Announcing PostgreSQL extension
|
||||
* Announcing SQL Server Dacpac extension
|
||||
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/25?closed=1).
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
||||
|
||||
## Version 1.4.5
|
||||
* Release date: February 13, 2019
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Added **Admin pack for SQL Server** extension pack to make it easier to install SQL Server admin-related extensions. This includes:
|
||||
* [SQL Server Agent](https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-agent-extension?view=sql-server-2017)
|
||||
* [SQL Server Profiler](https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-profiler-extension?view=sql-server-2017)
|
||||
* [SQL Server Import](https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-import-extension?view=sql-server-2017)
|
||||
* Added filtering extended event support in Profiler extension
|
||||
* Added Save as XML feature that can save T-SQL results as XML
|
||||
* Added Data-Tier Application Wizard improvements
|
||||
* Added Generate script button
|
||||
* Added view to give warnings of possible data loss during deployment
|
||||
* Updates to the [SQL Server 2019 Preview extension](https://docs.microsoft.com/sql/azure-data-studio/sql-server-2019-extension?view=sql-server-ver15)
|
||||
* Results streaming enabled by default for long running queries
|
||||
* Resolved [bugs and issues](https://github.com/Microsoft/azuredatastudio/milestone/23?closed=1).
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
|
||||
* sadedil for `Missing feature request: Save as XML #3729`
|
||||
* gbritton1 for `Removed reference to object explorer #3463`
|
||||
|
||||
## Version 1.3.8
|
||||
* Release date: January 9, 2019
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* #13 Feature Request: Azure Active Directory Authentication
|
||||
* #1040 Stream initial query results as they become available
|
||||
* #3298 Сan't add an azure account.
|
||||
* #2387 Support Per-User Installer
|
||||
* SQL Server Import updates for DACPAC\BACPAC
|
||||
* SQL Server Profiler UI and UX improvements
|
||||
* Updates to [SQL Server 2019 extension](https://docs.microsoft.com/sql/azure-data-studio/sql-server-2019-extension?view=sql-server-ver15)
|
||||
* **sp_executesql to SQL** and **New Database** extensions
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* Tarig0 for `Add Routine_Type to CreateStoredProc fixes #3257 (#3286)`
|
||||
* oltruong for `typo fix #3025'`
|
||||
* Thomas-S-B for `Removed unnecessary IErrorDetectionStrategy #749`
|
||||
* Thomas-S-B for `Simplified code #750`
|
||||
|
||||
## Version 1.2.4
|
||||
* Release date: November 6, 2018
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Update to the SQL Server 2019 Preview extension
|
||||
* Introducing Paste the Plan extension
|
||||
* Introducing High Color queries extension, including SSMS editor theme
|
||||
* Fixes in SQL Server Agent, Profiler, and Import extensions
|
||||
* Fix .Net Core Socket KeepAlive issue causing dropped inactive connections on macOS
|
||||
* Upgrade SQL Tools Service to .Net Core 2.2 Preview 3 (for eventual AAD support)
|
||||
* Fix customer reported GitHub issues
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* rdaniels6813 for `Add query plan theme support #3031`
|
||||
* Ruturaj123 for `Fixed some typos and grammatical errors #3027`
|
||||
* PromoFaux for `Use emoji shortcodes in CONTRIBUTING.md instead of <20> #3009`
|
||||
* ckaczor for `Fix: DATETIMEOFFSET data types should be ISO formatted #714`
|
||||
* hi-im-T0dd for `Fixed sync issue with my forked master so this commit is correct #2948`
|
||||
* hi-im-T0dd for `Fixed when right clicking and selecting Manage-correct name displays #2794`
|
||||
|
||||
## Version 1.1.3
|
||||
* Release date: October 18, 2018
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Introducing the Azure Resource Explorer to browse Azure SQL Databases
|
||||
* Improve Object Explorer and Query Editor connectivity robustness
|
||||
* SQL Server 2019 and SQL Agent extension improvements
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* philoushka for `center the icon #2760`
|
||||
* anthonypants for `Typo #2775`
|
||||
* kstolte for `Fix Invalid Configuration in Launch.json #2789`
|
||||
* kstolte for `Fixing a reference to SQL Ops Studio #2788`
|
||||
|
||||
## Version 1.0.0
|
||||
* Release date: September 24, 2018
|
||||
* Release status: General Availability
|
||||
|
||||
## What's new in this version
|
||||
* Announcing the SQL Server 2019 Preview extension.
|
||||
* Support for SQL Server 2019 preview features including big data cluster support.
|
||||
* Azure Data Studio Notebooks
|
||||
* The Azure Resource Explorer viewlets you browse data-related endpoints for your Azure accounts and create connections to them in Object Explorer. In this release Azure SQL Databases and servers are supported.
|
||||
* SQL Server Polybase Create External Table Wizard
|
||||
* Query Results Grid performance and UX improvements for large number of result sets.
|
||||
* Visual Studio Code source code refresh from 1.23 to 1.26.1 with Grid Layout and Improved Settings Editor (preview).
|
||||
* Accessibility improvements for screen reader, keyboard navigation and high-contrast.
|
||||
* Added Connection name option to provide an alternative display name in the Servers viewlet.
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* AlexFsmn `Feature: Ability to add connection name #2332`
|
||||
* AlexFsmn `Disabled connection name input when connecting to a server. #2566`
|
||||
|
||||
## Version 0.33.7
|
||||
* Release date: August 30, 2018
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
* Announcing the SQL Server Import Extension
|
||||
* SQL Server Profiler Session management
|
||||
* SQL Server Agent improvements
|
||||
* New community extension: First Responder Kit
|
||||
* Quality of Life improvements: Connection strings
|
||||
* Fix many customer reported GitHub issues
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* SebastianPfliegel `Added more saveAsCsv options #2099`
|
||||
* ianychoi `Fixes a typo: Mimunum -> Minimum #1994`
|
||||
* AlexFsmn `Fixed bug where proper file extension wasn't appended to filename. #2151`
|
||||
* AlexFsmn `Added functionality for adding any file to import wizard #2329`
|
||||
* AlexFsmn `Fixed background issue when copying a chart to clipboard #2215`
|
||||
* AlexFsmn `Fixed problem where vertical charts didn't display labels correctly. #2263`
|
||||
* AlexFsmn `Fixed Initial values for charts to match visuals #2266`
|
||||
* AlexFsmn `Renamed chart option labels #2264`
|
||||
* AlexFsmn `Added feature for opening file after exporting to CSV/XLS/JSON & query files #2216`
|
||||
* AlexFsmm `Get Connection String should copy to clipboard #2175`
|
||||
|
||||
## Version 0.31.4
|
||||
* Release date: July 19, 2018
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
* SQL Server Agent for Azure Data Studio extension improvements
|
||||
* Added view of Alerts, Operators, and Proxies and icons on left pane
|
||||
* Added dialogs for New Job, New Job Step, New Alert, and New Operator
|
||||
* Added Delete Job, Delete Alert, and Delete Operator (right-click)
|
||||
* Added Previous Runs visualization
|
||||
* Added Filters for each column name
|
||||
* SQL Server Profiler for Azure Data Studio extension improvements
|
||||
* Added Hotkeys to quickly launch and start/stop Profiler
|
||||
* Added 5 Default Templates to view Extended Events
|
||||
* Added Server/Database connection name
|
||||
* Added support for Azure SQL Database instances
|
||||
* Added suggestion to exit Profiler when tab is closed when Profiler is still running
|
||||
* Release of Combine Scripts Extension
|
||||
* Wizard and Dialog Extensibility
|
||||
* Fix GitHub Issues
|
||||
|
||||
## Version 0.30.6
|
||||
* Release date: June 20, 2018
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
* **SQL Server Profiler for Azure Data Studio *Preview*** extension initial release
|
||||
* The new **SQL Data Warehouse** extension includes rich customizable dashboard widgets surfacing insights to your data warehouse. This unlocks key scenarios around managing and tuning your data warehouse to ensure it is optimized for consistent performance.
|
||||
* **Edit Data "Filtering and Sorting"** support
|
||||
* **SQL Server Agent for Azure Data Studio *Preview*** extension enhancements for Jobs and Job History views
|
||||
* Improved **Wizard & Dialog UI Builder Framework** extensibility APIs
|
||||
* Update VS Code Platform source code integrating [March 2018 (1.22)](https://code.visualstudio.com/updates/v1_22) and [April 2018 (1.23)](https://code.visualstudio.com/updates/v1_23) releases
|
||||
* Fix GitHub Issues
|
||||
|
||||
## Version 0.29.3
|
||||
* Release date: May 7, 2018
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
The May release is focused on stabilization and bug fixes leading up to the Build conference. This build contains the following highlights.
|
||||
|
||||
* Announcing **Redgate SQL Search** extension available in Extension Manager
|
||||
* Community Localization available for 10 languages: **German, Spanish, French, Italian, Japanese, Korean, Portuguese, Russian, Simplified Chinese and Traditional Chinese!**
|
||||
* Reduced telemetry collection, improved [opt-out](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Disable-Telemetry-Reporting) experience and in-product links to [Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement)
|
||||
* Extension Manager has improved Marketplace experience to easily discover community extensions
|
||||
* SQL Agent extension Jobs and Job History view improvement
|
||||
* Updates for **whoisactive** and **Server Reports** extensions
|
||||
* Continue to fix GitHub issues
|
||||
|
||||
## Version 0.28.6
|
||||
* Release date: April 25, 2018
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
The April Public Preview release contains some of the following highlights.
|
||||
|
||||
* Improvements to SQL Agent *Preview* extension
|
||||
* Accessibility improvements for keyboard navigation, screen reader support and high-contrast mode.
|
||||
* Improved large and protected file support for saving Admin protected and >256M files within SQL Ops Studio
|
||||
* Integrated Terminal splitting to work with multiple open terminals at once
|
||||
* Reduced installation on-disk file count foot print for faster installs and startup times
|
||||
* Improvements to Server Reports extension
|
||||
* Continue to fix GitHub issues
|
||||
|
||||
## Version 0.27.3
|
||||
* Release date: March 28, 2017
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
The March Public Preview release enables some key aspects of the Azure Data Studio
|
||||
extensibility story. Here are some highlights in this release.
|
||||
|
||||
* Enhance the Manage Dashboard extensibility model to support tabbed Insights and Configuration panes
|
||||
* Dashboard Insights extensions for `sp_whoisactive` from [whoisactive.com](http://whoisactive.com)
|
||||
* Extension Manager enables simple acquisition of 1st-party and 3rd-party extensions
|
||||
* Add additional Extensibility APIs for `connection` and `objectexplorer` management
|
||||
* Community Localization open for 10 languages
|
||||
* Continue to fix important customer impacting GitHub issues
|
||||
|
||||
## Version 0.26.7
|
||||
* Release date: February 16, 2017
|
||||
* Release status: Public Preview Hotfix 1
|
||||
|
||||
## What's new in this version
|
||||
* Bug fix for `#717 Selecting partial query and hitting Cmd or Ctrl+C opens terminal with Error message`
|
||||
|
||||
## Version 0.26.6
|
||||
* Release date: February 15, 2017
|
||||
* Release status: Public Preview
|
||||
|
||||
## What's new in this version
|
||||
The February release fixes several important customer reported issues, as well as various feature improvements. We've also introduced auto-update support in February which will simplify keeping updated with the lastest changes.
|
||||
|
||||
Here's some of the highlights in the February release.
|
||||
|
||||
* Support Auto-Update installation on Windows and macOS
|
||||
* Publish RPM and DEB packages to offical Microsoft repos
|
||||
* Fix `#6 Keep connection and selected database when opening new query tabs`
|
||||
* Fix `#22 'Server Name' and 'Database Name' - Can these be drop downs instead of text` boxes?
|
||||
* Fix #481 Add "Check for updates" option.
|
||||
* SQL Editor colorization and auto-completion fixes
|
||||
* `#584 Keyword "FULL" not highlighted by IntelliSense`
|
||||
* `#345 Colorize SQL functions within the editor`
|
||||
* `#300 [#tempData] latest "]" will display green color`
|
||||
* `#225 Keyword color mismatch`
|
||||
* `#60 invalid sql syntax color highlighting when using temporary table in from clause`
|
||||
* Introduce Connection extensibility API
|
||||
* VS Code Editor 1.19 integration
|
||||
* Update JustinPealing/html-query-plan component to pick-up several Query Plan viewer improvements
|
||||
|
||||
## Contributions and "thank you"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* SebastianPfliegel for `Add cursor snippet (#475)`
|
||||
* mikaoelitiana for fix: `revert README and CONTRIBUTING after last VSCode merge (#574)`
|
||||
* alextercete for `Reinstate menu item to install from VSIX (#682)`
|
||||
|
||||
## Version 0.25.4
|
||||
* Release date: January 17, 2017
|
||||
* Release status: Public Preview
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
## Contributing Issues
|
||||
|
||||
### Before Submitting an Issue
|
||||
First, please do a search in [open issues](https://github.com/Microsoft/sqlopsstudio/issues) to see if the issue or feature request has already been filed. Use this [query](https://github.com/Microsoft/sqlopsstudio/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) to search for the most popular feature requests.
|
||||
First, please do a search in [open issues](https://github.com/Microsoft/azuredatastudio/issues) to see if the issue or feature request has already been filed. Use this [query](https://github.com/Microsoft/azuredatastudio/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) to search for the most popular feature requests.
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment.
|
||||
|
||||
👍 - upvote
|
||||
:+1: - upvote
|
||||
|
||||
👎 - downvote
|
||||
:-1: - downvote
|
||||
|
||||
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
|
||||
|
||||
@@ -18,29 +18,33 @@ File a single issue per problem and feature request.
|
||||
* Do not enumerate multiple bugs or feature requests in the same issue.
|
||||
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
|
||||
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
The more information you can provide, the more likely someone will be successful at reproducing the issue and finding a fix.
|
||||
|
||||
Please include the following with each issue.
|
||||
The built-in tool for reporting an issue, which you can access by using `Report Issue` in Azure Data Studio's Help menu, can help streamline this process by automatically providing the version of Azure Data Studio, all your installed extensions, and your system info.
|
||||
|
||||
* Version of SQL Ops Studio
|
||||
Please include the following with each issue.
|
||||
|
||||
> **Tip:** You can easily create an issue using `Report Issues` from SQL Operations Studio Help menu.
|
||||
* Version of Azure Data Studio (formerly SQL Operations Studio)
|
||||
|
||||
* Reproducible steps (1... 2... 3...) and what you expected versus what you actually saw.
|
||||
* Images, animations, or a link to a video.
|
||||
* A code snippet that demonstrates the issue or a link to a code repository we can easily pull down onto our machine to recreate the issue.
|
||||
* Your operating system
|
||||
|
||||
> **Note:** Because we need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
|
||||
> **Tip:** You can easily create an issue using `Report Issues` from Azure Data Studio Help menu.
|
||||
|
||||
* Reproducible steps (1... 2... 3...) and what you expected versus what you actually saw.
|
||||
* Images, animations, or a link to a video.
|
||||
* A code snippet that demonstrates the issue or a link to a code repository we can easily pull down onto our machine to recreate the issue.
|
||||
|
||||
> **Note:** Because we need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
|
||||
|
||||
* Errors in the Dev Tools Console (Help | Toggle Developer Tools)
|
||||
|
||||
Please remember to do the following:
|
||||
|
||||
* Search the issue repository to see if there exists a duplicate.
|
||||
* Simplify your scripts around the issue so we can better isolate the problem.
|
||||
* Search the issue repository to see if there exists a duplicate.
|
||||
* Simplify your scripts around the issue so we can better isolate the problem.
|
||||
|
||||
Don't feel bad if we can't reproduce the issue and ask for more information!
|
||||
|
||||
## Contributing Fixes
|
||||
If you are interested in fixing issues and contributing directly to the code base,
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute).
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute).
|
||||
|
||||
12
LICENSE.txt
12
LICENSE.txt
@@ -1,14 +1,14 @@
|
||||
MICROSOFT SOFTWARE LICENSE TERMS
|
||||
|
||||
MICROSOFT SQL OPERATIONS STUDIO
|
||||
MICROSOFT AZURE DATA STUDIO
|
||||
|
||||
Microsoft Corporation ("Microsoft") grants you a nonexclusive, perpetual,
|
||||
royalty-free right to use, copy, and modify the software code provided by us
|
||||
("Software Code"). You may not sublicense the Software Code or any use of it
|
||||
(except to your affiliates and to vendors to perform work on your behalf)
|
||||
through distribution, network access, service agreement, lease, rental, or
|
||||
otherwise. Unless applicable law gives you more rights, Microsoft reserves all
|
||||
other rights not expressly granted herein, whether by implication, estoppel or
|
||||
("Software Code"). You may not sublicense the Software Code or any use of it
|
||||
(except to your affiliates and to vendors to perform work on your behalf)
|
||||
through distribution, network access, service agreement, lease, rental, or
|
||||
otherwise. Unless applicable law gives you more rights, Microsoft reserves all
|
||||
other rights not expressly granted herein, whether by implication, estoppel or
|
||||
otherwise.
|
||||
|
||||
THE SOFTWARE CODE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
||||
|
||||
812
OSSREADME.json
812
OSSREADME.json
@@ -1,812 +0,0 @@
|
||||
// Listing in here platform dependencies that come in at build time
|
||||
|
||||
[{
|
||||
"isLicense": true,
|
||||
"name": "async-each",
|
||||
"repositoryURL": "https://github.com/paulmillr/async-each",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"The MIT License (MIT)",
|
||||
"",
|
||||
"Copyright (c) 2016 Paul Miller [(paulmillr.com)](http://paulmillr.com)",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||
"of this software and associated documentation files (the “Software”), to deal",
|
||||
"in the Software without restriction, including without limitation the rights",
|
||||
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
|
||||
"copies of the Software, and to permit persons to whom the Software is",
|
||||
"furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in",
|
||||
"all copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
|
||||
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
|
||||
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
|
||||
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN",
|
||||
"THE SOFTWARE."
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "chokidar",
|
||||
"repositoryURL": "https://github.com/paulmillr/chokidar",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"The MIT license.",
|
||||
"",
|
||||
"Copyright (c) 2012 - 2016 Paul Miller [paulmillr.com](http://paulmillr.com) & Elan Shanker",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy of",
|
||||
"this software and associated documentation files (the \"Software\"), to deal in",
|
||||
"the Software without restriction, including without limitation the rights to",
|
||||
"use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies",
|
||||
"of the Software, and to permit persons to whom the Software is furnished to do",
|
||||
"so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in all",
|
||||
"copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
|
||||
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
|
||||
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
|
||||
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
|
||||
"SOFTWARE."
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"name": "chromium",
|
||||
"version": "58.0.3029.110",
|
||||
"repositoryURL": "http://www.chromium.org/Home",
|
||||
"licenseDetail": [
|
||||
"BSD License",
|
||||
"",
|
||||
"Copyright 2015 The Chromium Authors. All rights reserved.",
|
||||
"",
|
||||
"Redistribution and use in source and binary forms, with or without modification,",
|
||||
"are permitted provided that the following conditions are met:",
|
||||
"",
|
||||
" * Redistributions of source code must retain the above copyright notice, this",
|
||||
" list of conditions and the following disclaimer.",
|
||||
"",
|
||||
" * Redistributions in binary form must reproduce the above copyright notice,",
|
||||
" this list of conditions and the following disclaimer in the documentation",
|
||||
" and/or other materials provided with the distribution.",
|
||||
"",
|
||||
" * Neither the name Google Inc. nor the names of its contributors may be used to",
|
||||
" endorse or promote products derived from this software without specific",
|
||||
" prior written permission.",
|
||||
"",
|
||||
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND",
|
||||
"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED",
|
||||
"WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",
|
||||
"DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR",
|
||||
"ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
|
||||
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;",
|
||||
"LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON",
|
||||
"ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT",
|
||||
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS",
|
||||
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"name": "libchromiumcontent",
|
||||
"version": "58.0.3029.110",
|
||||
"license": "MIT",
|
||||
"repositoryURL": "https://github.com/electron/libchromiumcontent",
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"name": "nodejs",
|
||||
"version": "7.9.0",
|
||||
"repositoryURL": "https://github.com/nodejs/node",
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "1.7.3",
|
||||
"license": "MIT",
|
||||
"repositoryURL": "https://github.com/electron/electron",
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"name": "inno setup",
|
||||
"version": "5.5.6",
|
||||
"repositoryURL": "https://github.com/jrsoftware/issrc",
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "ripgrep",
|
||||
"repositoryURL": "https://github.com/BurntSushi/ripgrep",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"The MIT License (MIT)",
|
||||
"",
|
||||
"Copyright (c) 2015 Andrew Gallant",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy of",
|
||||
"this software and associated documentation files (the \"Software\"), to deal in",
|
||||
"the Software without restriction, including without limitation the rights to",
|
||||
"use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies",
|
||||
"of the Software, and to permit persons to whom the Software is furnished to do",
|
||||
"so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in all",
|
||||
"copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
|
||||
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
|
||||
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
|
||||
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
|
||||
"SOFTWARE."
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "jschardet",
|
||||
"repositoryURL": "https://github.com/aadsm/jschardet",
|
||||
"license": "LGPL",
|
||||
"licenseDetail": [
|
||||
"Chardet was originally ported from C++ by Mark Pilgrim. It is now maintained",
|
||||
" by Dan Blanchard and Ian Cordasco, and was formerly maintained by Erik Rose.",
|
||||
" JSChardet was ported from python to JavaScript by António Afonso ",
|
||||
" (https://github.com/aadsm/jschardet) and transformed into an npm package by ",
|
||||
"Markus Ast (https://github.com/brainafk)",
|
||||
"",
|
||||
"GNU LESSER GENERAL PUBLIC LICENSE",
|
||||
"\t\t Version 2.1, February 1999",
|
||||
"",
|
||||
" Copyright (C) 1991,",
|
||||
"1999 Free Software Foundation, Inc.",
|
||||
" 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA",
|
||||
" Everyone is permitted to copy and distribute verbatim copies",
|
||||
" of this license document, but changing it is not allowed.",
|
||||
"",
|
||||
"[This is the first released version of the Lesser GPL. It also counts",
|
||||
" as the successor of the GNU Library Public License, version 2, hence",
|
||||
" the version number 2.1.",
|
||||
"]",
|
||||
"",
|
||||
"\t\t\t Preamble",
|
||||
"",
|
||||
" The licenses for most software are designed to take away your",
|
||||
"freedom to share and change it. By contrast, the GNU General Public",
|
||||
"Licenses are intended to guarantee your freedom to share and change",
|
||||
"free software--to make sure the software is free for all its users.",
|
||||
"",
|
||||
" This license, the Lesser General Public License, applies to some",
|
||||
"specially designated software packages--typically libraries--of the",
|
||||
"Free Software Foundation and other authors who decide to use it. You",
|
||||
"can use it too, but we suggest you first think carefully about whether",
|
||||
"this license or the ordinary General Public License is the better",
|
||||
"strategy to use in any particular case, based on the explanations below.",
|
||||
"",
|
||||
" When we speak of free software, we are referring to freedom of use,",
|
||||
"not price. Our General Public Licenses are designed to make sure that",
|
||||
"you have the freedom to distribute copies of free software (and charge",
|
||||
"for this service if you wish); that you receive source code or can get",
|
||||
"it if you want it; that you can change the software and use pieces of",
|
||||
"it in new free programs; and that you are informed that you can do",
|
||||
"these things.",
|
||||
"",
|
||||
" To protect your rights, we need to make restrictions that forbid",
|
||||
"distributors to deny you these rights or to ask you to surrender these",
|
||||
"rights. These restrictions translate to certain responsibilities for",
|
||||
"you if you distribute copies of the library or if you modify it.",
|
||||
"",
|
||||
" For example, if you distribute copies of the library, whether gratis",
|
||||
"or for a fee, you must give the recipients all the rights that we gave",
|
||||
"you. You must make sure that they, too, receive or can get the source",
|
||||
"code. If you link other code with the library, you must provide",
|
||||
"complete object files to the recipients, so that they can relink them",
|
||||
"with the library after making changes to the library and recompiling",
|
||||
"it. And you must show them these terms so they know their rights.",
|
||||
"",
|
||||
" We protect your rights with a two-step method: (1) we copyright the",
|
||||
"library, and (2) we offer you this license, which gives you legal",
|
||||
"permission to copy, distribute and/or modify the library.",
|
||||
"",
|
||||
" To protect each distributor, we want to make it very clear that",
|
||||
"there is no warranty for the free library. Also, if the library is",
|
||||
"modified by someone else and passed on, the recipients should know",
|
||||
"that what they have is not the original version, so that the original",
|
||||
"author's reputation will not be affected by problems that might be",
|
||||
"introduced by others.",
|
||||
"",
|
||||
" Finally, software patents pose a constant threat to the existence of",
|
||||
"any free program. We wish to make sure that a company cannot",
|
||||
"effectively restrict the users of a free program by obtaining a",
|
||||
"restrictive license from a patent holder. Therefore, we insist that",
|
||||
"any patent license obtained for a version of the library must be",
|
||||
"consistent with the full freedom of use specified in this license.",
|
||||
"",
|
||||
" Most GNU software, including some libraries, is covered by the",
|
||||
"ordinary GNU General Public License. This license, the GNU Lesser",
|
||||
"General Public License, applies to certain designated libraries, and",
|
||||
"is quite different from the ordinary General Public License. We use",
|
||||
"this license for certain libraries in order to permit linking those",
|
||||
"libraries into non-free programs.",
|
||||
"",
|
||||
" When a program is linked with a library, whether statically or using",
|
||||
"a shared library, the combination of the two is legally speaking a",
|
||||
"combined work, a derivative of the original library. The ordinary",
|
||||
"General Public License therefore permits such linking only if the",
|
||||
"entire combination fits its criteria of freedom. The Lesser General",
|
||||
"Public License permits more lax criteria for linking other code with",
|
||||
"the library.",
|
||||
"",
|
||||
" We call this license the \"Lesser\" General Public License because it",
|
||||
"does Less to protect the user's freedom than the ordinary General",
|
||||
"Public License. It also provides other free software developers Less",
|
||||
"of an advantage over competing non-free programs. These disadvantages",
|
||||
"are the reason we use the ordinary General Public License for many",
|
||||
"libraries. However, the Lesser license provides advantages in certain",
|
||||
"special circumstances.",
|
||||
"",
|
||||
" For example, on rare occasions, there may be a special need to",
|
||||
"encourage the widest possible use of a certain library, so that it becomes",
|
||||
"a de-facto standard. To achieve this, non-free programs must be",
|
||||
"allowed to use the library. A more frequent case is that a free",
|
||||
"library does the same job as widely used non-free libraries. In this",
|
||||
"case, there is little to gain by limiting the free library to free",
|
||||
"software only, so we use the Lesser General Public License.",
|
||||
"",
|
||||
" In other cases, permission to use a particular library in non-free",
|
||||
"programs enables a greater number of people to use a large body of",
|
||||
"free software. For example, permission to use the GNU C Library in",
|
||||
"non-free programs enables many more people to use the whole GNU",
|
||||
"operating system, as well as its variant, the GNU/Linux operating",
|
||||
"system.",
|
||||
"",
|
||||
" Although the Lesser General Public License is Less protective of the",
|
||||
"users' freedom, it does ensure that the user of a program that is",
|
||||
"linked with the Library has the freedom and the wherewithal to run",
|
||||
"that program using a modified version of the Library.",
|
||||
"",
|
||||
" The precise terms and conditions for copying, distribution and",
|
||||
"modification follow. Pay close attention to the difference between a",
|
||||
"\"work based on the library\" and a \"work that uses the library\". The",
|
||||
"former contains code derived from the library, whereas the latter must",
|
||||
"be combined with the library in order to run.",
|
||||
"",
|
||||
"\t\t GNU LESSER GENERAL PUBLIC LICENSE",
|
||||
" TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION",
|
||||
"",
|
||||
" 0. This License Agreement applies to any software library or other",
|
||||
"program which contains a notice placed by the copyright holder or",
|
||||
"other authorized party saying it may be distributed under the terms of",
|
||||
"this Lesser General Public License (also called \"this License\").",
|
||||
"Each licensee is addressed as \"you\".",
|
||||
"",
|
||||
" A \"library\" means a collection of software functions and/or data",
|
||||
"prepared so as to be conveniently linked with application programs",
|
||||
"(which use some of those functions and data) to form executables.",
|
||||
"",
|
||||
" The \"Library\", below, refers to any such software library or work",
|
||||
"which has been distributed under these terms. A \"work based on the",
|
||||
"Library\" means either the Library or any derivative work under",
|
||||
"copyright law: that is to say, a work containing the Library or a",
|
||||
"portion of it, either verbatim or with modifications and/or translated",
|
||||
"straightforwardly into another language. (Hereinafter, translation is",
|
||||
"included without limitation in the term \"modification\".)",
|
||||
"",
|
||||
" \"Source code\" for a work means the preferred form of the work for",
|
||||
"making modifications to it. For a library, complete source code means",
|
||||
"all the source code for all modules it contains, plus any associated",
|
||||
"interface definition files, plus the scripts used to control compilation",
|
||||
"and installation of the library.",
|
||||
"",
|
||||
" Activities other than copying, distribution and modification are not",
|
||||
"covered by this License; they are outside its scope. The act of",
|
||||
"running a program using the Library is not restricted, and output from",
|
||||
"such a program is covered only if its contents constitute a work based",
|
||||
"on the Library (independent of the use of the Library in a tool for",
|
||||
"writing it). Whether that is true depends on what the Library does",
|
||||
"and what the program that uses the Library does.",
|
||||
"",
|
||||
" 1. You may copy and distribute verbatim copies of the Library's",
|
||||
"complete source code as you receive it, in any medium, provided that",
|
||||
"you conspicuously and appropriately publish on each copy an",
|
||||
"appropriate copyright notice and disclaimer of warranty; keep intact",
|
||||
"all the notices that refer to this License and to the absence of any",
|
||||
"warranty; and distribute a copy of this License along with the",
|
||||
"Library.",
|
||||
"",
|
||||
" You may charge a fee for the physical act of transferring a copy,",
|
||||
"and you may at your option offer warranty protection in exchange for a",
|
||||
"fee.",
|
||||
"",
|
||||
" 2. You may modify your copy or copies of the Library or any portion",
|
||||
"of it, thus forming a work based on the Library, and copy and",
|
||||
"distribute such modifications or work under the terms of Section 1",
|
||||
"above, provided that you also meet all of these conditions:",
|
||||
"",
|
||||
" a) The modified work must itself be a software library.",
|
||||
"",
|
||||
" b) You must cause the files modified to carry prominent notices",
|
||||
" stating that you changed the files and the date of any change.",
|
||||
"",
|
||||
" c) You must cause the whole of the work to be licensed at no",
|
||||
" charge to all third parties under the terms of this License.",
|
||||
"",
|
||||
" d) If a facility in the modified Library refers to a function or a",
|
||||
" table of data to be supplied by an application program that uses",
|
||||
" the facility, other than as an argument passed when the facility",
|
||||
" is invoked, then you must make a good faith effort to ensure that,",
|
||||
" in the event an application does not supply such function or",
|
||||
" table, the facility still operates, and performs whatever part of",
|
||||
" its purpose remains meaningful.",
|
||||
"",
|
||||
" (For example, a function in a library to compute square roots has",
|
||||
" a purpose that is entirely well-defined independent of the",
|
||||
" application. Therefore, Subsection 2d requires that any",
|
||||
" application-supplied function or table used by this function must",
|
||||
" be optional: if the application does not supply it, the square",
|
||||
" root function must still compute square roots.)",
|
||||
"",
|
||||
"These requirements apply to the modified work as a whole. If",
|
||||
"identifiable sections of that work are not derived from the Library,",
|
||||
"and can be reasonably considered independent and separate works in",
|
||||
"themselves, then this License, and its terms, do not apply to those",
|
||||
"sections when you distribute them as separate works. But when you",
|
||||
"distribute the same sections as part of a whole which is a work based",
|
||||
"on the Library, the distribution of the whole must be on the terms of",
|
||||
"this License, whose permissions for other licensees extend to the",
|
||||
"entire whole, and thus to each and every part regardless of who wrote",
|
||||
"it.",
|
||||
"",
|
||||
"Thus, it is not the intent of this section to claim rights or contest",
|
||||
"your rights to work written entirely by you; rather, the intent is to",
|
||||
"exercise the right to control the distribution of derivative or",
|
||||
"collective works based on the Library.",
|
||||
"",
|
||||
"In addition, mere aggregation of another work not based on the Library",
|
||||
"with the Library (or with a work based on the Library) on a volume of",
|
||||
"a storage or distribution medium does not bring the other work under",
|
||||
"the scope of this License.",
|
||||
"",
|
||||
" 3. You may opt to apply the terms of the ordinary GNU General Public",
|
||||
"License instead of this License to a given copy of the Library. To do",
|
||||
"this, you must alter all the notices that refer to this License, so",
|
||||
"that they refer to the ordinary GNU General Public License, version 2,",
|
||||
"instead of to this License. (If a newer version than version 2 of the",
|
||||
"ordinary GNU General Public License has appeared, then you can specify",
|
||||
"that version instead if you wish.) Do not make any other change in",
|
||||
"these notices.",
|
||||
"",
|
||||
" Once this change is made in a given copy, it is irreversible for",
|
||||
"that copy, so the ordinary GNU General Public License applies to all",
|
||||
"subsequent copies and derivative works made from that copy.",
|
||||
"",
|
||||
" This option is useful when you wish to copy part of the code of",
|
||||
"the Library into a program that is not a library.",
|
||||
"",
|
||||
" 4. You may copy and distribute the Library (or a portion or",
|
||||
"derivative of it, under Section 2) in object code or executable form",
|
||||
"under the terms of Sections 1 and 2 above provided that you accompany",
|
||||
"it with the complete corresponding machine-readable source code, which",
|
||||
"must be distributed under the terms of Sections 1 and 2 above on a",
|
||||
"medium customarily used for software interchange.",
|
||||
"",
|
||||
" If distribution of object code is made by offering access to copy",
|
||||
"from a designated place, then offering equivalent access to copy the",
|
||||
"source code from the same place satisfies the requirement to",
|
||||
"distribute the source code, even though third parties are not",
|
||||
"compelled to copy the source along with the object code.",
|
||||
"",
|
||||
" 5. A program that contains no derivative of any portion of the",
|
||||
"Library, but is designed to work with the Library by being compiled or",
|
||||
"linked with it, is called a \"work that uses the Library\". Such a",
|
||||
"work, in isolation, is not a derivative work of the Library, and",
|
||||
"therefore falls outside the scope of this License.",
|
||||
"",
|
||||
" However, linking a \"work that uses the Library\" with the Library",
|
||||
"creates an executable that is a derivative of the Library (because it",
|
||||
"contains portions of the Library), rather than a \"work that uses the",
|
||||
"library\". The executable is therefore covered by this License.",
|
||||
"Section 6 states terms for distribution of such executables.",
|
||||
"",
|
||||
" When a \"work that uses the Library\" uses material from a header file",
|
||||
"that is part of the Library, the object code for the work may be a",
|
||||
"derivative work of the Library even though the source code is not.",
|
||||
"Whether this is true is especially significant if the work can be",
|
||||
"linked without the Library, or if the work is itself a library. The",
|
||||
"threshold for this to be true is not precisely defined by law.",
|
||||
"",
|
||||
" If such an object file uses only numerical parameters, data",
|
||||
"structure layouts and accessors, and small macros and small inline",
|
||||
"functions (ten lines or less in length), then the use of the object",
|
||||
"file is unrestricted, regardless of whether it is legally a derivative",
|
||||
"work. (Executables containing this object code plus portions of the",
|
||||
"Library will still fall under Section 6.)",
|
||||
"",
|
||||
" Otherwise, if the work is a derivative of the Library, you may",
|
||||
"distribute the object code for the work under the terms of Section 6.",
|
||||
"Any executables containing that work also fall under Section 6,",
|
||||
"whether or not they are linked directly with the Library itself.",
|
||||
"",
|
||||
" 6. As an exception to the Sections above, you may also combine or",
|
||||
"link a \"work that uses the Library\" with the Library to produce a",
|
||||
"work containing portions of the Library, and distribute that work",
|
||||
"under terms of your choice, provided that the terms permit",
|
||||
"modification of the work for the customer's own use and reverse",
|
||||
"engineering for debugging such modifications.",
|
||||
"",
|
||||
" You must give prominent notice with each copy of the work that the",
|
||||
"Library is used in it and that the Library and its use are covered by",
|
||||
"this License. You must supply a copy of this License. If the work",
|
||||
"during execution displays copyright notices, you must include the",
|
||||
"copyright notice for the Library among them, as well as a reference",
|
||||
"directing the user to the copy of this License. Also, you must do one",
|
||||
"of these things:",
|
||||
"",
|
||||
" a) Accompany the work with the complete corresponding",
|
||||
" machine-readable source code for the Library including whatever",
|
||||
" changes were used in the work (which must be distributed under",
|
||||
" Sections 1 and 2 above); and, if the work is an executable linked",
|
||||
" with the Library, with the complete machine-readable \"work that",
|
||||
" uses the Library\", as object code and/or source code, so that the",
|
||||
" user can modify the Library and then relink to produce a modified",
|
||||
" executable containing the modified Library. (It is understood",
|
||||
" that the user who changes the contents of definitions files in the",
|
||||
" Library will not necessarily be able to recompile the application",
|
||||
" to use the modified definitions.)",
|
||||
"",
|
||||
" b) Use a suitable shared library mechanism for linking with the",
|
||||
" Library. A suitable mechanism is one that (1) uses at run time a",
|
||||
" copy of the library already present on the user's computer system,",
|
||||
" rather than copying library functions into the executable, and (2)",
|
||||
" will operate properly with a modified version of the library, if",
|
||||
" the user installs one, as long as the modified version is",
|
||||
" interface-compatible with the version that the work was made with.",
|
||||
"",
|
||||
" c) Accompany the work with a written offer, valid for at",
|
||||
" least three years, to give the same user the materials",
|
||||
" specified in Subsection 6a, above, for a charge no more",
|
||||
" than the cost of performing this distribution.",
|
||||
"",
|
||||
" d) If distribution of the work is made by offering access to copy",
|
||||
" from a designated place, offer equivalent access to copy the above",
|
||||
" specified materials from the same place.",
|
||||
"",
|
||||
" e) Verify that the user has already received a copy of these",
|
||||
" materials or that you have already sent this user a copy.",
|
||||
"",
|
||||
" For an executable, the required form of the \"work that uses the",
|
||||
"Library\" must include any data and utility programs needed for",
|
||||
"reproducing the executable from it. However, as a special exception,",
|
||||
"the materials to be distributed need not include anything that is",
|
||||
"normally distributed (in either source or binary form) with the major",
|
||||
"components (compiler, kernel, and so on) of the operating system on",
|
||||
"which the executable runs, unless that component itself accompanies",
|
||||
"the executable.",
|
||||
"",
|
||||
" It may happen that this requirement contradicts the license",
|
||||
"restrictions of other proprietary libraries that do not normally",
|
||||
"accompany the operating system. Such a contradiction means you cannot",
|
||||
"use both them and the Library together in an executable that you",
|
||||
"distribute.",
|
||||
"",
|
||||
" 7. You may place library facilities that are a work based on the",
|
||||
"Library side-by-side in a single library together with other library",
|
||||
"facilities not covered by this License, and distribute such a combined",
|
||||
"library, provided that the separate distribution of the work based on",
|
||||
"the Library and of the other library facilities is otherwise",
|
||||
"permitted, and provided that you do these two things:",
|
||||
"",
|
||||
" a) Accompany the combined library with a copy of the same work",
|
||||
" based on the Library, uncombined with any other library",
|
||||
" facilities. This must be distributed under the terms of the",
|
||||
" Sections above.",
|
||||
"",
|
||||
" b) Give prominent notice with the combined library of the fact",
|
||||
" that part of it is a work based on the Library, and explaining",
|
||||
" where to find the accompanying uncombined form of the same work.",
|
||||
"",
|
||||
" 8. You may not copy, modify, sublicense, link with, or distribute",
|
||||
"the Library except as expressly provided under this License. Any",
|
||||
"attempt otherwise to copy, modify, sublicense, link with, or",
|
||||
"distribute the Library is void, and will automatically terminate your",
|
||||
"rights under this License. However, parties who have received copies,",
|
||||
"or rights, from you under this License will not have their licenses",
|
||||
"terminated so long as such parties remain in full compliance.",
|
||||
"",
|
||||
" 9. You are not required to accept this License, since you have not",
|
||||
"signed it. However, nothing else grants you permission to modify or",
|
||||
"distribute the Library or its derivative works. These actions are",
|
||||
"prohibited by law if you do not accept this License. Therefore, by",
|
||||
"modifying or distributing the Library (or any work based on the",
|
||||
"Library), you indicate your acceptance of this License to do so, and",
|
||||
"all its terms and conditions for copying, distributing or modifying",
|
||||
"the Library or works based on it.",
|
||||
"",
|
||||
" 10. Each time you redistribute the Library (or any work based on the",
|
||||
"Library), the recipient automatically receives a license from the",
|
||||
"original licensor to copy, distribute, link with or modify the Library",
|
||||
"subject to these terms and conditions. You may not impose any further",
|
||||
"restrictions on the recipients' exercise of the rights granted herein.",
|
||||
"You are not responsible for enforcing compliance by third parties with",
|
||||
"this License.",
|
||||
"",
|
||||
" 11. If, as a consequence of a court judgment or allegation of patent",
|
||||
"infringement or for any other reason (not limited to patent issues),",
|
||||
"conditions are imposed on you (whether by court order, agreement or",
|
||||
"otherwise) that contradict the conditions of this License, they do not",
|
||||
"excuse you from the conditions of this License. If you cannot",
|
||||
"distribute so as to satisfy simultaneously your obligations under this",
|
||||
"License and any other pertinent obligations, then as a consequence you",
|
||||
"may not distribute the Library at all. For example, if a patent",
|
||||
"license would not permit royalty-free redistribution of the Library by",
|
||||
"all those who receive copies directly or indirectly through you, then",
|
||||
"the only way you could satisfy both it and this License would be to",
|
||||
"refrain entirely from distribution of the Library.",
|
||||
"",
|
||||
"If any portion of this section is held invalid or unenforceable under any",
|
||||
"particular circumstance, the balance of the section is intended to apply,",
|
||||
"and the section as a whole is intended to apply in other circumstances.",
|
||||
"",
|
||||
"It is not the purpose of this section to induce you to infringe any",
|
||||
"patents or other property right claims or to contest validity of any",
|
||||
"such claims; this section has the sole purpose of protecting the",
|
||||
"integrity of the free software distribution system which is",
|
||||
"implemented by public license practices. Many people have made",
|
||||
"generous contributions to the wide range of software distributed",
|
||||
"through that system in reliance on consistent application of that",
|
||||
"system; it is up to the author/donor to decide if he or she is willing",
|
||||
"to distribute software through any other system and a licensee cannot",
|
||||
"impose that choice.",
|
||||
"",
|
||||
"This section is intended to make thoroughly clear what is believed to",
|
||||
"be a consequence of the rest of this License.",
|
||||
"",
|
||||
" 12. If the distribution and/or use of the Library is restricted in",
|
||||
"certain countries either by patents or by copyrighted interfaces, the",
|
||||
"original copyright holder who places the Library under this License may add",
|
||||
"an explicit geographical distribution limitation excluding those countries,",
|
||||
"so that distribution is permitted only in or among countries not thus",
|
||||
"excluded. In such case, this License incorporates the limitation as if",
|
||||
"written in the body of this License.",
|
||||
"",
|
||||
" 13. The Free Software Foundation may publish revised and/or new",
|
||||
"versions of the Lesser General Public License from time to time.",
|
||||
"Such new versions will be similar in spirit to the present version,",
|
||||
"but may differ in detail to address new problems or concerns.",
|
||||
"",
|
||||
"Each version is given a distinguishing version number. If the Library",
|
||||
"specifies a version number of this License which applies to it and",
|
||||
"\"any later version\", you have the option of following the terms and",
|
||||
"conditions either of that version or of any later version published by",
|
||||
"the Free Software Foundation. If the Library does not specify a",
|
||||
"license version number, you may choose any version ever published by",
|
||||
"the Free Software Foundation.",
|
||||
"",
|
||||
" 14. If you wish to incorporate parts of the Library into other free",
|
||||
"programs whose distribution conditions are incompatible with these,",
|
||||
"write to the author to ask for permission. For software which is",
|
||||
"copyrighted by the Free Software Foundation, write to the Free",
|
||||
"Software Foundation; we sometimes make exceptions for this. Our",
|
||||
"decision will be guided by the two goals of preserving the free status",
|
||||
"of all derivatives of our free software and of promoting the sharing",
|
||||
"and reuse of software generally.",
|
||||
"",
|
||||
"\t\t\t NO WARRANTY",
|
||||
"",
|
||||
" 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO",
|
||||
"WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.",
|
||||
"EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR",
|
||||
"OTHER PARTIES PROVIDE THE LIBRARY \"AS IS\" WITHOUT WARRANTY OF ANY",
|
||||
"KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE",
|
||||
"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
|
||||
"PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE",
|
||||
"LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME",
|
||||
"THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.",
|
||||
"",
|
||||
" 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN",
|
||||
"WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY",
|
||||
"AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU",
|
||||
"FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR",
|
||||
"CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE",
|
||||
"LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING",
|
||||
"RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A",
|
||||
"FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF",
|
||||
"SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH",
|
||||
"DAMAGES.",
|
||||
"",
|
||||
"\t\t END OF TERMS AND CONDITIONS",
|
||||
"",
|
||||
" How to Apply These Terms to Your New Libraries",
|
||||
"",
|
||||
" If you develop a new library, and you want it to be of the greatest",
|
||||
"possible use to the public, we recommend making it free software that",
|
||||
"everyone can redistribute and change. You can do so by permitting",
|
||||
"redistribution under these terms (or, alternatively, under the terms of the",
|
||||
"ordinary General Public License).",
|
||||
"",
|
||||
" To apply these terms, attach the following notices to the library. It is",
|
||||
"safest to attach them to the start of each source file to most effectively",
|
||||
"convey the exclusion of warranty; and each file should have at least the",
|
||||
"\"copyright\" line and a pointer to where the full notice is found.",
|
||||
"",
|
||||
" <one line to give the library's name and a brief idea of what it does.>",
|
||||
" Copyright (C) <year> <name of author>",
|
||||
"",
|
||||
" This library is free software; you can redistribute it and/or",
|
||||
" modify it under the terms of the GNU Lesser General Public",
|
||||
" License as published by the Free Software Foundation; either",
|
||||
" version 2.1 of the License, or (at your option) any later version.",
|
||||
"",
|
||||
" This library is distributed in the hope that it will be useful,",
|
||||
" but WITHOUT ANY WARRANTY; without even the implied warranty of",
|
||||
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU",
|
||||
" Lesser General Public License for more details.",
|
||||
"",
|
||||
" You should have received a copy of the GNU Lesser General Public",
|
||||
" License along with this library; if not, write to the Free Software",
|
||||
" Foundation, Inc.,",
|
||||
"51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA",
|
||||
"",
|
||||
"Also add information on how to contact you by electronic and paper mail.",
|
||||
"",
|
||||
"You should also get your employer (if you work as a programmer) or your",
|
||||
"school, if any, to sign a \"copyright disclaimer\" for the library, if",
|
||||
"necessary. Here is a sample; alter the names:",
|
||||
"",
|
||||
" Yoyodyne, Inc., hereby disclaims all copyright interest in the",
|
||||
" library `Frob' (a library for tweaking knobs) written by James Random Hacker.",
|
||||
"",
|
||||
" <signature of Ty Coon>,",
|
||||
"1 April 1990",
|
||||
" Ty Coon, President of Vice",
|
||||
"",
|
||||
"That's all there is to it!"
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "@types/node",
|
||||
"repositoryURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"This project is licensed under the MIT license.",
|
||||
"Copyrights are respective of each contributor listed at the beginning of each definition file.",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "jsonfile",
|
||||
"repositoryURL": "https+ssh://git@github.com/jprichardson/node-jsonfile",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"(The MIT License)",
|
||||
"",
|
||||
"Copyright (c) 2012-2015, JP Richardson <jprichardson@gmail.com>",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files",
|
||||
"(the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,",
|
||||
" merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is",
|
||||
" furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE",
|
||||
"WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS",
|
||||
"OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,",
|
||||
" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "string_decoder",
|
||||
"repositoryURL": "https://github.com/rvagg/string_decoder",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"The MIT License (MIT)",
|
||||
"",
|
||||
"Node.js is licensed for use as follows:",
|
||||
"",
|
||||
"\"\"\"",
|
||||
"Copyright Node.js contributors. All rights reserved.",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||
"of this software and associated documentation files (the \"Software\"), to",
|
||||
"deal in the Software without restriction, including without limitation the",
|
||||
"rights to use, copy, modify, merge, publish, distribute, sublicense, and/or",
|
||||
"sell copies of the Software, and to permit persons to whom the Software is",
|
||||
"furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in",
|
||||
"all copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
|
||||
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
|
||||
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
|
||||
"FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS",
|
||||
"IN THE SOFTWARE.",
|
||||
"\"\"\"",
|
||||
"",
|
||||
"This license applies to parts of Node.js originating from the",
|
||||
"https://github.com/joyent/node repository:",
|
||||
"",
|
||||
"\"\"\"",
|
||||
"Copyright Joyent, Inc. and other Node contributors. All rights reserved.",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||
"of this software and associated documentation files (the \"Software\"), to",
|
||||
"deal in the Software without restriction, including without limitation the",
|
||||
"rights to use, copy, modify, merge, publish, distribute, sublicense, and/or",
|
||||
"sell copies of the Software, and to permit persons to whom the Software is",
|
||||
"furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in",
|
||||
"all copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
|
||||
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
|
||||
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING",
|
||||
"FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS",
|
||||
"IN THE SOFTWARE.",
|
||||
"\"\"\""
|
||||
],
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"name": "spdlog original",
|
||||
"version": "0.14.0",
|
||||
"repositoryURL": "https://github.com/gabime/spdlog",
|
||||
"license": "MIT",
|
||||
"isProd": true
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "spdlog",
|
||||
"version": "0.14.0",
|
||||
"repositoryURL": "https://github.com/gabime/spdlog",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"MIT License",
|
||||
"",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"",
|
||||
"Permission is hereby granted, free of charge, to any person obtaining a copy",
|
||||
"of this software and associated documentation files (the \"Software\"), to deal",
|
||||
"in the Software without restriction, including without limitation the rights",
|
||||
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell",
|
||||
"copies of the Software, and to permit persons to whom the Software is",
|
||||
"furnished to do so, subject to the following conditions:",
|
||||
"",
|
||||
"The above copyright notice and this permission notice shall be included in all",
|
||||
"copies or substantial portions of the Software.",
|
||||
"",
|
||||
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR",
|
||||
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,",
|
||||
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE",
|
||||
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER",
|
||||
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,",
|
||||
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE",
|
||||
"SOFTWARE"
|
||||
]
|
||||
}
|
||||
]
|
||||
113
README.md
113
README.md
@@ -1,21 +1,32 @@
|
||||
# SQL Operations Studio
|
||||
# Azure Data Studio
|
||||
|
||||
SQL Operations Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
|
||||
[](https://gitter.im/Microsoft/sqlopsstudio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://dev.azure.com/ms/azuredatastudio/_build/latest?definitionId=4)
|
||||
|
||||
**Download SQL Operations Studio January Public Preview**
|
||||
Azure Data Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
|
||||
|
||||
**Download the latest Azure Data Studio release**
|
||||
|
||||
Platform | Link
|
||||
-- | --
|
||||
Windows Setup Installer | https://go.microsoft.com/fwlink/?linkid=866480
|
||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=866479
|
||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=866481
|
||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=866482
|
||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=866484
|
||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=866483
|
||||
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2083322
|
||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2083323
|
||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2083324
|
||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2083325
|
||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2083424
|
||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2083326
|
||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2083327
|
||||
|
||||
Go to our [download page](https://aka.ms/sqlopsstudio) for more specific instructions.
|
||||
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
||||
|
||||
Try out the latest insiders build from `master` at https://github.com/Microsoft/sqlopsstudio/releases.
|
||||
Try out the latest insiders build from `master`:
|
||||
- [Windows User Installer - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/win32-x64-user/insider)
|
||||
- [Windows System Installer - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/win32-x64/insider)
|
||||
- [Windows ZIP - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/win32-x64-archive/insider)
|
||||
- [macOS ZIP - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/darwin/insider)
|
||||
- [Linux TAR.GZ - **Insiders build**](https://azuredatastudio-update.azurewebsites.net/latest/linux-x64/insider)
|
||||
|
||||
See the [change log](https://github.com/Microsoft/azuredatastudio/blob/master/CHANGELOG.md) for additional details of what's in this release.
|
||||
|
||||
**Feature Highlights**
|
||||
|
||||
@@ -30,25 +41,91 @@ Try out the latest insiders build from `master` at https://github.com/Microsoft/
|
||||
- Task History window to view current task execution status, completion results with error messages and task T-SQL scripting
|
||||
- Scripting support to generate CREATE, SELECT, ALTER and DROP statements for database objects
|
||||
- Workspaces with full Git integration and Find In Files support to managing T-SQL script libraries
|
||||
- Modern light-weight shell with theming, user settings, full screen support, integrated terminal and numerous other features
|
||||
- Modern light-weight shell with theming, user settings, full-screen support, integrated terminal and numerous other features
|
||||
|
||||
Here's some of these features in action.
|
||||
Here are some of these features in action.
|
||||
|
||||
<img src='https://github.com/Microsoft/sqlopsstudio/blob/master/docs/overview_screen.jpg' width='800px'>
|
||||
<img src='https://github.com/Microsoft/azuredatastudio/blob/master/docs/overview_screen.jpg' width='800px'>
|
||||
|
||||
## Contributing
|
||||
If you are interested in fixing issues and contributing directly to the code base,
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute), which covers the following:
|
||||
please see the document [How to Contribute](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute), which covers the following:
|
||||
|
||||
* [How to build and run from source](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute#Build-and-Run-From-Source)
|
||||
* [The development workflow, including debugging and running tests](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute#development-workflow)
|
||||
* [Submitting pull requests](https://github.com/Microsoft/sqlopsstudio/wiki/How-to-Contribute#pull-requests)
|
||||
* [How to build and run from source](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#Build-and-Run-From-Source)
|
||||
* [The development workflow, including debugging and running tests](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#development-workflow)
|
||||
* [Submitting pull requests](https://github.com/Microsoft/azuredatastudio/wiki/How-to-Contribute#pull-requests)
|
||||
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
||||
|
||||
## Localization
|
||||
Azure Data Studio localization is now open for community contributions. You can contribute to localization for both software and docs. https://aka.ms/SQLOpsStudioLoc
|
||||
|
||||
Localization is now opened for 10 languages: French, Italian, German, Spanish, Simplified Chinese, Traditional Chinese, Japanese, Korean, Russian, and Portuguese (Brazil). Help us make Azure Data Studio available in your language!
|
||||
|
||||
## Privacy Statement
|
||||
The [Microsoft Enterprise and Developer Privacy Statement](https://privacy.microsoft.com/en-us/privacystatement) describes the privacy statement of this software.
|
||||
|
||||
## Contributions and "Thank You"
|
||||
We would like to thank all our users who raised issues, and in particular the following users who helped contribute fixes:
|
||||
|
||||
* GeoffYoung for `Fix sqlDropColumn description #4422`
|
||||
* AlexFsmn for `Added context menu for DBs in explorer view to backup & restore db. #2277`
|
||||
* sadedil for `Missing feature request: Save as XML #3729`
|
||||
* gbritton1 for `Removed reference to object explorer #3463`
|
||||
* Tarig0 for `Add Routine_Type to CreateStoredProc fixes #3257 (#3286)`
|
||||
* oltruong for `typo fix #3025'`
|
||||
* Thomas-S-B for `Removed unnecessary IErrorDetectionStrategy #749`
|
||||
* Thomas-S-B for `Simplified code #750`
|
||||
* rdaniels6813 for `Add query plan theme support #3031`
|
||||
* Ruturaj123 for `Fixed some typos and grammatical errors #3027`
|
||||
* PromoFaux for `Use emoji shortcodes in CONTRIBUTING.md instead of <20> #3009`
|
||||
* ckaczor for `Fix: DATETIMEOFFSET data types should be ISO formatted #714`
|
||||
* hi-im-T0dd for `Fixed sync issue with my forked master so this commit is correct #2948`
|
||||
* hi-im-T0dd for `Fixed when right clicking and selecting Manage-correct name displays #2794`
|
||||
* philoushka for `center the icon #2760`
|
||||
* anthonypants for `Typo #2775`
|
||||
* kstolte for `Fix Invalid Configuration in Launch.json #2789`
|
||||
* kstolte for `Fixing a reference to SQL Ops Studio #2788`
|
||||
* AlexFsmn `Feature: Ability to add connection name #2332`
|
||||
* AlexFsmn `Disabled connection name input when connecting to a server. #2566`
|
||||
* SebastianPfliegel `Added more saveAsCsv options #2099`
|
||||
* ianychoi `Fixes a typo: Mimunum -> Minimum #1994`
|
||||
* AlexFsmn `Fixed bug where proper file extension wasn't appended to the filename. #2151`
|
||||
* AlexFsmn `Added functionality for adding any file to import wizard #2329`
|
||||
* AlexFsmn `Fixed background issue when copying a chart to clipboard #2215`
|
||||
* AlexFsmn `Fixed problem where vertical charts didn't display labels correctly. #2263`
|
||||
* AlexFsmn `Fixed Initial values for charts to match visuals #2266`
|
||||
* AlexFsmn `Renamed chart option labels #2264`
|
||||
* AlexFsmn `Added feature for the opening file after exporting to CSV/XLS/JSON & query files #2216`
|
||||
* AlexFsmm `Get Connection String should copy to clipboard #2175`
|
||||
* lanceklinger `Fix for double-clicking column handle in results table #1504`
|
||||
* westerncj for `Removed duplicate contribution from README.md (#753)`
|
||||
* ntovas for `Fix for duplicate extensions shown in "Save File" dialog. (#779)`
|
||||
* SebastianPfliegel for `Add cursor snippet (#475)`
|
||||
* mikaoelitiana for the fix: `revert README and CONTRIBUTING after last VSCode merge (#574)`
|
||||
* alextercete for `Reinstate menu item to install from VSIX (#682)`
|
||||
* alextercete for `Fix "No extension gallery service configured" error (#427)`
|
||||
* mwiedemeyer for `Fix #58: Default sort order for DB size widget (#111)`
|
||||
* AlexTroshkin for `Show disconnect in context menu only when connectionProfile connected (#150)`
|
||||
* AlexTroshkin for `Fix #138: Invalid syntax color highlighting (identity not highlighting) (#140))`
|
||||
* stebet for `Fix #153: Fixing sql snippets that failed on a DB with a case-sensitive collation. (#152)`
|
||||
* SebastianPfliegel `Remove sqlExtensionHelp (#312)`
|
||||
* olljanat for `Implemented npm version check (#314)`
|
||||
* Adam Machanic for helping with the `whoisactive` extension
|
||||
* All community localization contributors:
|
||||
* French: Adrien Clerbois, ANAS BELABBES, Antoine Griffard, Arian Papillon, Eric Macarez, Eric Van Thorre, Jérémy LANDON, Matthias GROSPERRIN, Maxime COQUEREL, Olivier Guinart, thierry DEMAN-BARCELÒ, Thomas Potier
|
||||
* Italian: Aldo Donetti, Alessandro Alpi, Andrea Dottor, Bruni Luca, Gianluca Hotz, Luca Nardi, Luigi Bruno, Marco Dal Pino, Mirco Vanini, Pasquale Ceglie, Riccardo Cappello, Sergio Govoni, Stefano Demiliani
|
||||
* German: Anna Henke-Gunvaldson, Ben Weissman, David Ullmer, J.M. ., Kai Modo, Konstantin Staschill, Kostja Klein, Lennart Trunk, Markus Ehrenmüller-Jensen, Mascha Kroenlein, Matthias Knoll, Mourad Louha, Thomas Hütter, Wolfgang Straßer
|
||||
* Spanish: Alberto Poblacion, Andy Gonzalez, Carlos Mendible, Christian Araujo, Daniel D, Eickhel Mendoza, Ernesto Cardenas, Ivan Toledo Ivanovic, Fran Diaz, JESUS GIL, Jorge Serrano Pérez, José Saturnino Pimentel Juárez, Mauricio Hidalgo, Pablo Iglesias, Rikhardo Estrada Rdez, Thierry DEMAN, YOLANDA CUESTA ALTIERI
|
||||
* Japanese: Fujio Kojima, Kazushi KAMEGAWA, Masayoshi Yamada, Masayuki Ozawa, Seiji Momoto, Takashi Kanai, Takayoshi Tanaka, Yoshihisa Ozaki, 庄垣内治
|
||||
* Chinese (simplified): DAN YE, Joel Yang, Lynne Dong, Ryan(Yu) Zhang, Sheng Jiang, Wei Zhang, Zhiliang Xu
|
||||
* Chinese (Traditional): Bruce Chen, Chiayi Yen, Kevin Yang, Winnie Lin, 保哥 Will, 謝政廷
|
||||
* Korean: Do-Kyun Kim, Evelyn Kim, Helen Jung, Hong Jmee, jeongwoo choi, Jun Hyoung Lee, Jungsun Kim정선, Justin Yoo, Kavrith mucha, Kiwoong Youm, MinGyu Ju, MVP_JUNO BEA, Sejun Kim, SOONMAN KWON, sung man ko, Yeongrak Choi, younggun kim, Youngjae Kim, 소영 이
|
||||
* Russian: Andrey Veselov, Anton Fontanov, Anton Savin, Elena Ostrovskaia, Igor Babichev, Maxim Zelensky, Rodion Fedechkin, Tasha T, Vladimir Zyryanov
|
||||
* Portuguese Brazil: Daniel de Sousa, Diogo Duarte, Douglas Correa, Douglas Eccker, José Emanuel Mendes, Marcelo Fernandes, Marcondes Alexandre, Roberto Fonseca, Rodrigo Crespi
|
||||
|
||||
And of course, we'd like to thank the authors of all upstream dependencies. Please see a full list in the [ThirdPartyNotices.txt](https://raw.githubusercontent.com/Microsoft/azuredatastudio/master/ThirdPartyNotices.txt)
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
MICROSOFT SQL OPERATIONS STUDIO
|
||||
MICROSOFT Azure Data Studio
|
||||
|
||||
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
@@ -17,10 +17,13 @@ expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
chokidar: https://github.com/paulmillr/chokidar
|
||||
comment-json: https://github.com/kaelzhang/node-comment-json
|
||||
core-js: https://github.com/zloirock/core-js
|
||||
decompress: https://github.com/kevva/decompress
|
||||
emmet: https://github.com/emmetio/emmet
|
||||
error-ex: https://github.com/Qix-/node-error-ex
|
||||
escape-string-regexp: https://github.com/sindresorhus/escape-string-regexp
|
||||
fast-plist: https://github.com/Microsoft/node-fast-plist
|
||||
figures: https://github.com/sindresorhus/figures
|
||||
find-remove: https://www.npmjs.com/package/find-remove
|
||||
fs-extra: https://github.com/jprichardson/node-fs-extra
|
||||
gc-signals: https://github.com/Microsoft/node-gc-signals
|
||||
getmac: https://github.com/bevry/getmac
|
||||
@@ -33,28 +36,35 @@ expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
jquery-ui: https://github.com/jquery/jquery-ui
|
||||
jquery.event.drag: https://github.com/devongovett/jquery.event.drag
|
||||
jschardet: https://github.com/aadsm/jschardet
|
||||
JupyterLab: https://github.com/jupyterlab/jupyterlab
|
||||
make-error: https://github.com/JsCommunity/make-error
|
||||
minimist: https://github.com/substack/minimist
|
||||
moment: https://github.com/moment/moment
|
||||
native-keymap: https://github.com/Microsoft/node-native-keymap
|
||||
native-watchdog: https://github.com/Microsoft/node-native-watchdog
|
||||
ng2-charts: https://github.com/valor-software/ng2-charts
|
||||
node-fetch: https://github.com/bitinn/node-fetch
|
||||
node-pty: https://github.com/Tyriar/node-pty
|
||||
nsfw: https://github.com/Axosoft/nsfw
|
||||
pretty-data: https://github.com/vkiryukhin/pretty-data
|
||||
primeng: https://github.com/primefaces/primeng
|
||||
process-nextick-args: https://github.com/calvinmetcalf/process-nextick-args
|
||||
pty.js: https://github.com/chjj/pty.js
|
||||
reflect-metadata: https://github.com/rbuckton/reflect-metadata
|
||||
request: https://github.com/request/request
|
||||
rxjs: https://github.com/ReactiveX/RxJS
|
||||
semver: https://github.com/npm/node-semver
|
||||
slickgrid: https://github.com/6pac/SlickGrid
|
||||
sqltoolsservice: https://github.com/Microsoft/sqltoolsservice
|
||||
svg.js: https://github.com/svgdotjs/svg.js
|
||||
systemjs: https://github.com/systemjs/systemjs
|
||||
temp-write: https://github.com/sindresorhus/temp-write
|
||||
underscore: https://github.com/jashkenas/underscore
|
||||
v8-profiler: https://github.com/node-inspector/v8-profiler
|
||||
vscode: https://github.com/microsoft/vscode
|
||||
vscode-debugprotocol: https://github.com/Microsoft/vscode-debugadapter-node
|
||||
vscode-languageclient: https://github.com/Microsoft/vscode-languageserver-node
|
||||
vscode-nls: https://github.com/Microsoft/vscode-nls
|
||||
vscode-ripgrep: https://github.com/roblourens/vscode-ripgrep
|
||||
vscode-textmate: https://github.com/Microsoft/vscode-textmate
|
||||
winreg: https://github.com/fresc81/node-winreg
|
||||
@@ -62,10 +72,9 @@ expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
yauzl: https://github.com/thejoshwolfe/yauzl
|
||||
zone.js: https://www.npmjs.com/package/zone
|
||||
|
||||
Microsoft PROSE SDK: https://microsoft.github.io/prose
|
||||
|
||||
%% angular NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2014-2017 Google, Inc. http://angular.io
|
||||
|
||||
@@ -291,6 +300,20 @@ THE SOFTWARE.
|
||||
=========================================
|
||||
END OF core-js NOTICES AND INFORMATION
|
||||
|
||||
%% decompress NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
MIT License
|
||||
|
||||
Copyright (c) Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevva)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF decompress NOTICES AND INFORMATION
|
||||
|
||||
%% emmet NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
@@ -320,32 +343,6 @@ END OF emmet NOTICES AND INFORMATION
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 JD Ballard
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
=========================================
|
||||
END OF error-ex NOTICES AND INFORMATION
|
||||
|
||||
%% escape-string-regexp NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -392,6 +389,20 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
|
||||
=========================================
|
||||
END OF fast-plist NOTICES AND INFORMATION
|
||||
|
||||
%% figures NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF figures NOTICES AND INFORMATION
|
||||
|
||||
%% fs-extra NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
(The MIT License)
|
||||
@@ -1165,6 +1176,43 @@ That's all there is to it!
|
||||
=========================================
|
||||
END OF jschardet NOTICES AND INFORMATION
|
||||
|
||||
%% JupyterLab NOTICES AND INFORMATION BEGIN HERE
|
||||
Copyright (c) 2015 Project Jupyter Contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Semver File License
|
||||
===================
|
||||
|
||||
The semver.py file is from https://github.com/podhmo/python-semver
|
||||
which is licensed under the "MIT" license. See the semver.py file for details.
|
||||
|
||||
END OF JupyterLab NOTICES AND INFORMATION
|
||||
|
||||
%% make-error NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
ISC © Julien Fontanet
|
||||
@@ -1296,6 +1344,32 @@ SOFTWARE.
|
||||
=========================================
|
||||
END OF ng2-charts NOTICES AND INFORMATION
|
||||
|
||||
%% node-fetch NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 David Frank
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
=========================================
|
||||
END OF node-fetch NOTICES AND INFORMATION
|
||||
|
||||
%% node-pty NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright (c) 2012-2015, Christopher Jeffrey (https://github.com/chjj/)
|
||||
@@ -1370,6 +1444,30 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
=========================================
|
||||
END OF primeng NOTICES AND INFORMATION
|
||||
|
||||
%% process-nextick-args NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
# Copyright (c) 2015 Calvin Metcalf
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.**
|
||||
=========================================
|
||||
END OF process-nextick-args NOTICES AND INFORMATION
|
||||
|
||||
%% pty.js NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright (c) 2012-2015, Christopher Jeffrey (https://github.com/chjj/)
|
||||
@@ -1454,6 +1552,66 @@ END OF TERMS AND CONDITIONS
|
||||
=========================================
|
||||
END OF reflect-metadata NOTICES AND INFORMATION
|
||||
|
||||
%% request NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Apache License
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
=========================================
|
||||
END OF request NOTICES AND INFORMATION
|
||||
|
||||
%% rxjs NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Apache License
|
||||
@@ -1779,6 +1937,20 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
|
||||
=========================================
|
||||
END OF systemjs NOTICES AND INFORMATION
|
||||
|
||||
%% temp-write NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF temp-write NOTICES AND INFORMATION
|
||||
|
||||
%% underscore NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright (c) 2009-2017 Jeremy Ashkenas, DocumentCloud and Investigative
|
||||
@@ -1881,6 +2053,50 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
|
||||
=========================================
|
||||
END OF vscode-debugprotocol NOTICES AND INFORMATION
|
||||
|
||||
%% vscode-languageclient NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
||||
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF vscode-languageclient NOTICES AND INFORMATION
|
||||
|
||||
%% vscode-nls NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
|
||||
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF vscode-nls NOTICES AND INFORMATION
|
||||
|
||||
%% vscode-ripgrep NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
vscode-ripgrep
|
||||
@@ -2039,4 +2255,188 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
=========================================
|
||||
END OF zone.js NOTICES AND INFORMATION
|
||||
END OF zone.js NOTICES AND INFORMATION
|
||||
|
||||
%% Microsoft.ProgramSynthesis.Common NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
|
||||
This software incorporates material from third parties. Microsoft makes certain
|
||||
open source code available at http://3rdpartysource.microsoft.com, or you may
|
||||
send a check or money order for US $5.00, including the product name, the open
|
||||
source component name, and version number, to:
|
||||
|
||||
Source Code Compliance Team
|
||||
Microsoft Corporation
|
||||
One Microsoft Way
|
||||
Redmond, WA 98052
|
||||
USA
|
||||
|
||||
Notwithstanding any other terms, you may reverse engineer this software to the
|
||||
extent required to debug changes to any libraries licensed under the GNU Lesser
|
||||
General Public License.
|
||||
|
||||
-------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
|
||||
|
||||
===================================CoreFx (BEGIN)
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) .NET Foundation and Contributors
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
===================================CoreFx (END)
|
||||
|
||||
===================================CoreFxLab (BEGIN)
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
===================================CoreFxLab (END)
|
||||
|
||||
===================================Reactive Extensions (BEGIN)
|
||||
Copyright (c) .NET Foundation and Contributors
|
||||
All Rights Reserved
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you
|
||||
may not use this file except in compliance with the License. You may
|
||||
obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions
|
||||
and limitations under the License.
|
||||
|
||||
List of contributors to the Rx libraries
|
||||
|
||||
Rx and Ix.NET:
|
||||
Wes Dyer
|
||||
Jeffrey van Gogh
|
||||
Matthew Podwysocki
|
||||
Bart De Smet
|
||||
Danny van Velzen
|
||||
Erik Meijer
|
||||
Brian Beckman
|
||||
Aaron Lahman
|
||||
Georgi Chkodrov
|
||||
Arthur Watson
|
||||
Gert Drapers
|
||||
Mark Shields
|
||||
Eric Rozell
|
||||
|
||||
Rx.js and Ix.js:
|
||||
Matthew Podwysocki
|
||||
Jeffrey van Gogh
|
||||
Bart De Smet
|
||||
Brian Beckman
|
||||
Wes Dyer
|
||||
Erik Meijer
|
||||
|
||||
Tx:
|
||||
Georgi Chkodrov
|
||||
Bart De Smet
|
||||
Aaron Lahman
|
||||
Erik Meijer
|
||||
Brian Grunkemeyer
|
||||
Beysim Sezgin
|
||||
Tiho Tarnavski
|
||||
Collin Meek
|
||||
Sajay Anthony
|
||||
Karen Albrecht
|
||||
John Allen
|
||||
Zach Kramer
|
||||
|
||||
Rx++ and Ix++:
|
||||
Aaron Lahman
|
||||
===================================Reactive Extensions (END)
|
||||
|
||||
-------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
|
||||
=========================================
|
||||
END OF Microsoft.ProgramSynthesis.Common NOTICES AND INFORMATION
|
||||
|
||||
%% Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
NOTICES AND INFORMATION
|
||||
Do Not Translate or Localize
|
||||
|
||||
This software incorporates material from third parties. Microsoft makes certain
|
||||
open source code available at http://3rdpartysource.microsoft.com, or you may
|
||||
send a check or money order for US $5.00, including the product name, the open
|
||||
source component name, and version number, to:
|
||||
|
||||
Source Code Compliance Team
|
||||
Microsoft Corporation
|
||||
One Microsoft Way
|
||||
Redmond, WA 98052
|
||||
USA
|
||||
|
||||
Notwithstanding any other terms, you may reverse engineer this software to the
|
||||
extent required to debug changes to any libraries licensed under the GNU Lesser
|
||||
General Public License.
|
||||
|
||||
-------------------------------START OF THIRD-PARTY NOTICES-------------------------------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 ExcelDataReader
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
===================================ExcelDataReader (END)
|
||||
|
||||
-------------------------------END OF THIRD-PARTY NOTICES-------------------------------------------
|
||||
=========================================
|
||||
END OF Microsoft.ProgramSynthesis.Detection NOTICES AND INFORMATION
|
||||
|
||||
19
appveyor.yml
19
appveyor.yml
@@ -1,19 +0,0 @@
|
||||
environment:
|
||||
ELECTRON_RUN_AS_NODE: 1
|
||||
VSCODE_BUILD_VERBOSE: true
|
||||
|
||||
cache:
|
||||
- '%LOCALAPPDATA%\Yarn\cache'
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 8.9.1 x64
|
||||
|
||||
build_script:
|
||||
- yarn
|
||||
- .\node_modules\.bin\gulp electron
|
||||
- npm run compile
|
||||
|
||||
test_script:
|
||||
- node --version
|
||||
- .\scripts\test.bat
|
||||
- .\scripts\test-integration.bat
|
||||
49
azure-pipelines-linux-mac.yml
Normal file
49
azure-pipelines-linux-mac.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '8.x'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: |
|
||||
git submodule update --init --recursive
|
||||
nvm install 10.15.1
|
||||
nvm use 10.15.1
|
||||
npm i -g yarn
|
||||
displayName: 'preinstall'
|
||||
|
||||
- script: |
|
||||
export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:10
|
||||
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
||||
sudo chmod +x /etc/init.d/xvfb
|
||||
sudo update-rc.d xvfb defaults
|
||||
sudo service xvfb start
|
||||
# sh -e /etc/init.d/xvfb start
|
||||
# sleep 3
|
||||
displayName: 'Linux preinstall'
|
||||
condition: eq(variables['Agent.OS'], 'Linux')
|
||||
|
||||
- script: |
|
||||
yarn
|
||||
displayName: 'Install'
|
||||
|
||||
- script: |
|
||||
node_modules/.bin/gulp electron
|
||||
node_modules/.bin/gulp compile --max_old_space_size=4096
|
||||
displayName: 'Scripts'
|
||||
|
||||
- script: |
|
||||
DISPLAY=:10 ./scripts/test.sh --reporter mocha-junit-reporter
|
||||
displayName: 'Tests'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: '**/test-results.xml'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- script: |
|
||||
yarn tslint
|
||||
displayName: 'Run TSLint'
|
||||
|
||||
- script: |
|
||||
yarn strict-null-check
|
||||
displayName: 'Run Strict Null Check'
|
||||
34
azure-pipelines-windows.yml
Normal file
34
azure-pipelines-windows.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '10.15.1'
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: |
|
||||
yarn
|
||||
displayName: 'Yarn Install'
|
||||
|
||||
- script: |
|
||||
.\node_modules\.bin\gulp electron
|
||||
displayName: 'Electron'
|
||||
|
||||
- script: |
|
||||
npm run compile
|
||||
displayName: 'Compile'
|
||||
|
||||
- script: |
|
||||
.\scripts\test.bat --reporter mocha-junit-reporter
|
||||
displayName: 'Test'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: 'test-results.xml'
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- script: |
|
||||
yarn tslint
|
||||
displayName: 'Run TSLint'
|
||||
|
||||
- script: |
|
||||
yarn strict-null-check
|
||||
displayName: 'Run Strict Null Check'
|
||||
29
azure-pipelines.yml
Normal file
29
azure-pipelines.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
trigger:
|
||||
- master
|
||||
- releases/*
|
||||
|
||||
jobs:
|
||||
|
||||
# All tasks on Windows
|
||||
- job: build_all_windows
|
||||
displayName: Build all tasks (Windows)
|
||||
pool:
|
||||
vmImage: vs2017-win2016
|
||||
steps:
|
||||
- template: azure-pipelines-windows.yml
|
||||
|
||||
# All tasks on Linux
|
||||
- job: build_all_linux
|
||||
displayName: Build all tasks (Linux)
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
steps:
|
||||
- template: azure-pipelines-linux-mac.yml
|
||||
|
||||
# All tasks on macOS
|
||||
- job: build_all_darwin
|
||||
displayName: Build all tasks (macOS)
|
||||
pool:
|
||||
vmImage: macos-10.13
|
||||
steps:
|
||||
- template: azure-pipelines-linux-mac.yml
|
||||
@@ -3,10 +3,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const cp = require('child_process');
|
||||
import * as cp from 'child_process';
|
||||
|
||||
function yarnInstall(package: string): void {
|
||||
cp.execSync(`yarn add --no-lockfile ${package}`);
|
||||
function yarnInstall(packageName: string): void {
|
||||
cp.execSync(`yarn add --no-lockfile ${packageName}`);
|
||||
}
|
||||
|
||||
const product = require('../../../product.json');
|
||||
@@ -6,7 +6,6 @@
|
||||
'use strict';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { execSync } from 'child_process';
|
||||
import { Readable } from 'stream';
|
||||
import * as crypto from 'crypto';
|
||||
import * as azure from 'azure-storage';
|
||||
@@ -44,7 +43,7 @@ function createDefaultConfig(quality: string): Config {
|
||||
}
|
||||
|
||||
function getConfig(quality: string): Promise<Config> {
|
||||
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const collection = 'dbs/builds/colls/config';
|
||||
const query = {
|
||||
query: `SELECT TOP 1 * FROM c WHERE c.id = @quality`,
|
||||
@@ -66,14 +65,16 @@ interface Asset {
|
||||
platform: string;
|
||||
type: string;
|
||||
url: string;
|
||||
mooncakeUrl: string;
|
||||
// {{SQL CARBON EDIT}}
|
||||
mooncakeUrl: string | undefined;
|
||||
hash: string;
|
||||
sha256hash: string;
|
||||
size: number;
|
||||
supportsFastUpdate?: boolean;
|
||||
}
|
||||
|
||||
function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise<void> {
|
||||
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const client = new DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT']!, { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const collection = 'dbs/builds/colls/' + quality;
|
||||
const updateQuery = {
|
||||
query: 'SELECT TOP 1 * FROM c WHERE c.id = @id',
|
||||
@@ -127,7 +128,7 @@ async function assertContainer(blobService: azure.BlobService, quality: string):
|
||||
await new Promise((c, e) => blobService.createContainerIfNotExists(quality, { publicAccessLevel: 'blob' }, err => err ? e(err) : c()));
|
||||
}
|
||||
|
||||
async function doesAssetExist(blobService: azure.BlobService, quality: string, blobName: string): Promise<boolean> {
|
||||
async function doesAssetExist(blobService: azure.BlobService, quality: string, blobName: string): Promise<boolean | undefined> {
|
||||
const existsResult = await new Promise<azure.BlobService.BlobResult>((c, e) => blobService.doesBlobExist(quality, blobName, (err, r) => err ? e(err) : c(r)));
|
||||
return existsResult.exists;
|
||||
}
|
||||
@@ -150,11 +151,15 @@ interface PublishOptions {
|
||||
async function publish(commit: string, quality: string, platform: string, type: string, name: string, version: string, _isUpdate: string, file: string, opts: PublishOptions): Promise<void> {
|
||||
const isUpdate = _isUpdate === 'true';
|
||||
|
||||
const queuedBy = process.env['BUILD_QUEUEDBY'];
|
||||
const sourceBranch = process.env['BUILD_SOURCEBRANCH'];
|
||||
const isReleased = quality === 'insider'
|
||||
&& /^master$|^refs\/heads\/master$/.test(sourceBranch)
|
||||
&& /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy);
|
||||
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
||||
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
||||
const isReleased = (
|
||||
// Insiders: nightly build from master
|
||||
(quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)) ||
|
||||
|
||||
// Exploration: any build from electron-4.0.x branch
|
||||
(quality === 'exploration' && /^electron-4.0.x$|^refs\/heads\/electron-4.0.x$/.test(sourceBranch))
|
||||
);
|
||||
|
||||
console.log('Publishing...');
|
||||
console.log('Quality:', quality);
|
||||
@@ -179,9 +184,9 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
console.log('SHA256:', sha256hash);
|
||||
|
||||
const blobName = commit + '/' + name;
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2'];
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
|
||||
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2'])
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
@@ -197,17 +202,29 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
if (process.env['MOONCAKE_STORAGE_ACCESS_KEY']) {
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
|
||||
await assertContainer(mooncakeBlobService, quality);
|
||||
await Promise.all([
|
||||
assertContainer(blobService, quality),
|
||||
assertContainer(mooncakeBlobService, quality)
|
||||
]);
|
||||
|
||||
const mooncakeBlobExists = await doesAssetExist(mooncakeBlobService, quality, blobName);
|
||||
const [blobExists, moooncakeBlobExists] = await Promise.all([
|
||||
doesAssetExist(blobService, quality, blobName),
|
||||
doesAssetExist(mooncakeBlobService, quality, blobName)
|
||||
]);
|
||||
|
||||
if (!mooncakeBlobExists) {
|
||||
const promises: Array<Promise<void>> = [];
|
||||
|
||||
if (!blobExists) {
|
||||
promises.push(uploadBlob(blobService, quality, blobName, file));
|
||||
}
|
||||
|
||||
if (!moooncakeBlobExists) {
|
||||
promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file));
|
||||
}
|
||||
} else {
|
||||
@@ -240,6 +257,13 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
size
|
||||
};
|
||||
|
||||
// Remove this if we ever need to rollback fast updates for windows
|
||||
if (/win32/.test(platform)) {
|
||||
asset.supportsFastUpdate = true;
|
||||
}
|
||||
|
||||
console.log('Asset:', JSON.stringify(asset, null, ' '));
|
||||
|
||||
const release = {
|
||||
id: commit,
|
||||
timestamp: (new Date()).getTime(),
|
||||
@@ -247,7 +271,7 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
isReleased: config.frozen ? false : isReleased,
|
||||
sourceBranch,
|
||||
queuedBy,
|
||||
assets: [],
|
||||
assets: [] as Array<Asset>,
|
||||
updates: {} as any
|
||||
};
|
||||
|
||||
@@ -263,15 +287,23 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
}
|
||||
|
||||
function main(): void {
|
||||
if (process.env['VSCODE_BUILD_SKIP_PUBLISH']) {
|
||||
console.warn('Skipping publish due to VSCODE_BUILD_SKIP_PUBLISH');
|
||||
return;
|
||||
}
|
||||
|
||||
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||
|
||||
if (!commit) {
|
||||
console.warn('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||
return;
|
||||
}
|
||||
|
||||
const opts = minimist<PublishOptions>(process.argv.slice(2), {
|
||||
boolean: ['upload-only']
|
||||
});
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
let [quality, platform, type, name, version, _isUpdate, file, commit] = opts._;
|
||||
if (!commit) {
|
||||
commit = execSync('git rev-parse HEAD', { encoding: 'utf8' }).trim();
|
||||
}
|
||||
const [quality, platform, type, name, version, _isUpdate, file] = opts._;
|
||||
|
||||
publish(commit, quality, platform, type, name, version, _isUpdate, file, opts).catch(err => {
|
||||
console.error(err);
|
||||
219
build/azure-pipelines/common/symbols.ts
Normal file
219
build/azure-pipelines/common/symbols.ts
Normal file
@@ -0,0 +1,219 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as request from 'request';
|
||||
import { createReadStream, createWriteStream, unlink, mkdir } from 'fs';
|
||||
import * as github from 'github-releases';
|
||||
import { join } from 'path';
|
||||
import { tmpdir } from 'os';
|
||||
import { promisify } from 'util';
|
||||
|
||||
const BASE_URL = 'https://rink.hockeyapp.net/api/2/';
|
||||
const HOCKEY_APP_TOKEN_HEADER = 'X-HockeyAppToken';
|
||||
|
||||
export interface IVersions {
|
||||
app_versions: IVersion[];
|
||||
}
|
||||
|
||||
export interface IVersion {
|
||||
id: number;
|
||||
version: string;
|
||||
}
|
||||
|
||||
export interface IApplicationAccessor {
|
||||
accessToken: string;
|
||||
appId: string;
|
||||
}
|
||||
|
||||
export interface IVersionAccessor extends IApplicationAccessor {
|
||||
id: string;
|
||||
}
|
||||
|
||||
enum Platform {
|
||||
WIN_32 = 'win32-ia32',
|
||||
WIN_64 = 'win32-x64',
|
||||
LINUX_32 = 'linux-ia32',
|
||||
LINUX_64 = 'linux-x64',
|
||||
MAC_OS = 'darwin-x64'
|
||||
}
|
||||
|
||||
function symbolsZipName(platform: Platform, electronVersion: string, insiders: boolean): string {
|
||||
return `${insiders ? 'insiders' : 'stable'}-symbols-v${electronVersion}-${platform}.zip`;
|
||||
}
|
||||
|
||||
const SEED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
async function tmpFile(name: string): Promise<string> {
|
||||
let res = '';
|
||||
for (let i = 0; i < 8; i++) {
|
||||
res += SEED.charAt(Math.floor(Math.random() * SEED.length));
|
||||
}
|
||||
|
||||
const tmpParent = join(tmpdir(), res);
|
||||
|
||||
await promisify(mkdir)(tmpParent);
|
||||
|
||||
return join(tmpParent, name);
|
||||
}
|
||||
|
||||
function getVersions(accessor: IApplicationAccessor): Promise<IVersions> {
|
||||
return asyncRequest<IVersions>({
|
||||
url: `${BASE_URL}/apps/${accessor.appId}/app_versions`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
[HOCKEY_APP_TOKEN_HEADER]: accessor.accessToken
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createVersion(accessor: IApplicationAccessor, version: string): Promise<IVersion> {
|
||||
return asyncRequest<IVersion>({
|
||||
url: `${BASE_URL}/apps/${accessor.appId}/app_versions/new`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
[HOCKEY_APP_TOKEN_HEADER]: accessor.accessToken
|
||||
},
|
||||
formData: {
|
||||
bundle_version: version
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateVersion(accessor: IVersionAccessor, symbolsPath: string) {
|
||||
return asyncRequest<IVersions>({
|
||||
url: `${BASE_URL}/apps/${accessor.appId}/app_versions/${accessor.id}`,
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
[HOCKEY_APP_TOKEN_HEADER]: accessor.accessToken
|
||||
},
|
||||
formData: {
|
||||
dsym: createReadStream(symbolsPath)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function asyncRequest<T>(options: request.UrlOptions & request.CoreOptions): Promise<T> {
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
request(options, (error, _response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(JSON.parse(body));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function downloadAsset(repository: any, assetName: string, targetPath: string, electronVersion: string) {
|
||||
return new Promise((resolve, reject) => {
|
||||
repository.getReleases({ tag_name: `v${electronVersion}` }, (err: any, releases: any) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
const asset = releases[0].assets.filter((asset: any) => asset.name === assetName)[0];
|
||||
if (!asset) {
|
||||
reject(new Error(`Asset with name ${assetName} not found`));
|
||||
} else {
|
||||
repository.downloadAsset(asset, (err: any, reader: any) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
const writer = createWriteStream(targetPath);
|
||||
writer.on('error', reject);
|
||||
writer.on('close', resolve);
|
||||
reader.on('error', reject);
|
||||
|
||||
reader.pipe(writer);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
interface IOptions {
|
||||
repository: string;
|
||||
platform: Platform;
|
||||
versions: { code: string; insiders: boolean; electron: string; };
|
||||
access: { hockeyAppToken: string; hockeyAppId: string; githubToken: string };
|
||||
}
|
||||
|
||||
async function ensureVersionAndSymbols(options: IOptions) {
|
||||
|
||||
// Check version does not exist
|
||||
console.log(`HockeyApp: checking for existing version ${options.versions.code} (${options.platform})`);
|
||||
const versions = await getVersions({ accessToken: options.access.hockeyAppToken, appId: options.access.hockeyAppId });
|
||||
if (versions.app_versions.some(v => v.version === options.versions.code)) {
|
||||
console.log(`HockeyApp: Returning without uploading symbols because version ${options.versions.code} (${options.platform}) was already found`);
|
||||
return;
|
||||
}
|
||||
|
||||
// Download symbols for platform and electron version
|
||||
const symbolsName = symbolsZipName(options.platform, options.versions.electron, options.versions.insiders);
|
||||
const symbolsPath = await tmpFile('symbols.zip');
|
||||
console.log(`HockeyApp: downloading symbols ${symbolsName} for electron ${options.versions.electron} (${options.platform}) into ${symbolsPath}`);
|
||||
await downloadAsset(new (github as any)({ repo: options.repository, token: options.access.githubToken }), symbolsName, symbolsPath, options.versions.electron);
|
||||
|
||||
// Create version
|
||||
console.log(`HockeyApp: creating new version ${options.versions.code} (${options.platform})`);
|
||||
const version = await createVersion({ accessToken: options.access.hockeyAppToken, appId: options.access.hockeyAppId }, options.versions.code);
|
||||
|
||||
// Upload symbols
|
||||
console.log(`HockeyApp: uploading symbols for version ${options.versions.code} (${options.platform})`);
|
||||
await updateVersion({ id: String(version.id), accessToken: options.access.hockeyAppToken, appId: options.access.hockeyAppId }, symbolsPath);
|
||||
|
||||
// Cleanup
|
||||
await promisify(unlink)(symbolsPath);
|
||||
}
|
||||
|
||||
// Environment
|
||||
const pakage = require('../../../package.json');
|
||||
const product = require('../../../product.json');
|
||||
const repository = product.electronRepository;
|
||||
const electronVersion = require('../../lib/electron').getElectronVersion();
|
||||
const insiders = product.quality !== 'stable';
|
||||
let codeVersion = pakage.version;
|
||||
if (insiders) {
|
||||
codeVersion = `${codeVersion}-insider`;
|
||||
}
|
||||
const githubToken = process.argv[2];
|
||||
const hockeyAppToken = process.argv[3];
|
||||
const is64 = process.argv[4] === 'x64';
|
||||
const hockeyAppId = process.argv[5];
|
||||
|
||||
let platform: Platform;
|
||||
if (process.platform === 'darwin') {
|
||||
platform = Platform.MAC_OS;
|
||||
} else if (process.platform === 'win32') {
|
||||
platform = is64 ? Platform.WIN_64 : Platform.WIN_32;
|
||||
} else {
|
||||
platform = is64 ? Platform.LINUX_64 : Platform.LINUX_32;
|
||||
}
|
||||
|
||||
// Create version and upload symbols in HockeyApp
|
||||
if (repository && codeVersion && electronVersion && (product.quality === 'stable' || product.quality === 'insider')) {
|
||||
ensureVersionAndSymbols({
|
||||
repository,
|
||||
platform,
|
||||
versions: {
|
||||
code: codeVersion,
|
||||
insiders,
|
||||
electron: electronVersion
|
||||
},
|
||||
access: {
|
||||
githubToken,
|
||||
hockeyAppToken,
|
||||
hockeyAppId
|
||||
}
|
||||
}).then(() => {
|
||||
console.log('HockeyApp: done');
|
||||
}).catch(error => {
|
||||
console.error(`HockeyApp: error (${error})`);
|
||||
});
|
||||
} else {
|
||||
console.log(`HockeyApp: skipping due to unexpected context (repository: ${repository}, codeVersion: ${codeVersion}, electronVersion: ${electronVersion}, quality: ${product.quality})`);
|
||||
}
|
||||
50
build/azure-pipelines/darwin/continuous-build-darwin.yml
Normal file
50
build/azure-pipelines/darwin/continuous-build-darwin.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||
# inputs:
|
||||
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
# vstsFeed: '$(ArtifactFeed)'
|
||||
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||
- script: |
|
||||
yarn
|
||||
displayName: Install Dependencies
|
||||
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
# inputs:
|
||||
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
# vstsFeed: '$(ArtifactFeed)'
|
||||
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||
- script: |
|
||||
yarn gulp electron-x64
|
||||
displayName: Download Electron
|
||||
- script: |
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
- script: |
|
||||
yarn monaco-compile-check
|
||||
displayName: Run Monaco Editor Checks
|
||||
- script: |
|
||||
yarn compile
|
||||
displayName: Compile Sources
|
||||
- script: |
|
||||
yarn download-builtin-extensions
|
||||
displayName: Download Built-in Extensions
|
||||
- script: |
|
||||
./scripts/test.sh --tfs "Unit Tests"
|
||||
displayName: Run Unit Tests
|
||||
- script: |
|
||||
./scripts/test-integration.sh --tfs "Integration Tests"
|
||||
displayName: Run Integration Tests
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Tests Results
|
||||
inputs:
|
||||
testResultsFiles: '*-results.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||
condition: succeededOrFailed()
|
||||
101
build/azure-pipelines/darwin/product-build-darwin.yml
Normal file
101
build/azure-pipelines/darwin/product-build-darwin.yml
Normal file
@@ -0,0 +1,101 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine monacotools.visualstudio.com
|
||||
password $(VSO_PAT)
|
||||
machine github.com
|
||||
login vscode
|
||||
password $(VSCODE_MIXIN_PASSWORD)
|
||||
EOF
|
||||
|
||||
yarn
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" yarn gulp -- mixin
|
||||
yarn gulp -- hygiene
|
||||
yarn monaco-compile-check
|
||||
node build/azure-pipelines/common/installDistro.js
|
||||
node build/lib/builtInExtensions.js
|
||||
displayName: Prepare build
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
yarn gulp -- vscode-darwin-min
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
yarn gulp -- upload-vscode-sourcemaps
|
||||
displayName: Build
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
./scripts/test.sh --build --tfs "Unit Tests"
|
||||
# APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
|
||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
||||
displayName: Run unit tests
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
|
||||
displayName: Archive build
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
inputs:
|
||||
ConnectedServiceName: 'ESRP CodeSign'
|
||||
FolderPath: '$(agent.builddirectory)'
|
||||
Pattern: 'VSCode-darwin.zip'
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"keyCode": "CP-401337-Apple",
|
||||
"operationSetCode": "MacAppDeveloperSign",
|
||||
"parameters": [ ],
|
||||
"toolName": "sign",
|
||||
"toolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: 120
|
||||
displayName: Codesign
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
# remove pkg from archive
|
||||
zip -d ../VSCode-darwin.zip "*.pkg"
|
||||
|
||||
# publish the build
|
||||
PACKAGEJSON=`ls ../VSCode-darwin/*.app/Contents/Resources/app/package.json`
|
||||
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||
node build/azure-pipelines/common/publish.js \
|
||||
"$(VSCODE_QUALITY)" \
|
||||
darwin \
|
||||
archive \
|
||||
"VSCode-darwin-$(VSCODE_QUALITY).zip" \
|
||||
$VERSION \
|
||||
true \
|
||||
../VSCode-darwin.zip
|
||||
|
||||
# publish hockeyapp symbols
|
||||
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_MACOS)"
|
||||
|
||||
# upload configuration
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
yarn gulp -- upload-vscode-configuration
|
||||
displayName: Publish
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
continueOnError: true
|
||||
1
build/azure-pipelines/linux/.gitignore
vendored
Normal file
1
build/azure-pipelines/linux/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
pat
|
||||
55
build/azure-pipelines/linux/continuous-build-linux.yml
Normal file
55
build/azure-pipelines/linux/continuous-build-linux.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
steps:
|
||||
- script: |
|
||||
set -e
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0
|
||||
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
||||
sudo chmod +x /etc/init.d/xvfb
|
||||
sudo update-rc.d xvfb defaults
|
||||
sudo service xvfb start
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||
# inputs:
|
||||
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
# vstsFeed: '$(ArtifactFeed)'
|
||||
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||
- script: |
|
||||
yarn
|
||||
displayName: Install Dependencies
|
||||
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
# inputs:
|
||||
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
# vstsFeed: '$(ArtifactFeed)'
|
||||
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||
- script: |
|
||||
yarn gulp electron-x64
|
||||
displayName: Download Electron
|
||||
- script: |
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
- script: |
|
||||
yarn monaco-compile-check
|
||||
displayName: Run Monaco Editor Checks
|
||||
- script: |
|
||||
yarn compile
|
||||
displayName: Compile Sources
|
||||
- script: |
|
||||
yarn download-builtin-extensions
|
||||
displayName: Download Built-in Extensions
|
||||
- script: |
|
||||
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
|
||||
displayName: Run Unit Tests
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Tests Results
|
||||
inputs:
|
||||
testResultsFiles: '*-results.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||
condition: succeededOrFailed()
|
||||
40
build/azure-pipelines/linux/frozen-check.js
Normal file
40
build/azure-pipelines/linux/frozen-check.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const documentdb_1 = require("documentdb");
|
||||
function createDefaultConfig(quality) {
|
||||
return {
|
||||
id: quality,
|
||||
frozen: false
|
||||
};
|
||||
}
|
||||
function getConfig(quality) {
|
||||
const client = new documentdb_1.DocumentClient(process.env['AZURE_DOCUMENTDB_ENDPOINT'], { masterKey: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const collection = 'dbs/builds/colls/config';
|
||||
const query = {
|
||||
query: `SELECT TOP 1 * FROM c WHERE c.id = @quality`,
|
||||
parameters: [
|
||||
{ name: '@quality', value: quality }
|
||||
]
|
||||
};
|
||||
return new Promise((c, e) => {
|
||||
client.queryDocuments(collection, query).toArray((err, results) => {
|
||||
if (err && err.code !== 409) {
|
||||
return e(err);
|
||||
}
|
||||
c(!results || results.length === 0 ? createDefaultConfig(quality) : results[0]);
|
||||
});
|
||||
});
|
||||
}
|
||||
getConfig(process.argv[2])
|
||||
.then(config => {
|
||||
console.log(config.frozen);
|
||||
process.exit(0);
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
118
build/azure-pipelines/linux/product-build-linux.yml
Normal file
118
build/azure-pipelines/linux/product-build-linux.yml
Normal file
@@ -0,0 +1,118 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
export npm_config_arch="$(VSCODE_ARCH)"
|
||||
if [[ "$(VSCODE_ARCH)" == "ia32" ]]; then
|
||||
export PKG_CONFIG_PATH="/usr/lib/i386-linux-gnu/pkgconfig"
|
||||
fi
|
||||
|
||||
cat << EOF > ~/.netrc
|
||||
machine monacotools.visualstudio.com
|
||||
password $(VSO_PAT)
|
||||
machine github.com
|
||||
login vscode
|
||||
password $(VSCODE_MIXIN_PASSWORD)
|
||||
EOF
|
||||
|
||||
CHILD_CONCURRENCY=1 yarn
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- mixin
|
||||
npm run gulp -- hygiene
|
||||
npm run monaco-compile-check
|
||||
node build/azure-pipelines/common/installDistro.js
|
||||
node build/lib/builtInExtensions.js
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" npm run gulp -- vscode-linux-$(VSCODE_ARCH)-min
|
||||
name: build
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
npm run gulp -- "electron-$(VSCODE_ARCH)"
|
||||
|
||||
# xvfb seems to be crashing often, let's make sure it's always up
|
||||
service xvfb start
|
||||
|
||||
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
|
||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
|
||||
name: test
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
ARCH="$(VSCODE_ARCH)"
|
||||
|
||||
# Publish tarball
|
||||
PLATFORM_LINUX="linux-$(VSCODE_ARCH)"
|
||||
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||
BUILDNAME="VSCode-$PLATFORM_LINUX"
|
||||
BUILD="$ROOT/$BUILDNAME"
|
||||
BUILD_VERSION="$(date +%s)"
|
||||
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
|
||||
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
||||
PACKAGEJSON="$BUILD/resources/app/package.json"
|
||||
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||
|
||||
rm -rf $ROOT/code-*.tar.*
|
||||
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
||||
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$VERSION" true "$TARBALL_PATH"
|
||||
|
||||
# Publish hockeyapp symbols
|
||||
node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" "$(VSCODE_HOCKEYAPP_ID_LINUX64)"
|
||||
|
||||
# Publish DEB
|
||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-deb"
|
||||
PLATFORM_DEB="linux-deb-$ARCH"
|
||||
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
|
||||
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_DEB" package "$DEB_FILENAME" "$VERSION" true "$DEB_PATH"
|
||||
|
||||
# Publish RPM
|
||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-build-rpm"
|
||||
PLATFORM_RPM="linux-rpm-$ARCH"
|
||||
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
|
||||
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "$PLATFORM_RPM" package "$RPM_FILENAME" "$VERSION" true "$RPM_PATH"
|
||||
|
||||
# Publish Snap
|
||||
npm run gulp -- "vscode-linux-$(VSCODE_ARCH)-prepare-snap"
|
||||
|
||||
# Pack snap tarball artifact, in order to preserve file perms
|
||||
mkdir -p $REPO/.build/linux/snap-tarball
|
||||
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$(VSCODE_ARCH).tar.gz"
|
||||
rm -rf $SNAP_TARBALL_PATH
|
||||
(cd .build/linux && tar -czf $SNAP_TARBALL_PATH snap)
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
continueOnError: true
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Pipeline Artifact'
|
||||
inputs:
|
||||
artifactName: snap-$(VSCODE_ARCH)
|
||||
targetPath: .build/linux/snap-tarball
|
||||
50
build/azure-pipelines/linux/snap-build-linux.yml
Normal file
50
build/azure-pipelines/linux/snap-build-linux.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: DownloadPipelineArtifact@0
|
||||
displayName: 'Download Pipeline Artifact'
|
||||
inputs:
|
||||
artifactName: snap-$(VSCODE_ARCH)
|
||||
targetPath: .build/linux/snap-tarball
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
# Get snapcraft version
|
||||
snapcraft --version
|
||||
|
||||
# Make sure we get latest packages
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade -y
|
||||
|
||||
# Define variables
|
||||
REPO="$(pwd)"
|
||||
ARCH="$(VSCODE_ARCH)"
|
||||
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
||||
|
||||
# Install build dependencies
|
||||
(cd build && yarn)
|
||||
|
||||
# Unpack snap tarball artifact, in order to preserve file perms
|
||||
SNAP_TARBALL_PATH="$REPO/.build/linux/snap-tarball/snap-$ARCH.tar.gz"
|
||||
(cd .build/linux && tar -xzf $SNAP_TARBALL_PATH)
|
||||
|
||||
# Create snap package
|
||||
BUILD_VERSION="$(date +%s)"
|
||||
SNAP_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.snap"
|
||||
PACKAGEJSON="$(ls $SNAP_ROOT/code*/usr/share/code*/resources/app/package.json)"
|
||||
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
|
||||
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME"
|
||||
(cd $SNAP_ROOT/code-* && sudo snapcraft snap --output "$SNAP_PATH")
|
||||
|
||||
# Publish snap package
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(AZURE_DOCUMENTDB_MASTERKEY)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(AZURE_STORAGE_ACCESS_KEY_2)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(MOONCAKE_STORAGE_ACCESS_KEY)" \
|
||||
node build/azure-pipelines/common/publish.js "$VSCODE_QUALITY" "linux-snap-$ARCH" package "$SNAP_FILENAME" "$VERSION" true "$SNAP_PATH"
|
||||
65
build/azure-pipelines/product-build.yml
Normal file
65
build/azure-pipelines/product-build.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
resources:
|
||||
containers:
|
||||
- container: vscode-x64
|
||||
image: joaomoreno/vscode-linux-build-agent:x64
|
||||
- container: vscode-ia32
|
||||
image: joaomoreno/vscode-linux-build-agent:ia32
|
||||
- container: snapcraft
|
||||
image: snapcore/snapcraft
|
||||
|
||||
jobs:
|
||||
- job: Windows
|
||||
condition: eq(variables['VSCODE_BUILD_WIN32'], 'true')
|
||||
pool:
|
||||
vmImage: VS2017-Win2016
|
||||
variables:
|
||||
VSCODE_ARCH: x64
|
||||
steps:
|
||||
- template: win32/product-build-win32.yml
|
||||
|
||||
- job: Windows32
|
||||
condition: eq(variables['VSCODE_BUILD_WIN32_32BIT'], 'true')
|
||||
pool:
|
||||
vmImage: VS2017-Win2016
|
||||
variables:
|
||||
VSCODE_ARCH: ia32
|
||||
steps:
|
||||
- template: win32/product-build-win32.yml
|
||||
|
||||
- job: Linux
|
||||
condition: eq(variables['VSCODE_BUILD_LINUX'], 'true')
|
||||
pool:
|
||||
vmImage: 'Ubuntu-16.04'
|
||||
variables:
|
||||
VSCODE_ARCH: x64
|
||||
container: vscode-x64
|
||||
steps:
|
||||
- template: linux/product-build-linux.yml
|
||||
|
||||
- job: LinuxSnap
|
||||
condition: eq(variables['VSCODE_BUILD_LINUX'], 'true')
|
||||
pool:
|
||||
vmImage: 'Ubuntu-16.04'
|
||||
variables:
|
||||
VSCODE_ARCH: x64
|
||||
container: snapcraft
|
||||
dependsOn: Linux
|
||||
steps:
|
||||
- template: linux/snap-build-linux.yml
|
||||
|
||||
- job: Linux32
|
||||
condition: eq(variables['VSCODE_BUILD_LINUX_32BIT'], 'true')
|
||||
pool:
|
||||
vmImage: 'Ubuntu-16.04'
|
||||
variables:
|
||||
VSCODE_ARCH: ia32
|
||||
container: vscode-ia32
|
||||
steps:
|
||||
- template: linux/product-build-linux.yml
|
||||
|
||||
- job: macOS
|
||||
condition: eq(variables['VSCODE_BUILD_MACOS'], 'true')
|
||||
pool:
|
||||
vmImage: macOS 10.13
|
||||
steps:
|
||||
- template: darwin/product-build-darwin.yml
|
||||
6
build/azure-pipelines/win32/ESRPClient/NuGet.config
Normal file
6
build/azure-pipelines/win32/ESRPClient/NuGet.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="ESRP" value="https://microsoft.pkgs.visualstudio.com/_packaging/ESRP/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
4
build/azure-pipelines/win32/ESRPClient/packages.config
Normal file
4
build/azure-pipelines/win32/ESRPClient/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EsrpClient" version="1.0.27" />
|
||||
</packages>
|
||||
54
build/azure-pipelines/win32/continuous-build-win32.yml
Normal file
54
build/azure-pipelines/win32/continuous-build-win32.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '2.x'
|
||||
addToPath: true
|
||||
# - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||
# inputs:
|
||||
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
# vstsFeed: '$(ArtifactFeed)'
|
||||
# condition: eq(variables['System.PullRequest.PullRequestId'], '')
|
||||
- powershell: |
|
||||
yarn
|
||||
displayName: Install Dependencies
|
||||
# condition: or(ne(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||
# - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
# inputs:
|
||||
# keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
# targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
# vstsFeed: '$(ArtifactFeed)'
|
||||
# condition: and(succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne(variables['CacheRestored'], 'true'))
|
||||
- powershell: |
|
||||
yarn gulp electron
|
||||
displayName: Download Electron
|
||||
- powershell: |
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
- powershell: |
|
||||
yarn monaco-compile-check
|
||||
displayName: Run Monaco Editor Checks
|
||||
- powershell: |
|
||||
yarn compile
|
||||
displayName: Compile Sources
|
||||
- powershell: |
|
||||
yarn download-builtin-extensions
|
||||
displayName: Download Built-in Extensions
|
||||
- powershell: |
|
||||
.\scripts\test.bat --tfs "Unit Tests"
|
||||
displayName: Run Unit Tests
|
||||
- powershell: |
|
||||
.\scripts\test-integration.bat --tfs "Integration Tests"
|
||||
displayName: Run Integration Tests
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Tests Results
|
||||
inputs:
|
||||
testResultsFiles: '*-results.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||
condition: succeededOrFailed()
|
||||
24
build/azure-pipelines/win32/exec.ps1
Normal file
24
build/azure-pipelines/win32/exec.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
# Taken from psake https://github.com/psake/psake
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode
|
||||
to see if an error occcured. If an error is detected then an exception is thrown.
|
||||
This function allows you to run command-line programs without having to
|
||||
explicitly check the $lastexitcode variable.
|
||||
|
||||
.EXAMPLE
|
||||
exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
|
||||
#>
|
||||
function Exec
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Position=0,Mandatory=1)][scriptblock]$cmd,
|
||||
[Parameter(Position=1,Mandatory=0)][string]$errorMessage = ($msgs.error_bad_command -f $cmd)
|
||||
)
|
||||
& $cmd
|
||||
if ($lastexitcode -ne 0) {
|
||||
throw ("Exec: " + $errorMessage)
|
||||
}
|
||||
}
|
||||
14
build/azure-pipelines/win32/import-esrp-auth-cert.ps1
Normal file
14
build/azure-pipelines/win32/import-esrp-auth-cert.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
Param(
|
||||
[string]$AuthCertificateBase64,
|
||||
[string]$AuthCertificateKey
|
||||
)
|
||||
|
||||
# Import auth certificate
|
||||
$AuthCertificateFileName = [System.IO.Path]::GetTempFileName()
|
||||
$AuthCertificateBytes = [Convert]::FromBase64String($AuthCertificateBase64)
|
||||
[IO.File]::WriteAllBytes($AuthCertificateFileName, $AuthCertificateBytes)
|
||||
$AuthCertificate = Import-PfxCertificate -FilePath $AuthCertificateFileName -CertStoreLocation Cert:\LocalMachine\My -Password (ConvertTo-SecureString $AuthCertificateKey -AsPlainText -Force)
|
||||
rm $AuthCertificateFileName
|
||||
$ESRPAuthCertificateSubjectName = $AuthCertificate.Subject
|
||||
|
||||
Write-Output ("##vso[task.setvariable variable=ESRPAuthCertificateSubjectName;]$ESRPAuthCertificateSubjectName")
|
||||
151
build/azure-pipelines/win32/product-build-win32.yml
Normal file
151
build/azure-pipelines/win32/product-build-win32.yml
Normal file
@@ -0,0 +1,151 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '2.x'
|
||||
addToPath: true
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
"machine monacotools.visualstudio.com`npassword $(VSO_PAT)`nmachine github.com`nlogin vscode`npassword $(VSCODE_MIXIN_PASSWORD)" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
|
||||
$env:npm_config_arch="$(VSCODE_ARCH)"
|
||||
$env:CHILD_CONCURRENCY="1"
|
||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||
exec { yarn }
|
||||
exec { npm run gulp -- mixin }
|
||||
exec { npm run gulp -- hygiene }
|
||||
exec { npm run monaco-compile-check }
|
||||
exec { node build/azure-pipelines/common/installDistro.js }
|
||||
exec { node build/lib/builtInExtensions.js }
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
$env:VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)"
|
||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-min" }
|
||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-inno-updater" }
|
||||
name: build
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { npm run gulp -- "electron-$(VSCODE_ARCH)" }
|
||||
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
|
||||
# yarn smoketest -- --build "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||
name: test
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
inputs:
|
||||
ConnectedServiceName: 'ESRP CodeSign'
|
||||
FolderPath: '$(agent.builddirectory)/VSCode-win32-$(VSCODE_ARCH)'
|
||||
Pattern: '*.dll,*.exe,*.node'
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"keyCode": "CP-230012",
|
||||
"operationSetCode": "SigntoolSign",
|
||||
"parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "VS Code"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "https://code.visualstudio.com/"
|
||||
},
|
||||
{
|
||||
"parameterName": "Append",
|
||||
"parameterValue": "/as"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"toolName": "sign",
|
||||
"toolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"keyCode": "CP-230012",
|
||||
"operationSetCode": "SigntoolVerify",
|
||||
"parameters": [
|
||||
{
|
||||
"parameterName": "VerifyAll",
|
||||
"parameterValue": "/all"
|
||||
}
|
||||
],
|
||||
"toolName": "sign",
|
||||
"toolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: 120
|
||||
|
||||
- task: NuGetCommand@2
|
||||
displayName: Install ESRPClient.exe
|
||||
inputs:
|
||||
restoreSolution: 'build\azure-pipelines\win32\ESRPClient\packages.config'
|
||||
feedsToUse: config
|
||||
nugetConfigPath: 'build\azure-pipelines\win32\ESRPClient\NuGet.config'
|
||||
externalFeedCredentials: 3fc0b7f7-da09-4ae7-a9c8-d69824b1819b
|
||||
restoreDirectory: packages
|
||||
|
||||
- task: ESRPImportCertTask@1
|
||||
displayName: Import ESRP Request Signing Certificate
|
||||
inputs:
|
||||
ESRP: 'ESRP CodeSign'
|
||||
|
||||
- powershell: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
.\build\azure-pipelines\win32\import-esrp-auth-cert.ps1 -AuthCertificateBase64 $(ESRP_AUTH_CERTIFICATE) -AuthCertificateKey $(ESRP_AUTH_CERTIFICATE_KEY)
|
||||
displayName: Import ESRP Auth Certificate
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { npm run gulp -- "vscode-win32-$(VSCODE_ARCH)-archive" "vscode-win32-$(VSCODE_ARCH)-system-setup" "vscode-win32-$(VSCODE_ARCH)-user-setup" --sign }
|
||||
|
||||
$Repo = "$(pwd)"
|
||||
$Root = "$Repo\.."
|
||||
$SystemExe = "$Repo\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe"
|
||||
$UserExe = "$Repo\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe"
|
||||
$Zip = "$Repo\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip"
|
||||
$Build = "$Root\VSCode-win32-$(VSCODE_ARCH)"
|
||||
|
||||
# get version
|
||||
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
||||
$Version = $PackageJson.version
|
||||
$Quality = "$env:VSCODE_QUALITY"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(AZURE_STORAGE_ACCESS_KEY_2)"
|
||||
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(MOONCAKE_STORAGE_ACCESS_KEY)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(AZURE_DOCUMENTDB_MASTERKEY)"
|
||||
|
||||
$assetPlatform = if ("$(VSCODE_ARCH)" -eq "ia32") { "win32" } else { "win32-x64" }
|
||||
|
||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$(VSCODE_ARCH)-$Version.zip" $Version true $Zip }
|
||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $SystemExe }
|
||||
exec { node build/azure-pipelines/common/publish.js $Quality "$global:assetPlatform-user" setup "VSCodeUserSetup-$(VSCODE_ARCH)-$Version.exe" $Version true $UserExe }
|
||||
|
||||
# publish hockeyapp symbols
|
||||
$hockeyAppId = if ("$(VSCODE_ARCH)" -eq "ia32") { "$(VSCODE_HOCKEYAPP_ID_WIN32)" } else { "$(VSCODE_HOCKEYAPP_ID_WIN64)" }
|
||||
exec { node build/azure-pipelines/common/symbols.js "$(VSCODE_MIXIN_PASSWORD)" "$(VSCODE_HOCKEYAPP_TOKEN)" "$(VSCODE_ARCH)" $hockeyAppId }
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
continueOnError: true
|
||||
70
build/azure-pipelines/win32/sign.ps1
Normal file
70
build/azure-pipelines/win32/sign.ps1
Normal file
@@ -0,0 +1,70 @@
|
||||
function Create-TmpJson($Obj) {
|
||||
$FileName = [System.IO.Path]::GetTempFileName()
|
||||
ConvertTo-Json -Depth 100 $Obj | Out-File -Encoding UTF8 $FileName
|
||||
return $FileName
|
||||
}
|
||||
|
||||
$Auth = Create-TmpJson @{
|
||||
Version = "1.0.0"
|
||||
AuthenticationType = "AAD_CERT"
|
||||
ClientId = $env:ESRPClientId
|
||||
AuthCert = @{
|
||||
SubjectName = $env:ESRPAuthCertificateSubjectName
|
||||
StoreLocation = "LocalMachine"
|
||||
StoreName = "My"
|
||||
}
|
||||
RequestSigningCert = @{
|
||||
SubjectName = $env:ESRPCertificateSubjectName
|
||||
StoreLocation = "LocalMachine"
|
||||
StoreName = "My"
|
||||
}
|
||||
}
|
||||
|
||||
$Policy = Create-TmpJson @{
|
||||
Version = "1.0.0"
|
||||
}
|
||||
|
||||
$Input = Create-TmpJson @{
|
||||
Version = "1.0.0"
|
||||
SignBatches = @(
|
||||
@{
|
||||
SourceLocationType = "UNC"
|
||||
SignRequestFiles = @(
|
||||
@{
|
||||
SourceLocation = $args[0]
|
||||
}
|
||||
)
|
||||
SigningInfo = @{
|
||||
Operations = @(
|
||||
@{
|
||||
KeyCode = "CP-230012"
|
||||
OperationCode = "SigntoolSign"
|
||||
Parameters = @{
|
||||
OpusName = "VS Code"
|
||||
OpusInfo = "https://code.visualstudio.com/"
|
||||
Append = "/as"
|
||||
FileDigest = "/fd `"SHA256`""
|
||||
PageHash = "/NPH"
|
||||
TimeStamp = "/tr `"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer`" /td sha256"
|
||||
}
|
||||
ToolName = "sign"
|
||||
ToolVersion = "1.0"
|
||||
},
|
||||
@{
|
||||
KeyCode = "CP-230012"
|
||||
OperationCode = "SigntoolVerify"
|
||||
Parameters = @{
|
||||
VerifyAll = "/all"
|
||||
}
|
||||
ToolName = "sign"
|
||||
ToolVersion = "1.0"
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
$Output = [System.IO.Path]::GetTempFileName()
|
||||
$ScriptPath = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
|
||||
& "$ScriptPath\ESRPClient\packages\EsrpClient.1.0.27\tools\ESRPClient.exe" Sign -a $Auth -p $Policy -i $Input -o $Output
|
||||
2
build/builtInExtensions.json
Normal file
2
build/builtInExtensions.json
Normal file
@@ -0,0 +1,2 @@
|
||||
[
|
||||
]
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
"es6": true,
|
||||
"browser": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
126
build/builtin/browser-main.js
Normal file
126
build/builtin/browser-main.js
Normal file
@@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
// @ts-ignore review
|
||||
const { remote } = require('electron');
|
||||
const dialog = remote.dialog;
|
||||
|
||||
const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json');
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
|
||||
function readJson(filePath) {
|
||||
return JSON.parse(fs.readFileSync(filePath, { encoding: 'utf8' }));
|
||||
}
|
||||
|
||||
function writeJson(filePath, obj) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(obj, null, 2));
|
||||
}
|
||||
|
||||
function renderOption(form, id, title, value, checked) {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'radio';
|
||||
input.id = id;
|
||||
input.name = 'choice';
|
||||
input.value = value;
|
||||
input.checked = !!checked;
|
||||
form.appendChild(input);
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.setAttribute('for', id);
|
||||
label.textContent = title;
|
||||
form.appendChild(label);
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
function render(el, state) {
|
||||
function setState(state) {
|
||||
try {
|
||||
writeJson(controlFilePath, state.control);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
el.innerHTML = '';
|
||||
render(el, state);
|
||||
}
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
const { builtin, control } = state;
|
||||
|
||||
for (const ext of builtin) {
|
||||
const controlState = control[ext.name] || 'marketplace';
|
||||
|
||||
const li = document.createElement('li');
|
||||
ul.appendChild(li);
|
||||
|
||||
const name = document.createElement('code');
|
||||
name.textContent = ext.name;
|
||||
li.appendChild(name);
|
||||
|
||||
const form = document.createElement('form');
|
||||
li.appendChild(form);
|
||||
|
||||
const marketplaceInput = renderOption(form, `marketplace-${ext.name}`, 'Marketplace', 'marketplace', controlState === 'marketplace');
|
||||
marketplaceInput.onchange = function () {
|
||||
control[ext.name] = 'marketplace';
|
||||
setState({ builtin, control });
|
||||
};
|
||||
|
||||
const disabledInput = renderOption(form, `disabled-${ext.name}`, 'Disabled', 'disabled', controlState === 'disabled');
|
||||
disabledInput.onchange = function () {
|
||||
control[ext.name] = 'disabled';
|
||||
setState({ builtin, control });
|
||||
};
|
||||
|
||||
let local = undefined;
|
||||
|
||||
if (controlState !== 'marketplace' && controlState !== 'disabled') {
|
||||
local = controlState;
|
||||
}
|
||||
|
||||
const localInput = renderOption(form, `local-${ext.name}`, 'Local', 'local', !!local);
|
||||
localInput.onchange = function () {
|
||||
const result = dialog.showOpenDialog(remote.getCurrentWindow(), {
|
||||
title: 'Choose Folder',
|
||||
properties: ['openDirectory']
|
||||
});
|
||||
|
||||
if (result && result.length >= 1) {
|
||||
control[ext.name] = result[0];
|
||||
}
|
||||
|
||||
setState({ builtin, control });
|
||||
};
|
||||
|
||||
if (local) {
|
||||
const localSpan = document.createElement('code');
|
||||
localSpan.className = 'local';
|
||||
localSpan.textContent = local;
|
||||
form.appendChild(localSpan);
|
||||
}
|
||||
}
|
||||
|
||||
el.appendChild(ul);
|
||||
}
|
||||
|
||||
function main() {
|
||||
const el = document.getElementById('extensions');
|
||||
const builtin = readJson(builtInExtensionsPath);
|
||||
let control;
|
||||
|
||||
try {
|
||||
control = readJson(controlFilePath);
|
||||
} catch (err) {
|
||||
control = {};
|
||||
}
|
||||
|
||||
render(el, { builtin, control });
|
||||
}
|
||||
|
||||
window.onload = main;
|
||||
46
build/builtin/index.html
Normal file
46
build/builtin/index.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Manage Built-in Extensions</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="browser-main.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: 'Menlo', 'Courier New', 'Courier', monospace;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0.3em 0;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
form {
|
||||
padding: 0.3em 0 0.3em 0.3em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Built-in Extensions</h1>
|
||||
<div id="extensions"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
20
build/builtin/main.js
Normal file
20
build/builtin/main.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const url = require('url');
|
||||
const path = require('path');
|
||||
|
||||
let window = null;
|
||||
|
||||
app.once('ready', () => {
|
||||
window = new BrowserWindow({ width: 800, height: 600 });
|
||||
window.setMenuBarVisibility(false);
|
||||
window.loadURL(url.format({ pathname: path.join(__dirname, 'index.html'), protocol: 'file:', slashes: true }));
|
||||
// window.webContents.openDevTools();
|
||||
window.once('closed', () => window = null);
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => app.quit());
|
||||
5
build/builtin/package.json
Normal file
5
build/builtin/package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "builtin",
|
||||
"version": "0.1.0",
|
||||
"main": "main.js"
|
||||
}
|
||||
@@ -43,7 +43,7 @@ function asYarnDependency(prefix, tree) {
|
||||
}
|
||||
|
||||
function getYarnProductionDependencies(cwd) {
|
||||
const raw = cp.execSync('yarn list --json', { cwd, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, 'ignore'] });
|
||||
const raw = cp.execSync('yarn list --json', { cwd, encoding: 'utf8', env: { ...process.env, NODE_ENV: 'production' }, stdio: [null, null, 'inherit'] });
|
||||
const match = /^{"type":"tree".*$/m.exec(raw);
|
||||
|
||||
if (!match || match.length !== 1) {
|
||||
|
||||
91
build/download/download.js
Normal file
91
build/download/download.js
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const https = require("https");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const cp = require("child_process");
|
||||
function ensureDir(filepath) {
|
||||
if (!fs.existsSync(filepath)) {
|
||||
ensureDir(path.dirname(filepath));
|
||||
fs.mkdirSync(filepath);
|
||||
}
|
||||
}
|
||||
function download(options, destination) {
|
||||
ensureDir(path.dirname(destination));
|
||||
return new Promise((c, e) => {
|
||||
const fd = fs.openSync(destination, 'w');
|
||||
const req = https.get(options, (res) => {
|
||||
res.on('data', (chunk) => {
|
||||
fs.writeSync(fd, chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
fs.closeSync(fd);
|
||||
c();
|
||||
});
|
||||
});
|
||||
req.on('error', (reqErr) => {
|
||||
console.error(`request to ${options.host}${options.path} failed.`);
|
||||
console.error(reqErr);
|
||||
e(reqErr);
|
||||
});
|
||||
});
|
||||
}
|
||||
const MARKER_ARGUMENT = `_download_fork_`;
|
||||
function base64encode(str) {
|
||||
return Buffer.from(str, 'utf8').toString('base64');
|
||||
}
|
||||
function base64decode(str) {
|
||||
return Buffer.from(str, 'base64').toString('utf8');
|
||||
}
|
||||
function downloadInExternalProcess(options) {
|
||||
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||
console.log(`Downloading ${url}...`);
|
||||
return new Promise((c, e) => {
|
||||
const child = cp.fork(__filename, [MARKER_ARGUMENT, base64encode(JSON.stringify(options))], {
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||
});
|
||||
let stderr = [];
|
||||
child.stderr.on('data', (chunk) => {
|
||||
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||
});
|
||||
child.on('exit', (code) => {
|
||||
if (code === 0) {
|
||||
// normal termination
|
||||
console.log(`Finished downloading ${url}.`);
|
||||
c();
|
||||
}
|
||||
else {
|
||||
// abnormal termination
|
||||
console.error(Buffer.concat(stderr).toString());
|
||||
e(new Error(`Download of ${url} failed.`));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.downloadInExternalProcess = downloadInExternalProcess;
|
||||
function _downloadInExternalProcess() {
|
||||
let options;
|
||||
try {
|
||||
options = JSON.parse(base64decode(process.argv[3]));
|
||||
}
|
||||
catch (err) {
|
||||
console.error(`Cannot read arguments`);
|
||||
console.error(err);
|
||||
process.exit(-1);
|
||||
return;
|
||||
}
|
||||
download(options.requestOptions, options.destinationPath).then(() => {
|
||||
process.exit(0);
|
||||
}, (err) => {
|
||||
console.error(err);
|
||||
process.exit(-2);
|
||||
});
|
||||
}
|
||||
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||
// running as forked download script
|
||||
_downloadInExternalProcess();
|
||||
}
|
||||
111
build/download/download.ts
Normal file
111
build/download/download.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as https from 'https';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as cp from 'child_process';
|
||||
|
||||
function ensureDir(filepath: string) {
|
||||
if (!fs.existsSync(filepath)) {
|
||||
ensureDir(path.dirname(filepath));
|
||||
fs.mkdirSync(filepath);
|
||||
}
|
||||
}
|
||||
|
||||
function download(options: https.RequestOptions, destination: string): Promise<void> {
|
||||
ensureDir(path.dirname(destination));
|
||||
|
||||
return new Promise<void>((c, e) => {
|
||||
const fd = fs.openSync(destination, 'w');
|
||||
const req = https.get(options, (res) => {
|
||||
res.on('data', (chunk) => {
|
||||
fs.writeSync(fd, chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
fs.closeSync(fd);
|
||||
c();
|
||||
});
|
||||
});
|
||||
req.on('error', (reqErr) => {
|
||||
console.error(`request to ${options.host}${options.path} failed.`);
|
||||
console.error(reqErr);
|
||||
e(reqErr);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const MARKER_ARGUMENT = `_download_fork_`;
|
||||
|
||||
function base64encode(str: string): string {
|
||||
return Buffer.from(str, 'utf8').toString('base64');
|
||||
}
|
||||
|
||||
function base64decode(str: string): string {
|
||||
return Buffer.from(str, 'base64').toString('utf8');
|
||||
}
|
||||
|
||||
export interface IDownloadRequestOptions {
|
||||
host: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface IDownloadOptions {
|
||||
requestOptions: IDownloadRequestOptions;
|
||||
destinationPath: string;
|
||||
}
|
||||
|
||||
export function downloadInExternalProcess(options: IDownloadOptions): Promise<void> {
|
||||
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||
console.log(`Downloading ${url}...`);
|
||||
return new Promise<void>((c, e) => {
|
||||
const child = cp.fork(
|
||||
__filename,
|
||||
[MARKER_ARGUMENT, base64encode(JSON.stringify(options))],
|
||||
{
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||
}
|
||||
);
|
||||
let stderr: Buffer[] = [];
|
||||
child.stderr.on('data', (chunk) => {
|
||||
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||
});
|
||||
child.on('exit', (code) => {
|
||||
if (code === 0) {
|
||||
// normal termination
|
||||
console.log(`Finished downloading ${url}.`);
|
||||
c();
|
||||
} else {
|
||||
// abnormal termination
|
||||
console.error(Buffer.concat(stderr).toString());
|
||||
e(new Error(`Download of ${url} failed.`));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function _downloadInExternalProcess() {
|
||||
let options: IDownloadOptions;
|
||||
try {
|
||||
options = JSON.parse(base64decode(process.argv[3]));
|
||||
} catch (err) {
|
||||
console.error(`Cannot read arguments`);
|
||||
console.error(err);
|
||||
process.exit(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
download(options.requestOptions, options.destinationPath).then(() => {
|
||||
process.exit(0);
|
||||
}, (err) => {
|
||||
console.error(err);
|
||||
process.exit(-2);
|
||||
});
|
||||
}
|
||||
|
||||
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||
// running as forked download script
|
||||
_downloadInExternalProcess();
|
||||
}
|
||||
18
build/gulpfile.compile.js
Normal file
18
build/gulpfile.compile.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const compilation = require('./lib/compilation');
|
||||
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
|
||||
|
||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||
const compileClientBuildTask = task.define('compile-client-build', task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
|
||||
|
||||
// All Build
|
||||
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
|
||||
exports.compileBuildTask = compileBuildTask;
|
||||
@@ -3,12 +3,19 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
var gulp = require('gulp');
|
||||
var path = require('path');
|
||||
var util = require('./lib/util');
|
||||
var common = require('./lib/optimize');
|
||||
var es = require('event-stream');
|
||||
var File = require('vinyl');
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const common = require('./lib/optimize');
|
||||
const es = require('event-stream');
|
||||
const File = require('vinyl');
|
||||
const i18n = require('./lib/i18n');
|
||||
const standalone = require('./lib/standalone');
|
||||
const cp = require('child_process');
|
||||
const compilation = require('./lib/compilation');
|
||||
const monacoapi = require('./monaco/api');
|
||||
const fs = require('fs');
|
||||
|
||||
var root = path.dirname(__dirname);
|
||||
var sha1 = util.getVersion(root);
|
||||
@@ -21,14 +28,14 @@ var editorEntryPoints = [
|
||||
{
|
||||
name: 'vs/editor/editor.main',
|
||||
include: [],
|
||||
exclude: [ 'vs/css', 'vs/nls' ],
|
||||
prepend: [ 'out-build/vs/css.js', 'out-build/vs/nls.js' ],
|
||||
exclude: ['vs/css', 'vs/nls'],
|
||||
prepend: ['out-editor-build/vs/css.js', 'out-editor-build/vs/nls.js'],
|
||||
},
|
||||
{
|
||||
name: 'vs/base/common/worker/simpleWorker',
|
||||
include: [ 'vs/editor/common/services/editorSimpleWorker' ],
|
||||
prepend: [ 'vs/loader.js' ],
|
||||
append: [ 'vs/base/worker/workerMain' ],
|
||||
include: ['vs/editor/common/services/editorSimpleWorker'],
|
||||
prepend: ['vs/loader.js'],
|
||||
append: ['vs/base/worker/workerMain'],
|
||||
dest: 'vs/base/worker/workerMain.js'
|
||||
}
|
||||
];
|
||||
@@ -42,9 +49,6 @@ var editorResources = [
|
||||
'!**/test/**'
|
||||
];
|
||||
|
||||
var editorOtherSources = [
|
||||
];
|
||||
|
||||
var BUNDLED_FILE_HEADER = [
|
||||
'/*!-----------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
@@ -55,38 +59,152 @@ var BUNDLED_FILE_HEADER = [
|
||||
''
|
||||
].join('\n');
|
||||
|
||||
function editorLoaderConfig() {
|
||||
var result = common.loaderConfig();
|
||||
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
||||
|
||||
// never ship octicons in editor
|
||||
result.paths['vs/base/browser/ui/octiconLabel/octiconLabel'] = 'out-build/vs/base/browser/ui/octiconLabel/octiconLabel.mock';
|
||||
const extractEditorSrcTask = task.define('extract-editor-src', () => {
|
||||
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
||||
const apiusages = monacoapi.execute().usageContent;
|
||||
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
||||
standalone.extractEditor({
|
||||
sourcesRoot: path.join(root, 'src'),
|
||||
entryPoints: [
|
||||
'vs/editor/editor.main',
|
||||
'vs/editor/editor.worker',
|
||||
'vs/base/worker/workerMain',
|
||||
],
|
||||
inlineEntryPoints: [
|
||||
apiusages,
|
||||
extrausages
|
||||
],
|
||||
typings: [
|
||||
'typings/lib.ie11_safe_es6.d.ts',
|
||||
'typings/thenable.d.ts',
|
||||
'typings/es6-promise.d.ts',
|
||||
'typings/require-monaco.d.ts',
|
||||
"typings/lib.es2018.promise.d.ts",
|
||||
'vs/monaco.d.ts'
|
||||
],
|
||||
libs: [
|
||||
`lib.es5.d.ts`,
|
||||
`lib.dom.d.ts`,
|
||||
`lib.webworker.importscripts.d.ts`
|
||||
],
|
||||
redirects: {
|
||||
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
|
||||
},
|
||||
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
|
||||
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
|
||||
destRoot: path.join(root, 'out-editor-src')
|
||||
});
|
||||
});
|
||||
|
||||
// force css inlining to use base64 -- see https://github.com/Microsoft/monaco-editor/issues/148
|
||||
result['vs/css'] = {
|
||||
inlineResources: 'base64',
|
||||
inlineResourcesLimit: 3000 // see https://github.com/Microsoft/monaco-editor/issues/336
|
||||
};
|
||||
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
||||
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-client-build'], common.optimizeTask({
|
||||
const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
|
||||
src: 'out-editor-build',
|
||||
entryPoints: editorEntryPoints,
|
||||
otherSources: editorOtherSources,
|
||||
resources: editorResources,
|
||||
loaderConfig: editorLoaderConfig(),
|
||||
loaderConfig: {
|
||||
paths: {
|
||||
'vs': 'out-editor-build/vs',
|
||||
'vs/css': 'out-editor-build/vs/css.build',
|
||||
'vs/nls': 'out-editor-build/vs/nls.build',
|
||||
'vscode': 'empty:'
|
||||
}
|
||||
},
|
||||
bundleLoader: false,
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
bundleInfo: true,
|
||||
out: 'out-editor'
|
||||
out: 'out-editor',
|
||||
languages: languages
|
||||
}));
|
||||
|
||||
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
||||
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
||||
const minifyEditorAMDTask = task.define('minify-editor-amd', common.minifyTask('out-editor'));
|
||||
|
||||
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
||||
gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-editor'], function() {
|
||||
const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => {
|
||||
standalone.createESMSourcesAndResources2({
|
||||
srcFolder: './out-editor-src',
|
||||
outFolder: './out-editor-esm',
|
||||
outResourcesFolder: './out-monaco-editor-core/esm',
|
||||
ignores: [
|
||||
'inlineEntryPoint:0.ts',
|
||||
'inlineEntryPoint:1.ts',
|
||||
'vs/loader.js',
|
||||
'vs/nls.ts',
|
||||
'vs/nls.build.js',
|
||||
'vs/nls.d.ts',
|
||||
'vs/css.js',
|
||||
'vs/css.build.js',
|
||||
'vs/css.d.ts',
|
||||
'vs/base/worker/workerMain.ts',
|
||||
],
|
||||
renames: {
|
||||
'vs/nls.mock.ts': 'vs/nls.ts'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const compileEditorESMTask = task.define('compile-editor-esm', () => {
|
||||
if (process.platform === 'win32') {
|
||||
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
||||
cwd: path.join(__dirname, '../out-editor-esm')
|
||||
});
|
||||
console.log(result.stdout.toString());
|
||||
console.log(result.stderr.toString());
|
||||
} else {
|
||||
const result = cp.spawnSync(`node`, [`../node_modules/.bin/tsc`], {
|
||||
cwd: path.join(__dirname, '../out-editor-esm')
|
||||
});
|
||||
console.log(result.stdout.toString());
|
||||
console.log(result.stderr.toString());
|
||||
}
|
||||
});
|
||||
|
||||
function toExternalDTS(contents) {
|
||||
let lines = contents.split('\n');
|
||||
let killNextCloseCurlyBrace = false;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i];
|
||||
|
||||
if (killNextCloseCurlyBrace) {
|
||||
if ('}' === line) {
|
||||
lines[i] = '';
|
||||
killNextCloseCurlyBrace = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line.indexOf(' ') === 0) {
|
||||
lines[i] = line.substr(4);
|
||||
} else if (line.charAt(0) === '\t') {
|
||||
lines[i] = line.substr(1);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('declare namespace monaco {' === line) {
|
||||
lines[i] = '';
|
||||
killNextCloseCurlyBrace = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (line.indexOf('declare namespace monaco.') === 0) {
|
||||
lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
||||
}
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
function filterStream(testFunc) {
|
||||
return es.through(function (data) {
|
||||
if (!testFunc(data.relative)) {
|
||||
return;
|
||||
}
|
||||
this.emit('data', data);
|
||||
});
|
||||
}
|
||||
|
||||
const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||
return es.merge(
|
||||
// other assets
|
||||
es.merge(
|
||||
@@ -95,19 +213,38 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
|
||||
gulp.src('src/vs/monaco.d.ts')
|
||||
).pipe(gulp.dest('out-monaco-editor-core')),
|
||||
|
||||
// place the .d.ts in the esm folder
|
||||
gulp.src('src/vs/monaco.d.ts')
|
||||
.pipe(es.through(function (data) {
|
||||
this.emit('data', new File({
|
||||
path: data.path.replace(/monaco\.d\.ts/, 'editor.api.d.ts'),
|
||||
base: data.base,
|
||||
contents: Buffer.from(toExternalDTS(data.contents.toString()))
|
||||
}));
|
||||
}))
|
||||
.pipe(gulp.dest('out-monaco-editor-core/esm/vs/editor')),
|
||||
|
||||
// package.json
|
||||
gulp.src('build/monaco/package.json')
|
||||
.pipe(es.through(function(data) {
|
||||
.pipe(es.through(function (data) {
|
||||
var json = JSON.parse(data.contents.toString());
|
||||
json.private = false;
|
||||
data.contents = new Buffer(JSON.stringify(json, null, ' '));
|
||||
data.contents = Buffer.from(JSON.stringify(json, null, ' '));
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||
|
||||
// version.txt
|
||||
gulp.src('build/monaco/version.txt')
|
||||
.pipe(es.through(function (data) {
|
||||
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||
|
||||
// README.md
|
||||
gulp.src('build/monaco/README-npm.md')
|
||||
.pipe(es.through(function(data) {
|
||||
.pipe(es.through(function (data) {
|
||||
this.emit('data', new File({
|
||||
path: data.path.replace(/README-npm\.md/, 'README.md'),
|
||||
base: data.base,
|
||||
@@ -124,10 +261,10 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
|
||||
// min folder
|
||||
es.merge(
|
||||
gulp.src('out-editor-min/**/*')
|
||||
).pipe(filterStream(function(path) {
|
||||
).pipe(filterStream(function (path) {
|
||||
// no map files
|
||||
return !/(\.js\.map$)|(nls\.metadata\.json$)|(bundleInfo\.json$)/.test(path);
|
||||
})).pipe(es.through(function(data) {
|
||||
})).pipe(es.through(function (data) {
|
||||
// tweak the sourceMappingURL
|
||||
if (!/\.js$/.test(data.path)) {
|
||||
this.emit('data', data);
|
||||
@@ -138,70 +275,104 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
|
||||
|
||||
var strContents = data.contents.toString();
|
||||
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr);
|
||||
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
|
||||
|
||||
data.contents = new Buffer(strContents);
|
||||
data.contents = Buffer.from(strContents);
|
||||
this.emit('data', data);
|
||||
})).pipe(gulp.dest('out-monaco-editor-core/min')),
|
||||
|
||||
// min-maps folder
|
||||
es.merge(
|
||||
gulp.src('out-editor-min/**/*')
|
||||
).pipe(filterStream(function(path) {
|
||||
).pipe(filterStream(function (path) {
|
||||
// no map files
|
||||
return /\.js\.map$/.test(path);
|
||||
})).pipe(gulp.dest('out-monaco-editor-core/min-maps'))
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('analyze-editor-distro', function() {
|
||||
var bundleInfo = require('../out-editor/bundleInfo.json');
|
||||
var graph = bundleInfo.graph;
|
||||
var bundles = bundleInfo.bundles;
|
||||
gulp.task('editor-distro',
|
||||
task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-editor-src'),
|
||||
util.rimraf('out-editor-build'),
|
||||
util.rimraf('out-editor-esm'),
|
||||
util.rimraf('out-monaco-editor-core'),
|
||||
util.rimraf('out-editor'),
|
||||
util.rimraf('out-editor-min')
|
||||
),
|
||||
extractEditorSrcTask,
|
||||
task.parallel(
|
||||
task.series(
|
||||
compileEditorAMDTask,
|
||||
optimizeEditorAMDTask,
|
||||
minifyEditorAMDTask
|
||||
),
|
||||
task.series(
|
||||
createESMSourcesAndResourcesTask,
|
||||
compileEditorESMTask
|
||||
)
|
||||
),
|
||||
finalEditorResourcesTask
|
||||
)
|
||||
);
|
||||
|
||||
var inverseGraph = {};
|
||||
Object.keys(graph).forEach(function(module) {
|
||||
var dependencies = graph[module];
|
||||
dependencies.forEach(function(dep) {
|
||||
inverseGraph[dep] = inverseGraph[dep] || [];
|
||||
inverseGraph[dep].push(module);
|
||||
});
|
||||
});
|
||||
//#region monaco type checking
|
||||
|
||||
var detailed = {};
|
||||
Object.keys(bundles).forEach(function(entryPoint) {
|
||||
var included = bundles[entryPoint];
|
||||
var includedMap = {};
|
||||
included.forEach(function(included) {
|
||||
includedMap[included] = true;
|
||||
});
|
||||
function createTscCompileTask(watch) {
|
||||
return () => {
|
||||
const createReporter = require('./lib/reporter').createReporter;
|
||||
|
||||
var explanation = [];
|
||||
included.map(function(included) {
|
||||
if (included.indexOf('!') >= 0) {
|
||||
return;
|
||||
return new Promise((resolve, reject) => {
|
||||
const args = ['./node_modules/.bin/tsc', '-p', './src/tsconfig.monaco.json', '--noEmit'];
|
||||
if (watch) {
|
||||
args.push('-w');
|
||||
}
|
||||
const child = cp.spawn(`node`, args, {
|
||||
cwd: path.join(__dirname, '..'),
|
||||
// stdio: [null, 'pipe', 'inherit']
|
||||
});
|
||||
let errors = [];
|
||||
let reporter = createReporter();
|
||||
let report;
|
||||
// eslint-disable-next-line no-control-regex
|
||||
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
||||
|
||||
var reason = (inverseGraph[included]||[]).filter(function(mod) {
|
||||
return !!includedMap[mod];
|
||||
});
|
||||
explanation.push({
|
||||
module: included,
|
||||
reason: reason
|
||||
child.stdout.on('data', data => {
|
||||
let str = String(data);
|
||||
str = str.replace(magic, '').trim();
|
||||
if (str.indexOf('Starting compilation') >= 0 || str.indexOf('File change detected') >= 0) {
|
||||
errors.length = 0;
|
||||
report = reporter.end(false);
|
||||
|
||||
} else if (str.indexOf('Compilation complete') >= 0) {
|
||||
report.end();
|
||||
|
||||
} else if (str) {
|
||||
let match = /(.*\(\d+,\d+\): )(.*: )(.*)/.exec(str);
|
||||
if (match) {
|
||||
// trying to massage the message so that it matches the gulp-tsb error messages
|
||||
// e.g. src/vs/base/common/strings.ts(663,5): error TS2322: Type '1234' is not assignable to type 'string'.
|
||||
let fullpath = path.join(root, match[1]);
|
||||
let message = match[3];
|
||||
// @ts-ignore
|
||||
reporter(fullpath + message);
|
||||
} else {
|
||||
// @ts-ignore
|
||||
reporter(str);
|
||||
}
|
||||
}
|
||||
});
|
||||
child.on('exit', resolve);
|
||||
child.on('error', reject);
|
||||
});
|
||||
|
||||
detailed[entryPoint] = explanation;
|
||||
});
|
||||
|
||||
console.log(JSON.stringify(detailed, null, '\t'));
|
||||
});
|
||||
|
||||
function filterStream(testFunc) {
|
||||
return es.through(function(data) {
|
||||
if (!testFunc(data.relative)) {
|
||||
return;
|
||||
}
|
||||
this.emit('data', data);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', createTscCompileTask(true));
|
||||
exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask;
|
||||
|
||||
const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
|
||||
exports.monacoTypecheckTask = monacoTypecheckTask;
|
||||
|
||||
//#endregion
|
||||
|
||||
@@ -11,8 +11,8 @@ const path = require('path');
|
||||
const tsb = require('gulp-tsb');
|
||||
const es = require('event-stream');
|
||||
const filter = require('gulp-filter');
|
||||
const rimraf = require('rimraf');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const watcher = require('./lib/watch');
|
||||
const createReporter = require('./lib/reporter').createReporter;
|
||||
const glob = require('glob');
|
||||
@@ -20,6 +20,8 @@ const sourcemaps = require('gulp-sourcemaps');
|
||||
const nlsDev = require('vscode-nls-dev');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const plumber = require('gulp-plumber');
|
||||
const _ = require('underscore');
|
||||
|
||||
const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
|
||||
|
||||
@@ -29,35 +31,34 @@ const compilations = glob.sync('**/tsconfig.json', {
|
||||
});
|
||||
|
||||
const getBaseUrl = out => `https://ticino.blob.core.windows.net/sourcemaps/${commit}/${out}`;
|
||||
const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'];
|
||||
|
||||
const tasks = compilations.map(function (tsconfigFile) {
|
||||
const absolutePath = path.join(extensionsPath, tsconfigFile);
|
||||
const relativeDirname = path.dirname(tsconfigFile);
|
||||
|
||||
const tsOptions = require(absolutePath).compilerOptions;
|
||||
const tsconfig = require(absolutePath);
|
||||
const tsOptions = _.assign({}, tsconfig.extends ? require(path.join(extensionsPath, relativeDirname, tsconfig.extends)).compilerOptions : {}, tsconfig.compilerOptions);
|
||||
tsOptions.verbose = false;
|
||||
tsOptions.sourceMap = true;
|
||||
|
||||
const name = relativeDirname.replace(/\//g, '-');
|
||||
|
||||
// Tasks
|
||||
const clean = 'clean-extension:' + name;
|
||||
const compile = 'compile-extension:' + name;
|
||||
const watch = 'watch-extension:' + name;
|
||||
|
||||
// Build Tasks
|
||||
const cleanBuild = 'clean-extension-build:' + name;
|
||||
const compileBuild = 'compile-extension-build:' + name;
|
||||
const watchBuild = 'watch-extension-build:' + name;
|
||||
|
||||
const root = path.join('extensions', relativeDirname);
|
||||
const srcBase = path.join(root, 'src');
|
||||
const src = path.join(srcBase, '**');
|
||||
const out = path.join(root, 'out');
|
||||
const i18n = path.join(__dirname, '..', 'i18n');
|
||||
const baseUrl = getBaseUrl(out);
|
||||
|
||||
let headerId, headerOut;
|
||||
let index = relativeDirname.indexOf('/');
|
||||
if (index < 0) {
|
||||
headerId = 'vscode.' + relativeDirname;
|
||||
headerOut = 'out';
|
||||
} else {
|
||||
headerId = 'vscode.' + relativeDirname.substr(0, index);
|
||||
headerOut = relativeDirname.substr(index + 1) + '/out';
|
||||
}
|
||||
|
||||
function createPipeline(build, emitError) {
|
||||
const reporter = createReporter();
|
||||
|
||||
@@ -70,6 +71,13 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
const input = es.through();
|
||||
const tsFilter = filter(['**/*.ts', '!**/lib/lib*.d.ts', '!**/node_modules/**'], { restore: true });
|
||||
const output = input
|
||||
.pipe(plumber({
|
||||
errorHandler: function (err) {
|
||||
if (err && !err.__reporter__) {
|
||||
reporter(err);
|
||||
}
|
||||
}
|
||||
}))
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(compilation())
|
||||
@@ -82,7 +90,9 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
sourceRoot: '../src'
|
||||
}))
|
||||
.pipe(tsFilter.restore)
|
||||
.pipe(build ? nlsDev.createAdditionalLanguageFiles(languages, i18n, out) : es.through())
|
||||
.pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through())
|
||||
// Filter out *.nls.json file. We needed them only to bundle meta data file.
|
||||
.pipe(filter(['**', '!**/*.nls.json']))
|
||||
.pipe(reporter.end(emitError));
|
||||
|
||||
return es.duplex(input, output);
|
||||
@@ -91,18 +101,18 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
|
||||
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
||||
|
||||
gulp.task(clean, cb => rimraf(out, cb));
|
||||
const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));
|
||||
|
||||
gulp.task(compile, [clean], () => {
|
||||
const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
|
||||
const pipeline = createPipeline(false, true);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
|
||||
return input
|
||||
.pipe(pipeline())
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task(watch, [clean], () => {
|
||||
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
|
||||
const pipeline = createPipeline(false);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
const watchInput = watcher(src, srcOpts);
|
||||
@@ -110,43 +120,35 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
return watchInput
|
||||
.pipe(util.incremental(pipeline, input))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task(cleanBuild, cb => rimraf(out, cb));
|
||||
|
||||
gulp.task(compileBuild, [clean], () => {
|
||||
const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
|
||||
const pipeline = createPipeline(true, true);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
|
||||
return input
|
||||
.pipe(pipeline())
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task(watchBuild, [clean], () => {
|
||||
const pipeline = createPipeline(true);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
const watchInput = watcher(src, srcOpts);
|
||||
|
||||
return watchInput
|
||||
.pipe(util.incremental(() => pipeline(true), input))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
// Tasks
|
||||
gulp.task(compileTask);
|
||||
gulp.task(watchTask);
|
||||
|
||||
return {
|
||||
clean: clean,
|
||||
compile: compile,
|
||||
watch: watch,
|
||||
cleanBuild: cleanBuild,
|
||||
compileBuild: compileBuild,
|
||||
watchBuild: watchBuild
|
||||
compileTask: compileTask,
|
||||
watchTask: watchTask,
|
||||
compileBuildTask: compileBuildTask
|
||||
};
|
||||
});
|
||||
|
||||
gulp.task('clean-extensions', tasks.map(t => t.clean));
|
||||
gulp.task('compile-extensions', tasks.map(t => t.compile));
|
||||
gulp.task('watch-extensions', tasks.map(t => t.watch));
|
||||
const compileExtensionsTask = task.define('compile-extensions', task.parallel(...tasks.map(t => t.compileTask)));
|
||||
gulp.task(compileExtensionsTask);
|
||||
exports.compileExtensionsTask = compileExtensionsTask;
|
||||
|
||||
gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild));
|
||||
gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild));
|
||||
gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild));
|
||||
const watchExtensionsTask = task.define('watch-extensions', task.parallel(...tasks.map(t => t.watchTask)));
|
||||
gulp.task(watchExtensionsTask);
|
||||
exports.watchExtensionsTask = watchExtensionsTask;
|
||||
|
||||
const compileExtensionsBuildTask = task.define('compile-extensions-build', task.parallel(...tasks.map(t => t.compileBuildTask)));
|
||||
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
|
||||
|
||||
@@ -12,7 +12,11 @@ const gulptslint = require('gulp-tslint');
|
||||
const gulpeslint = require('gulp-eslint');
|
||||
const tsfmt = require('typescript-formatter');
|
||||
const tslint = require('tslint');
|
||||
const VinylFile = require('vinyl');
|
||||
const vfs = require('vinyl-fs');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const pall = require('p-all');
|
||||
|
||||
/**
|
||||
* Hygiene works by creating cascading subsets of all our files and
|
||||
@@ -29,55 +33,63 @@ const all = [
|
||||
'extensions/**/*',
|
||||
'scripts/**/*',
|
||||
'src/**/*',
|
||||
'test/**/*'
|
||||
];
|
||||
|
||||
const eolFilter = [
|
||||
'**',
|
||||
'!ThirdPartyNotices.txt',
|
||||
'!LICENSE.txt',
|
||||
'!extensions/**/out/**',
|
||||
'!test/smoke/out/**',
|
||||
'!**/node_modules/**',
|
||||
'!**/fixtures/**',
|
||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot}',
|
||||
'!build/{lib,tslintRules}/**/*.js',
|
||||
'!build/monaco/**',
|
||||
'!build/win32/**',
|
||||
'!build/**/*.sh',
|
||||
'!build/tfs/**/*.js',
|
||||
'!**/Dockerfile'
|
||||
'test/**/*',
|
||||
'!**/node_modules/**'
|
||||
];
|
||||
|
||||
const indentationFilter = [
|
||||
'**',
|
||||
|
||||
// except specific files
|
||||
'!ThirdPartyNotices.txt',
|
||||
'!**/*.md',
|
||||
'!**/*.ps1',
|
||||
'!**/*.template',
|
||||
'!**/*.yaml',
|
||||
'!**/*.yml',
|
||||
'!**/yarn.lock',
|
||||
'!**/lib/**',
|
||||
'!extensions/**/*.d.ts',
|
||||
'!src/typings/**/*.d.ts',
|
||||
'!src/vs/*/**/*.d.ts',
|
||||
'!**/*.d.ts.recipe',
|
||||
'!LICENSE.{txt,rtf}',
|
||||
'!LICENSES.chromium.html',
|
||||
'!**/LICENSE',
|
||||
'!src/vs/nls.js',
|
||||
'!src/vs/nls.build.js',
|
||||
'!src/vs/css.js',
|
||||
'!src/vs/css.build.js',
|
||||
'!src/vs/loader.js',
|
||||
'!src/vs/base/common/marked/marked.js',
|
||||
'!src/vs/base/node/terminateProcess.sh',
|
||||
'!src/vs/base/node/cpuUsage.sh',
|
||||
'!test/assert.js',
|
||||
|
||||
// except specific folders
|
||||
'!test/smoke/out/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace2/**',
|
||||
'!build/monaco/**',
|
||||
'!build/win32/**',
|
||||
|
||||
// except multiple specific files
|
||||
'!**/package.json',
|
||||
'!**/yarn.lock',
|
||||
'!**/yarn-error.log',
|
||||
|
||||
// except multiple specific folders
|
||||
'!**/octicons/**',
|
||||
'!**/vs/base/common/marked/raw.marked.js',
|
||||
'!**/vs/base/common/winjs.base.raw.js',
|
||||
'!**/vs/base/node/terminateProcess.sh',
|
||||
'!**/vs/base/node/ps-win.ps1',
|
||||
'!**/vs/nls.js',
|
||||
'!**/vs/css.js',
|
||||
'!**/vs/loader.js',
|
||||
'!**/fixtures/**',
|
||||
'!**/lib/**',
|
||||
'!extensions/**/out/**',
|
||||
'!extensions/**/snippets/**',
|
||||
'!extensions/**/syntaxes/**',
|
||||
'!extensions/**/themes/**',
|
||||
'!extensions/**/colorize-fixtures/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace/**'
|
||||
|
||||
// except specific file types
|
||||
'!src/vs/*/**/*.d.ts',
|
||||
'!src/typings/**/*.d.ts',
|
||||
'!extensions/**/*.d.ts',
|
||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
||||
'!build/{lib,tslintRules,download}/**/*.js',
|
||||
'!build/**/*.sh',
|
||||
'!build/azure-pipelines/**/*.js',
|
||||
'!build/azure-pipelines/**/*.config',
|
||||
'!**/Dockerfile',
|
||||
'!**/*.Dockerfile',
|
||||
'!**/*.dockerfile',
|
||||
'!extensions/markdown-language-features/media/*.js'
|
||||
];
|
||||
|
||||
const copyrightFilter = [
|
||||
@@ -89,17 +101,24 @@ const copyrightFilter = [
|
||||
'!**/*.md',
|
||||
'!**/*.bat',
|
||||
'!**/*.cmd',
|
||||
'!**/*.ico',
|
||||
'!**/*.icns',
|
||||
'!**/*.xml',
|
||||
'!**/*.sh',
|
||||
'!**/*.txt',
|
||||
'!**/*.xpm',
|
||||
'!**/*.opts',
|
||||
'!**/*.disabled',
|
||||
'!**/*.code-workspace',
|
||||
'!**/promise-polyfill/polyfill.js',
|
||||
'!build/**/*.init',
|
||||
'!resources/linux/snap/snapcraft.yaml',
|
||||
'!resources/linux/snap/electron-launch',
|
||||
'!resources/win32/bin/code.js',
|
||||
'!extensions/markdown/media/tomorrow.css',
|
||||
'!extensions/html/server/src/modes/typescript/*'
|
||||
'!resources/completions/**',
|
||||
'!extensions/markdown-language-features/media/highlight.css',
|
||||
'!extensions/html-language-features/server/src/modes/typescript/*',
|
||||
'!extensions/*/server/bin/*'
|
||||
];
|
||||
|
||||
const eslintFilter = [
|
||||
@@ -110,8 +129,7 @@ const eslintFilter = [
|
||||
'!src/vs/nls.js',
|
||||
'!src/vs/css.build.js',
|
||||
'!src/vs/nls.build.js',
|
||||
'!src/**/winjs.base.raw.js',
|
||||
'!src/**/raw.marked.js',
|
||||
'!src/**/marked.js',
|
||||
'!**/test/**'
|
||||
];
|
||||
|
||||
@@ -124,16 +142,18 @@ const tslintFilter = [
|
||||
'!**/node_modules/**',
|
||||
'!extensions/typescript/test/colorize-fixtures/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace/**',
|
||||
'!extensions/vscode-api-tests/testWorkspace2/**',
|
||||
'!extensions/**/*.test.ts',
|
||||
'!extensions/html/server/lib/jquery.d.ts'
|
||||
'!extensions/html-language-features/server/lib/jquery.d.ts'
|
||||
];
|
||||
|
||||
const copyrightHeader = [
|
||||
// {{SQL CARBON EDIT}}
|
||||
const copyrightHeaderLines = [
|
||||
'/*---------------------------------------------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
' * Licensed under the Source EULA. See License.txt in the project root for license information.',
|
||||
' *--------------------------------------------------------------------------------------------*/'
|
||||
].join('\n');
|
||||
];
|
||||
|
||||
gulp.task('eslint', () => {
|
||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||
@@ -144,31 +164,23 @@ gulp.task('eslint', () => {
|
||||
});
|
||||
|
||||
gulp.task('tslint', () => {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const options = { emitError: false };
|
||||
|
||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||
.pipe(filter(tslintFilter))
|
||||
.pipe(gulptslint({ rulesDirectory: 'build/lib/tslint' }))
|
||||
.pipe(gulptslint.report(options));
|
||||
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
|
||||
.pipe(gulptslint.default.report(options));
|
||||
});
|
||||
|
||||
const hygiene = exports.hygiene = (some, options) => {
|
||||
options = options || {};
|
||||
function hygiene(some) {
|
||||
let errorCount = 0;
|
||||
|
||||
const eol = es.through(function (file) {
|
||||
if (/\r\n?/g.test(file.contents.toString('utf8'))) {
|
||||
console.error(file.relative + ': Bad EOL found');
|
||||
errorCount++;
|
||||
}
|
||||
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
const indentation = es.through(function (file) {
|
||||
file.contents
|
||||
.toString('utf8')
|
||||
.split(/\r\n|\r|\n/)
|
||||
const lines = file.contents.toString('utf8').split(/\r\n|\r|\n/);
|
||||
file.__lines = lines;
|
||||
|
||||
lines
|
||||
.forEach((line, i) => {
|
||||
if (/^\s*$/.test(line)) {
|
||||
// empty or whitespace lines are OK
|
||||
@@ -186,9 +198,14 @@ const hygiene = exports.hygiene = (some, options) => {
|
||||
});
|
||||
|
||||
const copyrights = es.through(function (file) {
|
||||
if (file.contents.toString('utf8').indexOf(copyrightHeader) !== 0) {
|
||||
console.error(file.relative + ': Missing or bad copyright statement');
|
||||
errorCount++;
|
||||
const lines = file.__lines;
|
||||
|
||||
for (let i = 0; i < copyrightHeaderLines.length; i++) {
|
||||
if (lines[i] !== copyrightHeaderLines[i]) {
|
||||
console.error(file.relative + ': Missing or bad copyright statement');
|
||||
errorCount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.emit('data', file);
|
||||
@@ -196,12 +213,25 @@ const hygiene = exports.hygiene = (some, options) => {
|
||||
|
||||
const formatting = es.map(function (file, cb) {
|
||||
tsfmt.processString(file.path, file.contents.toString('utf8'), {
|
||||
verify: true,
|
||||
verify: false,
|
||||
tsfmt: true,
|
||||
// verbose: true
|
||||
// verbose: true,
|
||||
// keep checkJS happy
|
||||
editorconfig: undefined,
|
||||
replace: undefined,
|
||||
tsconfig: undefined,
|
||||
tsconfigFile: undefined,
|
||||
tslint: undefined,
|
||||
tslintFile: undefined,
|
||||
tsfmtFile: undefined,
|
||||
vscode: undefined,
|
||||
vscodeFile: undefined
|
||||
}).then(result => {
|
||||
if (result.error) {
|
||||
console.error(result.message);
|
||||
let original = result.src.replace(/\r\n/gm, '\n');
|
||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||
|
||||
if (original !== formatted) {
|
||||
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||
errorCount++;
|
||||
}
|
||||
cb(null, file);
|
||||
@@ -211,43 +241,31 @@ const hygiene = exports.hygiene = (some, options) => {
|
||||
});
|
||||
});
|
||||
|
||||
function reportFailures(failures) {
|
||||
failures.forEach(failure => {
|
||||
const name = failure.name || failure.fileName;
|
||||
const position = failure.startPosition;
|
||||
const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line;
|
||||
const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character;
|
||||
|
||||
// console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`);
|
||||
});
|
||||
}
|
||||
const tslintConfiguration = tslint.Configuration.findConfiguration('tslint.json', '.');
|
||||
const tslintOptions = { fix: false, formatter: 'json' };
|
||||
const tsLinter = new tslint.Linter(tslintOptions);
|
||||
|
||||
const tsl = es.through(function (file) {
|
||||
const configuration = tslint.Configuration.findConfiguration(null, '.');
|
||||
const options = { formatter: 'json', rulesDirectory: 'build/lib/tslint' };
|
||||
const contents = file.contents.toString('utf8');
|
||||
const linter = new tslint.Linter(options);
|
||||
linter.lint(file.relative, contents, configuration.results);
|
||||
const result = linter.getResult();
|
||||
|
||||
if (result.failures.length > 0) {
|
||||
reportFailures(result.failures);
|
||||
errorCount += result.failures.length;
|
||||
}
|
||||
|
||||
tsLinter.lint(file.relative, contents, tslintConfiguration.results);
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
const result = vfs.src(some || all, { base: '.', follow: true, allowEmpty: true })
|
||||
let input;
|
||||
|
||||
if (Array.isArray(some) || typeof some === 'string' || !some) {
|
||||
input = vfs.src(some || all, { base: '.', follow: true, allowEmpty: true });
|
||||
} else {
|
||||
input = some;
|
||||
}
|
||||
|
||||
const result = input
|
||||
.pipe(filter(f => !f.stat.isDirectory()))
|
||||
.pipe(filter(eolFilter))
|
||||
// {{SQL CARBON EDIT}}
|
||||
//.pipe(options.skipEOL ? es.through() : eol)
|
||||
.pipe(filter(indentationFilter))
|
||||
.pipe(indentation)
|
||||
.pipe(filter(copyrightFilter))
|
||||
.pipe(filter(copyrightFilter));
|
||||
// {{SQL CARBON EDIT}}
|
||||
//.pipe(copyrights);
|
||||
// .pipe(copyrights);
|
||||
|
||||
const typescript = result
|
||||
.pipe(filter(tslintFilter))
|
||||
@@ -257,23 +275,52 @@ const hygiene = exports.hygiene = (some, options) => {
|
||||
const javascript = result
|
||||
.pipe(filter(eslintFilter))
|
||||
.pipe(gulpeslint('src/.eslintrc'))
|
||||
.pipe(gulpeslint.formatEach('compact'))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.pipe(gulpeslint.formatEach('compact'));
|
||||
// {{SQL CARBON EDIT}}
|
||||
// .pipe(gulpeslint.failAfterError());
|
||||
|
||||
return es.merge(typescript, javascript)
|
||||
.pipe(es.through(null, function () {
|
||||
// {{SQL CARBON EDIT}}
|
||||
// if (errorCount > 0) {
|
||||
// this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
|
||||
// } else {
|
||||
// this.emit('end');
|
||||
// }
|
||||
this.emit('end');
|
||||
}));
|
||||
};
|
||||
let count = 0;
|
||||
return es.merge(typescript, javascript)
|
||||
.pipe(es.through(function (data) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
this.emit('end');
|
||||
}));
|
||||
}
|
||||
|
||||
gulp.task('hygiene', () => hygiene(''));
|
||||
function createGitIndexVinyls(paths) {
|
||||
const cp = require('child_process');
|
||||
const repositoryPath = process.cwd();
|
||||
|
||||
const fns = paths.map(relativePath => () => new Promise((c, e) => {
|
||||
const fullPath = path.join(repositoryPath, relativePath);
|
||||
|
||||
fs.stat(fullPath, (err, stat) => {
|
||||
if (err && err.code === 'ENOENT') { // ignore deletions
|
||||
return c(null);
|
||||
} else if (err) {
|
||||
return e(err);
|
||||
}
|
||||
|
||||
cp.exec(`git show :${relativePath}`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
|
||||
if (err) {
|
||||
return e(err);
|
||||
}
|
||||
|
||||
c(new VinylFile({
|
||||
path: fullPath,
|
||||
base: repositoryPath,
|
||||
contents: out,
|
||||
stat
|
||||
}));
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
return pall(fns, { concurrency: 4 })
|
||||
.then(r => r.filter(p => !!p));
|
||||
}
|
||||
|
||||
gulp.task('hygiene', () => hygiene());
|
||||
|
||||
// this allows us to run hygiene as a git pre-commit hook
|
||||
if (require.main === module) {
|
||||
@@ -284,22 +331,19 @@ if (require.main === module) {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
cp.exec('git config core.autocrlf', (err, out) => {
|
||||
const skipEOL = out.trim() === 'true';
|
||||
|
||||
if (process.argv.length > 2) {
|
||||
return hygiene(process.argv.slice(2), { skipEOL: skipEOL }).on('error', err => {
|
||||
console.error();
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
if (process.argv.length > 2) {
|
||||
hygiene(process.argv.slice(2)).on('error', err => {
|
||||
console.error();
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
} else {
|
||||
cp.exec('git diff --cached --name-only', { maxBuffer: 2000 * 1024 }, (err, out) => {
|
||||
if (err) {
|
||||
console.error();
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
const some = out
|
||||
@@ -307,12 +351,18 @@ if (require.main === module) {
|
||||
.filter(l => !!l);
|
||||
|
||||
if (some.length > 0) {
|
||||
hygiene(some, { skipEOL: skipEOL }).on('error', err => {
|
||||
console.error();
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
console.log('Reading git index versions...');
|
||||
|
||||
createGitIndexVinyls(some)
|
||||
.then(vinyls => new Promise((c, e) => hygiene(es.readArray(vinyls))
|
||||
.on('end', () => c())
|
||||
.on('error', e)))
|
||||
.catch(err => {
|
||||
console.error();
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,16 @@
|
||||
'use strict';
|
||||
|
||||
const gulp = require('gulp');
|
||||
const json = require('gulp-json-editor');
|
||||
const buffer = require('gulp-buffer');
|
||||
const filter = require('gulp-filter');
|
||||
const es = require('event-stream');
|
||||
const vfs = require('vinyl-fs');
|
||||
const pkg = require('../package.json');
|
||||
const cp = require('child_process');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const jeditor = require('gulp-json-editor');
|
||||
|
||||
@@ -24,13 +34,20 @@ gulp.task('mixin', function () {
|
||||
return;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// {{SQL CARBON EDIT}}
|
||||
let serviceUrl = 'https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery.json';
|
||||
if (quality === 'insider') {
|
||||
serviceUrl = `https://sqlopsextensions.blob.core.windows.net/marketplace/v1/extensionsGallery-${quality}.json`;
|
||||
}
|
||||
let newValues = {
|
||||
"updateUrl": updateUrl,
|
||||
"quality": quality
|
||||
"quality": quality,
|
||||
"extensionsGallery": {
|
||||
"serviceUrl": serviceUrl
|
||||
}
|
||||
};
|
||||
|
||||
return gulp.src('./product.json')
|
||||
.pipe(jeditor(newValues))
|
||||
.pipe(gulp.dest('.'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,14 +13,6 @@ const filter = require('gulp-filter');
|
||||
|
||||
gulp.task('clean-mssql-extension', util.rimraf('extensions/mssql/node_modules'));
|
||||
gulp.task('clean-credentials-extension', util.rimraf('extensions/credentials/node_modules'));
|
||||
gulp.task('clean-extensions-modules', util.rimraf('extensions-modules/node_modules'));
|
||||
gulp.task('clean-protocol', ['clean-extensions-modules', 'clean-mssql-extension', 'clean-credentials-extension', 'clean-client', 'clean-jsonrpc', 'clean-server', 'clean-types']);
|
||||
|
||||
// Tasks to clean extensions modules
|
||||
gulp.task('clean-mssql-ext-mod', util.rimraf('extensions/mssql/node_modules/extensions-modules'));
|
||||
gulp.task('clean-credentials-ext-mod', util.rimraf('extensions/credentials/node_modules/extensions-modules'));
|
||||
gulp.task('clean-build-ext-mod', util.rimraf('build/node_modules/extensions-modules'));
|
||||
gulp.task('clean-ext-mod', ['clean-mssql-ext-mod', 'clean-credentials-ext-mod', 'clean-build-ext-mod', 'clean-extensions-modules']);
|
||||
|
||||
gulp.task('fmt', () => formatStagedFiles());
|
||||
const formatFiles = (some) => {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const gulp = require('gulp');
|
||||
const mocha = require('gulp-mocha');
|
||||
|
||||
gulp.task('test', function () {
|
||||
return gulp.src('test/all.js')
|
||||
.pipe(mocha({ ui: 'tdd', delay: true }))
|
||||
.once('end', function () { process.exit(); });
|
||||
});
|
||||
@@ -17,31 +17,35 @@ const vfs = require('vinyl-fs');
|
||||
const rename = require('gulp-rename');
|
||||
const replace = require('gulp-replace');
|
||||
const filter = require('gulp-filter');
|
||||
const buffer = require('gulp-buffer');
|
||||
const json = require('gulp-json-editor');
|
||||
const _ = require('underscore');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const ext = require('./lib/extensions');
|
||||
const buildfile = require('../src/buildfile');
|
||||
const common = require('./lib/optimize');
|
||||
const nlsDev = require('vscode-nls-dev');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const packageJson = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
const crypto = require('crypto');
|
||||
const i18n = require('./lib/i18n');
|
||||
const serviceInstaller = require('../extensions-modules/lib/languageservice/serviceInstallerUtil');
|
||||
// {{SQL CARBON EDIT}}
|
||||
const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
|
||||
const platformInfo = require('service-downloader/out/platform').PlatformInformation;
|
||||
const glob = require('glob');
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
const deps = require('./dependencies');
|
||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||
const createAsar = require('./lib/asar').createAsar;
|
||||
const minimist = require('minimist');
|
||||
const { compileBuildTask } = require('./gulpfile.compile');
|
||||
|
||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||
|
||||
// @ts-ignore
|
||||
// {{SQL CARBON EDIT}}
|
||||
var del = require('del');
|
||||
const extensionsRoot = path.join(root, 'extensions');
|
||||
const extensionsProductionDependencies = deps.getProductionDependencies(extensionsRoot);
|
||||
|
||||
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
|
||||
// {{SQL CARBON EDIT}}
|
||||
const nodeModules = [
|
||||
@@ -56,17 +60,6 @@ const nodeModules = [
|
||||
.concat(baseModules);
|
||||
|
||||
// Build
|
||||
|
||||
const builtInExtensions = [
|
||||
{ name: 'ms-vscode.node-debug', version: '1.19.8' },
|
||||
{ name: 'ms-vscode.node-debug2', version: '1.19.4' }
|
||||
];
|
||||
|
||||
const excludedExtensions = [
|
||||
'vscode-api-tests',
|
||||
'vscode-colorize-tests'
|
||||
];
|
||||
|
||||
const vscodeEntryPoints = _.flatten([
|
||||
buildfile.entrypoint('vs/workbench/workbench.main'),
|
||||
buildfile.base,
|
||||
@@ -77,25 +70,30 @@ const vscodeEntryPoints = _.flatten([
|
||||
const vscodeResources = [
|
||||
'out-build/main.js',
|
||||
'out-build/cli.js',
|
||||
'out-build/driver.js',
|
||||
'out-build/bootstrap.js',
|
||||
'out-build/bootstrap-fork.js',
|
||||
'out-build/bootstrap-amd.js',
|
||||
'out-build/bootstrap-window.js',
|
||||
'out-build/paths.js',
|
||||
'out-build/vs/**/*.{svg,png,cur,html}',
|
||||
'out-build/vs/base/common/performance.js',
|
||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,ps-win.ps1}',
|
||||
'out-build/vs/base/node/languagePacks.js',
|
||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}',
|
||||
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
||||
'out-build/vs/workbench/browser/media/*-theme.css',
|
||||
'out-build/vs/workbench/electron-browser/bootstrap/**',
|
||||
'out-build/vs/workbench/parts/debug/**/*.json',
|
||||
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
||||
'out-build/vs/workbench/parts/html/browser/webview-pre.js',
|
||||
'out-build/vs/workbench/contrib/debug/**/*.json',
|
||||
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
||||
'out-build/vs/workbench/contrib/webview/electron-browser/webview-pre.js',
|
||||
'out-build/vs/**/markdown.css',
|
||||
'out-build/vs/workbench/parts/tasks/**/*.json',
|
||||
'out-build/vs/workbench/parts/terminal/electron-browser/terminalProcess.js',
|
||||
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md',
|
||||
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
||||
'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
|
||||
'out-build/vs/workbench/services/files/**/*.exe',
|
||||
'out-build/vs/workbench/services/files/**/*.md',
|
||||
'out-build/vs/code/electron-browser/sharedProcess.js',
|
||||
'out-build/vs/code/electron-browser/workbench/**',
|
||||
'out-build/vs/code/electron-browser/sharedProcess/sharedProcess.js',
|
||||
'out-build/vs/code/electron-browser/issue/issueReporter.js',
|
||||
'out-build/vs/code/electron-browser/processExplorer/processExplorer.js',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'out-build/sql/workbench/electron-browser/splashscreen/*',
|
||||
'out-build/sql/**/*.{svg,png,cur,html}',
|
||||
@@ -113,8 +111,10 @@ const vscodeResources = [
|
||||
'out-build/sql/parts/grid/views/**/*.html',
|
||||
'out-build/sql/parts/tasks/**/*.html',
|
||||
'out-build/sql/parts/taskHistory/viewlet/media/**',
|
||||
'out-build/sql/parts/jobManagement/common/media/*.svg',
|
||||
'out-build/sql/media/objectTypes/*.svg',
|
||||
'out-build/sql/media/icons/*.svg',
|
||||
'out-build/sql/workbench/parts/notebook/media/**/*.svg',
|
||||
'!**/test/**'
|
||||
];
|
||||
|
||||
@@ -124,65 +124,84 @@ const BUNDLED_FILE_HEADER = [
|
||||
' *--------------------------------------------------------*/'
|
||||
].join('\n');
|
||||
|
||||
var languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'];
|
||||
if (process.env.VSCODE_QUALITY !== 'stable') {
|
||||
languages = languages.concat(['ptb', 'hun', 'trk']); // Add languages requested by the community to non-stable builds
|
||||
}
|
||||
|
||||
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
|
||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
||||
entryPoints: vscodeEntryPoints,
|
||||
otherSources: [],
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
out: 'out-vscode',
|
||||
languages: languages
|
||||
}));
|
||||
const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-vscode'),
|
||||
compileBuildTask
|
||||
),
|
||||
common.optimizeTask({
|
||||
src: 'out-build',
|
||||
entryPoints: vscodeEntryPoints,
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
out: 'out-vscode',
|
||||
bundleInfo: undefined
|
||||
})
|
||||
));
|
||||
|
||||
|
||||
gulp.task('optimize-index-js', ['optimize-vscode'], () => {
|
||||
const fullpath = path.join(process.cwd(), 'out-vscode/vs/workbench/electron-browser/bootstrap/index.js');
|
||||
const contents = fs.readFileSync(fullpath).toString();
|
||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||
fs.writeFileSync(fullpath, newContents);
|
||||
});
|
||||
const optimizeIndexJSTask = task.define('optimize-index-js', task.series(
|
||||
optimizeVSCodeTask,
|
||||
() => {
|
||||
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
||||
const contents = fs.readFileSync(fullpath).toString();
|
||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||
fs.writeFileSync(fullpath, newContents);
|
||||
}
|
||||
));
|
||||
|
||||
const baseUrl = `https://ticino.blob.core.windows.net/sourcemaps/${commit}/core`;
|
||||
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min'));
|
||||
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', baseUrl));
|
||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
const minifyVSCodeTask = task.define('minify-vscode', task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-vscode-min'),
|
||||
optimizeIndexJSTask
|
||||
),
|
||||
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
|
||||
));
|
||||
|
||||
// Package
|
||||
|
||||
// @ts-ignore JSON checking: darwinCredits is optional
|
||||
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
|
||||
|
||||
function darwinBundleDocumentType(extensions, icon) {
|
||||
return {
|
||||
name: product.nameLong + ' document',
|
||||
role: 'Editor',
|
||||
ostypes: ["TEXT", "utxt", "TUTX", "****"],
|
||||
extensions: extensions,
|
||||
iconFile: icon
|
||||
};
|
||||
}
|
||||
|
||||
const config = {
|
||||
version: getElectronVersion(),
|
||||
productAppName: product.nameLong,
|
||||
companyName: 'Microsoft Corporation',
|
||||
copyright: 'Copyright (C) 2017 Microsoft. All rights reserved',
|
||||
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
|
||||
darwinIcon: 'resources/darwin/code.icns',
|
||||
darwinBundleIdentifier: product.darwinBundleIdentifier,
|
||||
darwinApplicationCategoryType: 'public.app-category.developer-tools',
|
||||
darwinHelpBookFolder: 'VS Code HelpBook',
|
||||
darwinHelpBookName: 'VS Code HelpBook',
|
||||
darwinBundleDocumentTypes: [{
|
||||
name: product.nameLong + ' document',
|
||||
role: 'Editor',
|
||||
ostypes: ["TEXT", "utxt", "TUTX", "****"],
|
||||
// {{SQL CARBON EDIT}}
|
||||
extensions: ["csv", "json", "sqlplan", "sql", "xml"],
|
||||
iconFile: 'resources/darwin/code_file.icns'
|
||||
}],
|
||||
darwinBundleDocumentTypes: [
|
||||
// {{SQL CARBON EDIT}} - Remove most document types and replace with ours
|
||||
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], 'resources/darwin/code_file.icns'),
|
||||
],
|
||||
darwinBundleURLTypes: [{
|
||||
role: 'Viewer',
|
||||
name: product.nameLong,
|
||||
urlSchemes: [product.urlProtocol]
|
||||
}],
|
||||
darwinCredits: darwinCreditsTemplate ? new Buffer(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0,
|
||||
darwinForceDarkModeSupport: true,
|
||||
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
|
||||
linuxExecutableName: product.applicationName,
|
||||
winIcon: 'resources/win32/code.ico',
|
||||
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0,
|
||||
repo: product.electronRepository || void 0
|
||||
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
|
||||
|
||||
// @ts-ignore JSON checking: electronRepository is optional
|
||||
repo: product.electronRepository || undefined
|
||||
};
|
||||
|
||||
function getElectron(arch) {
|
||||
@@ -202,11 +221,11 @@ function getElectron(arch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-electron', util.rimraf('.build/electron'));
|
||||
gulp.task('electron', ['clean-electron'], getElectron(process.arch));
|
||||
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32'));
|
||||
gulp.task('electron-x64', ['clean-electron'], getElectron('x64'));
|
||||
|
||||
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
|
||||
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
|
||||
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
|
||||
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
|
||||
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
|
||||
|
||||
/**
|
||||
* Compute checksums for some files.
|
||||
@@ -242,138 +261,145 @@ function computeChecksum(filename) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
function packageTask(platform, arch, opts) {
|
||||
function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const destination = path.join(path.dirname(root), 'sqlops') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
const destination = path.join(path.dirname(root), destinationFolderName);
|
||||
platform = platform || process.platform;
|
||||
|
||||
return () => {
|
||||
const out = opts.minified ? 'out-vscode-min' : 'out-vscode';
|
||||
const out = sourceFolderName;
|
||||
|
||||
const checksums = computeChecksums(out, [
|
||||
'vs/workbench/workbench.main.js',
|
||||
'vs/workbench/workbench.main.css',
|
||||
'vs/workbench/electron-browser/bootstrap/index.html',
|
||||
'vs/workbench/electron-browser/bootstrap/index.js',
|
||||
'vs/workbench/electron-browser/bootstrap/preload.js'
|
||||
'vs/code/electron-browser/workbench/workbench.html',
|
||||
'vs/code/electron-browser/workbench/workbench.js'
|
||||
]);
|
||||
|
||||
const src = gulp.src(out + '/**', { base: '.' })
|
||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); }));
|
||||
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); }))
|
||||
.pipe(util.setExecutableBit(['**/*.sh']))
|
||||
.pipe(filter(['**', '!**/*.js.map']));
|
||||
|
||||
const root = path.resolve(path.join(__dirname, '..'));
|
||||
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name));
|
||||
|
||||
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
|
||||
const nlsFilter = filter('**/*.nls.json', { restore: true });
|
||||
|
||||
return ext.fromLocal(extension.path)
|
||||
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`))
|
||||
// // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
|
||||
.pipe(nlsFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
|
||||
.pipe(nlsFilter.restore);
|
||||
}));
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const extensionDepsSrc = [
|
||||
..._.flatten(extensionsProductionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||
];
|
||||
ext.packageBuiltInExtensions();
|
||||
|
||||
const localExtensionDependencies = gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||
.pipe(filter(['**', '!**/package-lock.json']))
|
||||
.pipe(util.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('dataprotocol-client', ['node_modules/**', 'src/*.js'], undefined))
|
||||
.pipe(util.cleanNodeModule('extensions-modules', ['node_modules/**', 'src/*.js'], undefined))
|
||||
.pipe(util.cleanNodeModule('typescript', ['**/**'], undefined));
|
||||
|
||||
const sources = es.merge(src, localExtensions, localExtensionDependencies)
|
||||
.pipe(util.setExecutableBit(['**/*.sh']))
|
||||
.pipe(filter(['**',
|
||||
'!**/*.js.map',
|
||||
'!extensions/**/node_modules/**/{test, tests}/**',
|
||||
'!extensions/**/node_modules/**/test.js']));
|
||||
const sources = es.merge(src, ext.packageExtensionsStream({
|
||||
sourceMappingURLBase: sourceMappingURLBase
|
||||
}));
|
||||
|
||||
let version = packageJson.version;
|
||||
// @ts-ignore JSON checking: quality is optional
|
||||
const quality = product.quality;
|
||||
|
||||
if (quality && quality !== 'stable') {
|
||||
version += '-' + quality;
|
||||
}
|
||||
|
||||
const name = product.nameShort;
|
||||
// {{SQL CARBON EDIT}}
|
||||
const name = (platform === 'darwin') ? 'Azure Data Studio' : product.nameShort;
|
||||
const packageJsonUpdates = { name, version };
|
||||
|
||||
// for linux url handling
|
||||
if (platform === 'linux') {
|
||||
packageJsonUpdates.desktopName = `${product.applicationName}-url-handler.desktop`;
|
||||
}
|
||||
|
||||
const packageJsonStream = gulp.src(['package.json'], { base: '.' })
|
||||
.pipe(json({ name, version }));
|
||||
.pipe(json(packageJsonUpdates));
|
||||
|
||||
const settingsSearchBuildId = getBuildNumber();
|
||||
const date = new Date().toISOString();
|
||||
const productJsonUpdate = { commit, date, checksums };
|
||||
|
||||
if (shouldSetupSettingsSearch()) {
|
||||
productJsonUpdate.settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||
}
|
||||
|
||||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||
.pipe(json({ commit, date, checksums, settingsSearchBuildId }));
|
||||
.pipe(json(productJsonUpdate));
|
||||
|
||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
|
||||
|
||||
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
|
||||
const license = gulp.src(['LICENSES.chromium.html', product.licenseFileName, 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
|
||||
|
||||
// TODO the API should be copied to `out` during compile, not here
|
||||
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
||||
// {{SQL CARBON EDIT}}
|
||||
const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts'));
|
||||
const dataApi = gulp.src('src/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts'));
|
||||
const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts'));
|
||||
|
||||
const depsSrc = [
|
||||
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||
// @ts-ignore JSON checking: dependencies is optional
|
||||
..._.flatten(Object.keys(product.dependencies || {}).map(d => [`node_modules/${d}/**`, `!node_modules/${d}/**/{test,tests}/**`]))
|
||||
];
|
||||
|
||||
const deps = gulp.src(depsSrc, { base: '.', dot: true })
|
||||
.pipe(filter(['**', '!**/package-lock.json']))
|
||||
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/*.js']))
|
||||
.pipe(util.cleanNodeModule('vscode-sqlite3', ['binding.gyp', 'benchmark/**', 'cloudformation/**', 'deps/**', 'test/**', 'build/**', 'src/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/*.js']))
|
||||
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
|
||||
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js']))
|
||||
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['build/Release/*.node', 'src/index.js']))
|
||||
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
|
||||
|
||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.node', 'build/Release/*.dll', 'build/Release/*.exe']))
|
||||
.pipe(util.cleanNodeModule('chart.js', ['node_modules/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('emmet', ['node_modules/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('pty.js', ['build/**'], ['build/Release/**']))
|
||||
.pipe(util.cleanNodeModule('jquery-ui', ['external/**', 'demos/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
|
||||
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
|
||||
|
||||
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']));
|
||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
||||
.pipe(util.cleanNodeModule('vscode-windows-ca-certs', ['**/*'], ['package.json', '**/*.node']))
|
||||
.pipe(util.cleanNodeModule('node-addon-api', ['**/*']))
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
let copiedModules = gulp.src([
|
||||
'node_modules/jquery/**/*.*',
|
||||
'node_modules/reflect-metadata/**/*.*',
|
||||
'node_modules/slickgrid/**/*.*',
|
||||
'node_modules/underscore/**/*.*',
|
||||
'node_modules/zone.js/**/*.*',
|
||||
'node_modules/chart.js/**/*.*',
|
||||
'node_modules/chartjs-color/**/*.*',
|
||||
'node_modules/chartjs-color-string/**/*.*',
|
||||
'node_modules/color-convert/**/*.*',
|
||||
'node_modules/color-name/**/*.*',
|
||||
'node_modules/moment/**/*.*'
|
||||
], { base: '.', dot: true });
|
||||
|
||||
let all = es.merge(
|
||||
packageJsonStream,
|
||||
productJsonStream,
|
||||
license,
|
||||
watermark,
|
||||
api,
|
||||
// {{SQL CARBON EDIT}}
|
||||
// {{SQL CARBON EDIT}}
|
||||
copiedModules,
|
||||
dataApi,
|
||||
sqlopsAPI,
|
||||
sources,
|
||||
deps
|
||||
);
|
||||
|
||||
if (platform === 'win32') {
|
||||
all = es.merge(all, gulp.src(['resources/win32/code_file.ico', 'resources/win32/code_70x70.png', 'resources/win32/code_150x150.png'], { base: '.' }));
|
||||
all = es.merge(all, gulp.src([
|
||||
// {{SQL CARBON EDIT}} remove unused icons
|
||||
'resources/win32/code_70x70.png',
|
||||
'resources/win32/code_150x150.png'
|
||||
], { base: '.' }));
|
||||
} else if (platform === 'linux') {
|
||||
all = es.merge(all, gulp.src('resources/linux/code.png', { base: '.' }));
|
||||
} else if (platform === 'darwin') {
|
||||
@@ -389,8 +415,10 @@ function packageTask(platform, arch, opts) {
|
||||
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||
|
||||
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
||||
|
||||
if (platform === 'win32') {
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
|
||||
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
||||
.pipe(replace('@@NAME@@', product.nameShort))
|
||||
@@ -398,6 +426,8 @@ function packageTask(platform, arch, opts) {
|
||||
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.sh', { base: 'resources/win32' })
|
||||
.pipe(replace('@@NAME@@', product.nameShort))
|
||||
.pipe(replace('@@COMMIT@@', commit))
|
||||
.pipe(replace('@@APPNAME@@', product.applicationName))
|
||||
.pipe(rename(function (f) { f.basename = product.applicationName; f.extname = ''; })));
|
||||
|
||||
result = es.merge(result, gulp.src('resources/win32/VisualElementsManifest.xml', { base: 'resources/win32' })
|
||||
@@ -408,96 +438,146 @@ function packageTask(platform, arch, opts) {
|
||||
.pipe(rename('bin/' + product.applicationName)));
|
||||
}
|
||||
|
||||
// submit all stats that have been collected
|
||||
// during the build phase
|
||||
if (opts.stats) {
|
||||
result.on('end', () => {
|
||||
const { submitAllStats } = require('./lib/stats');
|
||||
submitAllStats(product, commit).then(() => console.log('Submitted bundle stats!'));
|
||||
});
|
||||
}
|
||||
|
||||
return result.pipe(vfs.dest(destination));
|
||||
};
|
||||
}
|
||||
|
||||
const buildRoot = path.dirname(root);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'sqlops-win32-ia32')));
|
||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'sqlops-win32-x64')));
|
||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'sqlops-darwin')));
|
||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'sqlops-linux-ia32')));
|
||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'sqlops-linux-x64')));
|
||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'sqlops-linux-arm')));
|
||||
const BUILD_TARGETS = [
|
||||
{ platform: 'win32', arch: 'ia32' },
|
||||
{ platform: 'win32', arch: 'x64' },
|
||||
{ platform: 'darwin', arch: null, opts: { stats: true } },
|
||||
{ platform: 'linux', arch: 'ia32' },
|
||||
{ platform: 'linux', arch: 'x64' },
|
||||
{ platform: 'linux', arch: 'arm' },
|
||||
{ platform: 'linux', arch: 'arm64' },
|
||||
];
|
||||
BUILD_TARGETS.forEach(buildTarget => {
|
||||
const dashed = (str) => (str ? `-${str}` : ``);
|
||||
const platform = buildTarget.platform;
|
||||
const arch = buildTarget.arch;
|
||||
const opts = buildTarget.opts;
|
||||
|
||||
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32'));
|
||||
gulp.task('vscode-win32-x64', ['optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
||||
gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin'));
|
||||
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
|
||||
gulp.task('vscode-linux-x64', ['optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
||||
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
|
||||
['', 'min'].forEach(minified => {
|
||||
const sourceFolderName = `out-vscode${dashed(minified)}`;
|
||||
const destinationFolderName = `azuredatastudio${dashed(platform)}${dashed(arch)}`;
|
||||
|
||||
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
|
||||
gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true }));
|
||||
gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true }));
|
||||
gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true }));
|
||||
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
|
||||
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
|
||||
const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
|
||||
task.parallel(
|
||||
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||
),
|
||||
ext.packageExtensionTask('mssql', platform, arch),
|
||||
ext.packageExtensionTask('azurecore', platform, arch),
|
||||
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||
));
|
||||
gulp.task(vscodeTask);
|
||||
});
|
||||
});
|
||||
|
||||
// Transifex Localizations
|
||||
const vscodeLanguages = [
|
||||
'zh-hans',
|
||||
'zh-hant',
|
||||
'ja',
|
||||
'ko',
|
||||
'de',
|
||||
'fr',
|
||||
'es',
|
||||
'ru',
|
||||
'it',
|
||||
'pt-br',
|
||||
'hu',
|
||||
'tr'
|
||||
];
|
||||
const setupDefaultLanguages = [
|
||||
'zh-hans',
|
||||
'zh-hant',
|
||||
'ko'
|
||||
];
|
||||
|
||||
const innoSetupConfig = {
|
||||
'zh-cn': { codePage: 'CP936', defaultInfo: { name: 'Simplified Chinese', id: '$0804', } },
|
||||
'zh-tw': { codePage: 'CP950', defaultInfo: { name: 'Traditional Chinese', id: '$0404' } },
|
||||
'ko': { codePage: 'CP949', defaultInfo: { name: 'Korean', id: '$0412' } },
|
||||
'ja': { codePage: 'CP932' },
|
||||
'de': { codePage: 'CP1252' },
|
||||
'fr': { codePage: 'CP1252' },
|
||||
'es': { codePage: 'CP1252' },
|
||||
'ru': { codePage: 'CP1251' },
|
||||
'it': { codePage: 'CP1252' },
|
||||
'pt-br': { codePage: 'CP1252' },
|
||||
'hu': { codePage: 'CP1250' },
|
||||
'tr': { codePage: 'CP1254' }
|
||||
};
|
||||
|
||||
const apiHostname = process.env.TRANSIFEX_API_URL;
|
||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
|
||||
gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/**/*.nls.json';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
gulp.task(task.define(
|
||||
'vscode-translations-push',
|
||||
task.series(
|
||||
optimizeVSCodeTask,
|
||||
function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.prepareXlfFiles()),
|
||||
gulp.src(pathToSetup).pipe(i18n.prepareXlfFiles()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.prepareXlfFiles('vscode-extensions'))
|
||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||
});
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||
}
|
||||
)
|
||||
));
|
||||
|
||||
gulp.task(task.define(
|
||||
'vscode-translations-export',
|
||||
task.series(
|
||||
optimizeVSCodeTask,
|
||||
function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||
).pipe(vfs.dest('../vscode-translations-export'));
|
||||
}
|
||||
)
|
||||
));
|
||||
|
||||
gulp.task('vscode-translations-pull', function () {
|
||||
return es.merge(
|
||||
i18n.pullXlfFiles('vscode-editor', apiHostname, apiName, apiToken, vscodeLanguages),
|
||||
i18n.pullXlfFiles('vscode-workbench', apiHostname, apiName, apiToken, vscodeLanguages),
|
||||
i18n.pullXlfFiles('vscode-extensions', apiHostname, apiName, apiToken, vscodeLanguages),
|
||||
i18n.pullXlfFiles('vscode-setup', apiHostname, apiName, apiToken, setupDefaultLanguages)
|
||||
).pipe(vfs.dest('../vscode-localization'));
|
||||
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
||||
let includeDefault = !!innoSetupConfig[language.id].defaultInfo;
|
||||
return i18n.pullSetupXlfFiles(apiHostname, apiName, apiToken, language, includeDefault).pipe(vfs.dest(`../vscode-translations-import/${language.id}/setup`));
|
||||
}));
|
||||
});
|
||||
|
||||
gulp.task('vscode-translations-import', function () {
|
||||
return gulp.src('../vscode-localization/**/*.xlf').pipe(i18n.prepareJsonFiles()).pipe(vfs.dest('./i18n'));
|
||||
// {{SQL CARBON EDIT}} - Replace function body with our own
|
||||
[...i18n.defaultLanguages, ...i18n.extraLanguages].forEach(language => {
|
||||
gulp.src(`../vscode-localization/${language.id}/build/*/*.xlf`)
|
||||
.pipe(i18n.prepareI18nFiles())
|
||||
.pipe(vfs.dest(`./i18n/${language.folderName}`));
|
||||
});
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
});
|
||||
|
||||
// Sourcemaps
|
||||
|
||||
gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
|
||||
gulp.task('upload-vscode-sourcemaps', () => {
|
||||
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
||||
.pipe(es.mapSync(f => {
|
||||
f.path = `${f.base}/core/${f.relative}`;
|
||||
return f;
|
||||
}));
|
||||
|
||||
const extensions = gulp.src('extensions/**/out/**/*.map', { base: '.' });
|
||||
const extensionsOut = gulp.src('extensions/**/out/**/*.map', { base: '.' });
|
||||
const extensionsDist = gulp.src('extensions/**/dist/**/*.map', { base: '.' });
|
||||
|
||||
return es.merge(vs, extensions)
|
||||
return es.merge(vs, extensionsOut, extensionsDist)
|
||||
.pipe(es.through(function (data) {
|
||||
// debug
|
||||
console.log('Uploading Sourcemap', data.relative);
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(azure.upload({
|
||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||
@@ -506,114 +586,22 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
|
||||
}));
|
||||
});
|
||||
|
||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
if (!branch.endsWith('/master') && branch.indexOf('/release/') < 0) {
|
||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||
console.error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||
return;
|
||||
}
|
||||
|
||||
const settingsSearchBuildId = getBuildNumber();
|
||||
if (!settingsSearchBuildId) {
|
||||
console.error('Failed to compute build number');
|
||||
return;
|
||||
}
|
||||
|
||||
return gulp.src(allConfigDetailsPath)
|
||||
.pipe(azure.upload({
|
||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||
container: 'configuration',
|
||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||
}));
|
||||
});
|
||||
|
||||
function getBuildNumber() {
|
||||
const previous = getPreviousVersion(packageJson.version);
|
||||
if (!previous) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
const out = cp.execSync(`git rev-list ${previous}..HEAD --count`);
|
||||
const count = parseInt(out.toString());
|
||||
return versionStringToNumber(packageJson.version) * 1e4 + count;
|
||||
} catch (e) {
|
||||
console.error('Could not determine build number: ' + e.toString());
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given 1.17.2, return 1.17.1
|
||||
* 1.18.0 => 1.17.2.
|
||||
* 2.0.0 => 1.18.0 (or the highest 1.x)
|
||||
*/
|
||||
function getPreviousVersion(versionStr) {
|
||||
function tagExists(tagName) {
|
||||
try {
|
||||
cp.execSync(`git rev-parse ${tagName}`, { stdio: 'ignore' });
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getLastTagFromBase(semverArr, componentToTest) {
|
||||
const baseVersion = semverArr.join('.');
|
||||
if (!tagExists(baseVersion)) {
|
||||
console.error('Failed to find tag for base version, ' + baseVersion);
|
||||
return null;
|
||||
}
|
||||
|
||||
let goodTag;
|
||||
do {
|
||||
goodTag = semverArr.join('.');
|
||||
semverArr[componentToTest]++;
|
||||
} while (tagExists(semverArr.join('.')));
|
||||
|
||||
return goodTag;
|
||||
}
|
||||
|
||||
const semverArr = versionStr.split('.');
|
||||
if (semverArr[2] > 0) {
|
||||
semverArr[2]--;
|
||||
return semverArr.join('.');
|
||||
} else if (semverArr[1] > 0) {
|
||||
semverArr[1]--;
|
||||
return getLastTagFromBase(semverArr, 2);
|
||||
} else {
|
||||
semverArr[0]--;
|
||||
return getLastTagFromBase(semverArr, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function versionStringToNumber(versionStr) {
|
||||
const semverRegex = /(\d+)\.(\d+)\.(\d+)/;
|
||||
const match = versionStr.match(semverRegex);
|
||||
if (!match) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||
}
|
||||
|
||||
gulp.task('generate-vscode-configuration', () => {
|
||||
// This task is only run for the MacOS build
|
||||
const generateVSCodeConfigurationTask = task.define('generate-vscode-configuration', () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
||||
if (!buildDir) {
|
||||
return reject(new Error('$AGENT_BUILDDIRECTORY not set'));
|
||||
}
|
||||
|
||||
if (process.env.VSCODE_QUALITY !== 'insider' && process.env.VSCODE_QUALITY !== 'stable') {
|
||||
return resolve();
|
||||
}
|
||||
|
||||
const userDataDir = path.join(os.tmpdir(), 'tmpuserdata');
|
||||
const extensionsDir = path.join(os.tmpdir(), 'tmpextdir');
|
||||
const appPath = path.join(buildDir, 'VSCode-darwin/Visual\\ Studio\\ Code\\ -\\ Insiders.app/Contents/Resources/app/bin/code');
|
||||
const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app';
|
||||
const appPath = path.join(buildDir, `VSCode-darwin/${appName}/Contents/Resources/app/bin/code`);
|
||||
const codeProc = cp.exec(`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`);
|
||||
|
||||
const timer = setTimeout(() => {
|
||||
@@ -633,36 +621,85 @@ gulp.task('generate-vscode-configuration', () => {
|
||||
clearTimeout(timer);
|
||||
reject(err);
|
||||
});
|
||||
}).catch(e => {
|
||||
// Don't fail the build
|
||||
console.error(e.toString());
|
||||
});
|
||||
});
|
||||
|
||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||
gulp.task(task.define(
|
||||
'upload-vscode-configuration',
|
||||
task.series(
|
||||
generateVSCodeConfigurationTask,
|
||||
() => {
|
||||
if (!shouldSetupSettingsSearch()) {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||
}
|
||||
|
||||
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||
if (!settingsSearchBuildId) {
|
||||
throw new Error('Failed to compute build number');
|
||||
}
|
||||
|
||||
return gulp.src(allConfigDetailsPath)
|
||||
.pipe(azure.upload({
|
||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||
container: 'configuration',
|
||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||
}));
|
||||
}
|
||||
)
|
||||
));
|
||||
|
||||
function shouldSetupSettingsSearch() {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
||||
}
|
||||
|
||||
function getSettingsSearchBuildId(packageJson) {
|
||||
try {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
||||
/\/master$/.test(branch) ? 1 :
|
||||
2; // Some unexpected branch
|
||||
|
||||
const out = cp.execSync(`git rev-list HEAD --count`);
|
||||
const count = parseInt(out.toString());
|
||||
|
||||
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
||||
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
||||
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
||||
} catch (e) {
|
||||
throw new Error('Could not determine build number: ' + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// Install service locally before building carbon
|
||||
|
||||
function installService(extObj, path) {
|
||||
var installer = new serviceInstaller.ServiceInstaller(extObj, path);
|
||||
installer.getServiceInstallDirectoryRoot().then(serviceInstallFolder => {
|
||||
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
|
||||
del(serviceInstallFolder + '/*').then(() => {
|
||||
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
|
||||
installer.installService();
|
||||
}, delError => {
|
||||
console.log('failed to delete the install folder error: ' + delError);
|
||||
});
|
||||
}, getFolderPathError => {
|
||||
console.log('failed to call getServiceInstallDirectoryRoot error: ' + getFolderPathError);
|
||||
function installService() {
|
||||
let config = require('../extensions/mssql/src/config.json');
|
||||
return platformInfo.getCurrent().then(p => {
|
||||
let runtime = p.runtimeId;
|
||||
// fix path since it won't be correct
|
||||
config.installDirectory = path.join(__dirname, '../extensions/mssql/src', config.installDirectory);
|
||||
var installer = new serviceDownloader(config);
|
||||
let serviceInstallFolder = installer.getInstallDirectory(runtime);
|
||||
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
|
||||
return del(serviceInstallFolder + '/*').then(() => {
|
||||
console.log('Installing the service. Install folder: ' + serviceInstallFolder);
|
||||
return installer.installService(runtime);
|
||||
}, delError => {
|
||||
console.log('failed to delete the install folder error: ' + delError);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
gulp.task('install-sqltoolsservice', () => {
|
||||
var mssqlExt = require('../extensions/mssql/client/out/models/constants');
|
||||
var extObj = new mssqlExt.Constants();
|
||||
var path = '../extensions/mssql/client/out/config.json';
|
||||
return installService(extObj, path);
|
||||
return installService();
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -12,52 +12,39 @@ const shell = require('gulp-shell');
|
||||
const es = require('event-stream');
|
||||
const vfs = require('vinyl-fs');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const packageJson = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
const rpmDependencies = require('../resources/linux/rpm/dependencies');
|
||||
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
||||
const path = require('path');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
|
||||
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
||||
|
||||
const flatpakManifest = {
|
||||
appId: product.darwinBundleIdentifier, // We need a reverse-url style identifier.
|
||||
sdk: 'org.freedesktop.Sdk',
|
||||
runtime: 'org.freedesktop.Sdk',
|
||||
runtimeVersion: '1.4',
|
||||
base: 'io.atom.electron.BaseApp',
|
||||
baseFlatpakref: 'https://s3-us-west-2.amazonaws.com/electron-flatpak.endlessm.com/electron-base-app-master.flatpakref',
|
||||
command: product.applicationName,
|
||||
symlinks: [
|
||||
['/share/' + product.applicationName + '/bin/' + product.applicationName, '/bin/' + product.applicationName],
|
||||
],
|
||||
finishArgs: [
|
||||
'--share=ipc', '--socket=x11', // Allow showing X11 windows.
|
||||
'--share=network', // Network access (e.g. for installing extension).
|
||||
'--filesystem=host', // Allow access to the whole file system.
|
||||
'--device=dri', // Allow OpenGL rendering.
|
||||
'--filesystem=/tmp', // Needed for Chromium's single instance check.
|
||||
'--socket=pulseaudio', // Some extensions may want to play sounds...
|
||||
'--talk-name=org.freedesktop.Notifications', // ...or pop up notifications.
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
function getDebPackageArch(arch) {
|
||||
return { x64: 'amd64', ia32: 'i386', arm: 'armhf' }[arch];
|
||||
return { x64: 'amd64', ia32: 'i386', arm: 'armhf', arm64: "arm64" }[arch];
|
||||
}
|
||||
|
||||
function prepareDebPackage(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../sqlops-linux-' + arch;
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const debArch = getDebPackageArch(arch);
|
||||
const destination = '.build/linux/deb/' + debArch + '/' + product.applicationName + '-' + debArch;
|
||||
|
||||
return function () {
|
||||
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||
.pipe(rename('usr/share/applications/' + product.applicationName + '.desktop'));
|
||||
|
||||
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
|
||||
.pipe(rename('usr/share/applications/' + product.applicationName + '-url-handler.desktop'));
|
||||
|
||||
const desktops = es.merge(desktop, desktopUrlHandler)
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', product.applicationName))
|
||||
.pipe(rename('usr/share/applications/' + product.applicationName + '.desktop'));
|
||||
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||
|
||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
@@ -66,7 +53,13 @@ function prepareDebPackage(arch) {
|
||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||
|
||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(rename('usr/share/pixmaps/' + product.applicationName + '.png'));
|
||||
.pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||
|
||||
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||
// .pipe(rename('usr/share/bash-completion/completions/code'));
|
||||
|
||||
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
|
||||
// .pipe(rename('usr/share/zsh/vendor-completions/_code'));
|
||||
|
||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||
@@ -96,11 +89,13 @@ function prepareDebPackage(arch) {
|
||||
const postinst = gulp.src('resources/linux/debian/postinst.template', { base: '.' })
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ARCHITECTURE@@', debArch))
|
||||
// @ts-ignore JSON checking: quality is optional
|
||||
.pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
|
||||
// @ts-ignore JSON checking: updateUrl is optional
|
||||
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
|
||||
.pipe(rename('DEBIAN/postinst'));
|
||||
|
||||
const all = es.merge(control, postinst, postrm, prerm, desktop, appdata, icon, code);
|
||||
const all = es.merge(control, postinst, postrm, prerm, desktops, appdata, icon, /* bash_completion, zsh_completion, */ code);
|
||||
|
||||
return all.pipe(vfs.dest(destination));
|
||||
};
|
||||
@@ -111,8 +106,7 @@ function buildDebPackage(arch) {
|
||||
return shell.task([
|
||||
'chmod 755 ' + product.applicationName + '-' + debArch + '/DEBIAN/postinst ' + product.applicationName + '-' + debArch + '/DEBIAN/prerm ' + product.applicationName + '-' + debArch + '/DEBIAN/postrm',
|
||||
'mkdir -p deb',
|
||||
'fakeroot dpkg-deb -b ' + product.applicationName + '-' + debArch + ' deb',
|
||||
'dpkg-scanpackages deb /dev/null > Packages'
|
||||
'fakeroot dpkg-deb -b ' + product.applicationName + '-' + debArch + ' deb'
|
||||
], { cwd: '.build/linux/deb/' + debArch });
|
||||
}
|
||||
|
||||
@@ -121,21 +115,27 @@ function getRpmBuildPath(rpmArch) {
|
||||
}
|
||||
|
||||
function getRpmPackageArch(arch) {
|
||||
return { x64: 'x86_64', ia32: 'i386', arm: 'armhf' }[arch];
|
||||
return { x64: 'x86_64', ia32: 'i386', arm: 'armhf', arm64: "arm64" }[arch];
|
||||
}
|
||||
|
||||
function prepareRpmPackage(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../sqlops-linux-' + arch;
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const rpmArch = getRpmPackageArch(arch);
|
||||
|
||||
return function () {
|
||||
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||
.pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '.desktop'));
|
||||
|
||||
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
|
||||
.pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '-url-handler.desktop'));
|
||||
|
||||
const desktops = es.merge(desktop, desktopUrlHandler)
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', product.applicationName))
|
||||
.pipe(rename('BUILD/usr/share/applications/' + product.applicationName + '.desktop'));
|
||||
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||
|
||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
@@ -144,7 +144,13 @@ function prepareRpmPackage(arch) {
|
||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||
|
||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.applicationName + '.png'));
|
||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||
|
||||
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
|
||||
|
||||
// const zsh_completion = gulp.src('resources/completions/zsh/_code')
|
||||
// .pipe(rename('BUILD/usr/share/zsh/site-functions/_code'));
|
||||
|
||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||
.pipe(rename(function (p) { p.dirname = 'BUILD/usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||
@@ -152,11 +158,14 @@ function prepareRpmPackage(arch) {
|
||||
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||
.pipe(replace('@@VERSION@@', packageJson.version))
|
||||
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
||||
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
||||
.pipe(replace('@@LICENSE@@', product.licenseName))
|
||||
// @ts-ignore JSON checking: quality is optional
|
||||
.pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
|
||||
// @ts-ignore JSON checking: updateUrl is optional
|
||||
.pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
|
||||
.pipe(replace('@@DEPENDENCIES@@', rpmDependencies[rpmArch].join(', ')))
|
||||
.pipe(rename('SPECS/' + product.applicationName + '.spec'));
|
||||
@@ -164,7 +173,7 @@ function prepareRpmPackage(arch) {
|
||||
const specIcon = gulp.src('resources/linux/rpm/code.xpm', { base: '.' })
|
||||
.pipe(rename('SOURCES/' + product.applicationName + '.xpm'));
|
||||
|
||||
const all = es.merge(code, desktop, appdata, icon, spec, specIcon);
|
||||
const all = es.merge(code, desktops, appdata, icon, /* bash_completion, zsh_completion, */ spec, specIcon);
|
||||
|
||||
return all.pipe(vfs.dest(getRpmBuildPath(rpmArch)));
|
||||
};
|
||||
@@ -182,37 +191,45 @@ function buildRpmPackage(arch) {
|
||||
'cp "' + rpmOut + '/$(ls ' + rpmOut + ')" ' + destination + '/'
|
||||
]);
|
||||
}
|
||||
|
||||
function getSnapBuildPath(arch) {
|
||||
return `.build/linux/snap/${arch}/${product.applicationName}-${arch}`;
|
||||
}
|
||||
|
||||
function prepareSnapPackage(arch) {
|
||||
const binaryDir = '../VSCode-linux-' + arch;
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const destination = getSnapBuildPath(arch);
|
||||
|
||||
return function () {
|
||||
const desktop = gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
||||
|
||||
const desktopUrlHandler = gulp.src('resources/linux/code-url-handler.desktop', { base: '.' })
|
||||
.pipe(rename(`usr/share/applications/${product.applicationName}-url-handler.desktop`));
|
||||
|
||||
const desktops = es.merge(desktop, desktopUrlHandler)
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`))
|
||||
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
|
||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||
|
||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`));
|
||||
.pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
|
||||
|
||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||
.pipe(rename(function (p) { p.dirname = 'usr/share/' + product.applicationName + '/' + p.dirname; }));
|
||||
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
||||
|
||||
const snapcraft = gulp.src('resources/linux/snap/snapcraft.yaml', { base: '.' })
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@VERSION@@', packageJson.version))
|
||||
.pipe(replace('@@VERSION@@', commit.substr(0, 8)))
|
||||
.pipe(rename('snap/snapcraft.yaml'));
|
||||
|
||||
const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' })
|
||||
.pipe(rename('electron-launch'));
|
||||
|
||||
const all = es.merge(desktop, icon, code, snapcraft, electronLaunch);
|
||||
const all = es.merge(desktops, icon, code, snapcraft, electronLaunch);
|
||||
|
||||
return all.pipe(vfs.dest(destination));
|
||||
};
|
||||
@@ -220,124 +237,39 @@ function prepareSnapPackage(arch) {
|
||||
|
||||
function buildSnapPackage(arch) {
|
||||
const snapBuildPath = getSnapBuildPath(arch);
|
||||
|
||||
return shell.task([
|
||||
`chmod +x ${snapBuildPath}/electron-launch`,
|
||||
`cd ${snapBuildPath} && snapcraft snap`
|
||||
]);
|
||||
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
||||
}
|
||||
|
||||
function getFlatpakArch(arch) {
|
||||
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch];
|
||||
}
|
||||
const BUILD_TARGETS = [
|
||||
{ arch: 'ia32' },
|
||||
{ arch: 'x64' },
|
||||
{ arch: 'arm' },
|
||||
{ arch: 'arm64' },
|
||||
];
|
||||
|
||||
function prepareFlatpak(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../sqlops-linux-' + arch;
|
||||
const flatpakArch = getFlatpakArch(arch);
|
||||
const destination = '.build/linux/flatpak/' + flatpakArch;
|
||||
BUILD_TARGETS.forEach((buildTarget) => {
|
||||
const arch = buildTarget.arch;
|
||||
|
||||
return function () {
|
||||
// This is not imported in the global scope to avoid requiring ImageMagick
|
||||
// (or GraphicsMagick) when not building building Flatpak bundles.
|
||||
const imgResize = require('gulp-image-resize');
|
||||
|
||||
const all = [16, 24, 32, 48, 64, 128, 192, 256, 512].map(function (size) {
|
||||
return gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(imgResize({ width: size, height: size, format: "png", noProfile: true }))
|
||||
.pipe(rename('share/icons/hicolor/' + size + 'x' + size + '/apps/' + flatpakManifest.appId + '.png'));
|
||||
});
|
||||
|
||||
all.push(gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||
.pipe(replace('Exec=/usr/share/@@NAME@@/@@NAME@@', 'Exec=' + product.applicationName))
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(rename('share/applications/' + flatpakManifest.appId + '.desktop')));
|
||||
|
||||
all.push(gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME@@', flatpakManifest.appId))
|
||||
.pipe(replace('@@LICENSE@@', product.licenseName))
|
||||
.pipe(rename('share/appdata/' + flatpakManifest.appId + '.appdata.xml')));
|
||||
|
||||
all.push(gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||
.pipe(rename(function (p) {
|
||||
p.dirname = 'share/' + product.applicationName + '/' + p.dirname;
|
||||
})));
|
||||
|
||||
return es.merge(all).pipe(vfs.dest(destination));
|
||||
};
|
||||
}
|
||||
|
||||
function buildFlatpak(arch) {
|
||||
const flatpakArch = getFlatpakArch(arch);
|
||||
const manifest = {};
|
||||
for (var k in flatpakManifest) {
|
||||
manifest[k] = flatpakManifest[k];
|
||||
{
|
||||
const debArch = getDebPackageArch(arch);
|
||||
const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
|
||||
// gulp.task(prepareDebTask);
|
||||
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
|
||||
gulp.task(buildDebTask);
|
||||
}
|
||||
manifest.files = [
|
||||
['.build/linux/flatpak/' + flatpakArch, '/'],
|
||||
];
|
||||
const buildOptions = {
|
||||
arch: flatpakArch,
|
||||
subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision,
|
||||
};
|
||||
// If requested, use the configured path for the OSTree repository.
|
||||
if (process.env.FLATPAK_REPO) {
|
||||
buildOptions.repoDir = process.env.FLATPAK_REPO;
|
||||
} else {
|
||||
buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak';
|
||||
|
||||
{
|
||||
const rpmArch = getRpmPackageArch(arch);
|
||||
const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
|
||||
// gulp.task(prepareRpmTask);
|
||||
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
|
||||
gulp.task(buildRpmTask);
|
||||
}
|
||||
// Setup PGP signing if requested.
|
||||
if (process.env.GPG_KEY_ID !== undefined) {
|
||||
buildOptions.gpgSign = process.env.GPG_KEY_ID;
|
||||
if (process.env.GPG_HOMEDIR) {
|
||||
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR;
|
||||
}
|
||||
|
||||
{
|
||||
const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
|
||||
gulp.task(prepareSnapTask);
|
||||
const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
|
||||
gulp.task(buildSnapTask);
|
||||
}
|
||||
return function (cb) {
|
||||
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386'));
|
||||
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64'));
|
||||
gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
|
||||
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
|
||||
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
|
||||
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
|
||||
gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
gulp.task('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386'));
|
||||
gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64'));
|
||||
gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm'));
|
||||
gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm'));
|
||||
gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
|
||||
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-flatpak', ['clean-vscode-linux-ia32-flatpak'], prepareFlatpak('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-flatpak', ['clean-vscode-linux-x64-flatpak'], prepareFlatpak('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-flatpak', ['clean-vscode-linux-arm-flatpak'], prepareFlatpak('arm'));
|
||||
gulp.task('vscode-linux-ia32-flatpak', ['vscode-linux-ia32-prepare-flatpak'], buildFlatpak('ia32'));
|
||||
gulp.task('vscode-linux-x64-flatpak', ['vscode-linux-x64-prepare-flatpak'], buildFlatpak('x64'));
|
||||
gulp.task('vscode-linux-arm-flatpak', ['vscode-linux-arm-prepare-flatpak'], buildFlatpak('arm'));
|
||||
});
|
||||
|
||||
@@ -7,42 +7,76 @@
|
||||
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const assert = require('assert');
|
||||
const cp = require('child_process');
|
||||
const _7z = require('7zip')['7z'];
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const pkg = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
const vfs = require('vinyl-fs');
|
||||
const rcedit = require('rcedit');
|
||||
const mkdirp = require('mkdirp');
|
||||
|
||||
const repoPath = path.dirname(__dirname);
|
||||
// {{SQL CARBON EDIT}}
|
||||
const buildPath = arch => path.join(path.dirname(repoPath), `sqlops-win32-${arch}`);
|
||||
const buildPath = arch => path.join(path.dirname(repoPath), `azuredatastudio-win32-${arch}`);
|
||||
const zipDir = arch => path.join(repoPath, '.build', `win32-${arch}`, 'archive');
|
||||
const zipPath = arch => path.join(zipDir(arch), `VSCode-win32-${arch}.zip`);
|
||||
const setupDir = arch => path.join(repoPath, '.build', `win32-${arch}`, 'setup');
|
||||
const setupDir = (arch, target) => path.join(repoPath, '.build', `win32-${arch}`, `${target}-setup`);
|
||||
const issPath = path.join(__dirname, 'win32', 'code.iss');
|
||||
const innoSetupPath = path.join(path.dirname(path.dirname(require.resolve('innosetup-compiler'))), 'bin', 'ISCC.exe');
|
||||
const signPS1 = path.join(repoPath, 'build', 'azure-pipelines', 'win32', 'sign.ps1');
|
||||
|
||||
function packageInnoSetup(iss, options, cb) {
|
||||
options = options || {};
|
||||
|
||||
const definitions = options.definitions || {};
|
||||
|
||||
if (process.argv.some(arg => arg === '--debug-inno')) {
|
||||
definitions['Debug'] = 'true';
|
||||
}
|
||||
|
||||
if (process.argv.some(arg => arg === '--sign')) {
|
||||
definitions['Sign'] = 'true';
|
||||
}
|
||||
|
||||
const keys = Object.keys(definitions);
|
||||
|
||||
keys.forEach(key => assert(typeof definitions[key] === 'string', `Missing value for '${key}' in Inno Setup package step`));
|
||||
|
||||
const defs = keys.map(key => `/d${key}=${definitions[key]}`);
|
||||
const args = [iss].concat(defs);
|
||||
const args = [
|
||||
iss,
|
||||
...defs
|
||||
//,
|
||||
//`/sesrp=powershell.exe -ExecutionPolicy bypass ${signPS1} $f`
|
||||
];
|
||||
|
||||
cp.spawn(innoSetupPath, args, { stdio: 'inherit' })
|
||||
cp.spawn(innoSetupPath, args, { stdio: ['ignore', 'inherit', 'inherit'] })
|
||||
.on('error', cb)
|
||||
.on('exit', () => cb(null));
|
||||
}
|
||||
|
||||
function buildWin32Setup(arch) {
|
||||
function buildWin32Setup(arch, target) {
|
||||
if (target !== 'system' && target !== 'user') {
|
||||
throw new Error('Invalid setup target');
|
||||
}
|
||||
|
||||
return cb => {
|
||||
const ia32AppId = product.win32AppId;
|
||||
const x64AppId = product.win32x64AppId;
|
||||
const ia32AppId = target === 'system' ? product.win32AppId : product.win32UserAppId;
|
||||
const x64AppId = target === 'system' ? product.win32x64AppId : product.win32x64UserAppId;
|
||||
|
||||
const sourcePath = buildPath(arch);
|
||||
const outputPath = setupDir(arch, target);
|
||||
mkdirp.sync(outputPath);
|
||||
|
||||
const originalProductJsonPath = path.join(sourcePath, 'resources/app/product.json');
|
||||
const productJsonPath = path.join(outputPath, 'product.json');
|
||||
const productJson = JSON.parse(fs.readFileSync(originalProductJsonPath, 'utf8'));
|
||||
productJson['target'] = target;
|
||||
fs.writeFileSync(productJsonPath, JSON.stringify(productJson, undefined, '\t'));
|
||||
|
||||
const definitions = {
|
||||
NameLong: product.nameLong,
|
||||
@@ -50,35 +84,42 @@ function buildWin32Setup(arch) {
|
||||
DirName: product.win32DirName,
|
||||
Version: pkg.version,
|
||||
RawVersion: pkg.version.replace(/-\w+$/, ''),
|
||||
NameVersion: product.win32NameVersion,
|
||||
NameVersion: product.win32NameVersion + (target === 'user' ? ' (User)' : ''),
|
||||
ExeBasename: product.nameShort,
|
||||
RegValueName: product.win32RegValueName,
|
||||
ShellNameShort: product.win32ShellNameShort,
|
||||
AppMutex: product.win32MutexName,
|
||||
Arch: arch,
|
||||
AppId: arch === 'ia32' ? ia32AppId : x64AppId,
|
||||
IncompatibleAppId: arch === 'ia32' ? x64AppId : ia32AppId,
|
||||
IncompatibleTargetAppId: arch === 'ia32' ? product.win32AppId : product.win32x64AppId,
|
||||
IncompatibleArchAppId: arch === 'ia32' ? x64AppId : ia32AppId,
|
||||
AppUserId: product.win32AppUserModelId,
|
||||
ArchitecturesAllowed: arch === 'ia32' ? '' : 'x64',
|
||||
ArchitecturesInstallIn64BitMode: arch === 'ia32' ? '' : 'x64',
|
||||
SourceDir: buildPath(arch),
|
||||
SourceDir: sourcePath,
|
||||
RepoDir: repoPath,
|
||||
OutputDir: setupDir(arch)
|
||||
OutputDir: outputPath,
|
||||
InstallTarget: target,
|
||||
ProductJsonPath: productJsonPath
|
||||
};
|
||||
|
||||
packageInnoSetup(issPath, { definitions }, cb);
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-vscode-win32-ia32-setup', util.rimraf(setupDir('ia32')));
|
||||
gulp.task('vscode-win32-ia32-setup', ['clean-vscode-win32-ia32-setup'], buildWin32Setup('ia32'));
|
||||
function defineWin32SetupTasks(arch, target) {
|
||||
const cleanTask = util.rimraf(setupDir(arch, target));
|
||||
gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
|
||||
}
|
||||
|
||||
gulp.task('clean-vscode-win32-x64-setup', util.rimraf(setupDir('x64')));
|
||||
gulp.task('vscode-win32-x64-setup', ['clean-vscode-win32-x64-setup'], buildWin32Setup('x64'));
|
||||
defineWin32SetupTasks('ia32', 'system');
|
||||
defineWin32SetupTasks('x64', 'system');
|
||||
defineWin32SetupTasks('ia32', 'user');
|
||||
defineWin32SetupTasks('x64', 'user');
|
||||
|
||||
function archiveWin32Setup(arch) {
|
||||
return cb => {
|
||||
const args = ['a', '-tzip', zipPath(arch), '.', '-r'];
|
||||
const args = ['a', '-tzip', zipPath(arch), '-x!CodeSignSummary*.md', '.', '-r'];
|
||||
|
||||
cp.spawn(_7z, args, { stdio: 'inherit', cwd: buildPath(arch) })
|
||||
.on('error', cb)
|
||||
@@ -86,8 +127,22 @@ function archiveWin32Setup(arch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32')));
|
||||
gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32'));
|
||||
gulp.task(task.define('vscode-win32-ia32-archive', task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))));
|
||||
gulp.task(task.define('vscode-win32-x64-archive', task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('x64'))));
|
||||
|
||||
gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
|
||||
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));
|
||||
function copyInnoUpdater(arch) {
|
||||
return () => {
|
||||
return gulp.src('build/win32/{inno_updater.exe,vcruntime140.dll}', { base: 'build/win32' })
|
||||
.pipe(vfs.dest(path.join(buildPath(arch), 'tools')));
|
||||
};
|
||||
}
|
||||
|
||||
function patchInnoUpdater(arch) {
|
||||
return cb => {
|
||||
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
||||
rcedit(path.join(buildPath(arch), 'tools', 'inno_updater.exe'), { icon }, cb);
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))));
|
||||
gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))));
|
||||
15
build/jsconfig.json
Normal file
15
build/jsconfig.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"jsx": "preserve",
|
||||
"checkJs": true
|
||||
},
|
||||
"include": [
|
||||
"**/*.js"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/node_modules/*"
|
||||
]
|
||||
}
|
||||
117
build/lib/asar.js
Normal file
117
build/lib/asar.js
Normal file
@@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const path = require("path");
|
||||
const es = require("event-stream");
|
||||
const pickle = require('chromium-pickle-js');
|
||||
const Filesystem = require('asar/lib/filesystem');
|
||||
const VinylFile = require("vinyl");
|
||||
const minimatch = require("minimatch");
|
||||
function createAsar(folderPath, unpackGlobs, destFilename) {
|
||||
const shouldUnpackFile = (file) => {
|
||||
for (let i = 0; i < unpackGlobs.length; i++) {
|
||||
if (minimatch(file.relative, unpackGlobs[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const filesystem = new Filesystem(folderPath);
|
||||
const out = [];
|
||||
// Keep track of pending inserts
|
||||
let pendingInserts = 0;
|
||||
let onFileInserted = () => { pendingInserts--; };
|
||||
// Do not insert twice the same directory
|
||||
const seenDir = {};
|
||||
const insertDirectoryRecursive = (dir) => {
|
||||
if (seenDir[dir]) {
|
||||
return;
|
||||
}
|
||||
let lastSlash = dir.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = dir.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(dir.substring(0, lastSlash));
|
||||
}
|
||||
seenDir[dir] = true;
|
||||
filesystem.insertDirectory(dir);
|
||||
};
|
||||
const insertDirectoryForFile = (file) => {
|
||||
let lastSlash = file.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = file.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(file.substring(0, lastSlash));
|
||||
}
|
||||
};
|
||||
const insertFile = (relativePath, stat, shouldUnpack) => {
|
||||
insertDirectoryForFile(relativePath);
|
||||
pendingInserts++;
|
||||
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
|
||||
};
|
||||
return es.through(function (file) {
|
||||
if (file.stat.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
if (!file.stat.isFile()) {
|
||||
throw new Error(`unknown item in stream!`);
|
||||
}
|
||||
const shouldUnpack = shouldUnpackFile(file);
|
||||
insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack);
|
||||
if (shouldUnpack) {
|
||||
// The file goes outside of xx.asar, in a folder xx.asar.unpacked
|
||||
const relative = path.relative(folderPath, file.path);
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: path.join(destFilename + '.unpacked', relative),
|
||||
stat: file.stat,
|
||||
contents: file.contents
|
||||
}));
|
||||
}
|
||||
else {
|
||||
// The file goes inside of xx.asar
|
||||
out.push(file.contents);
|
||||
}
|
||||
}, function () {
|
||||
let finish = () => {
|
||||
{
|
||||
const headerPickle = pickle.createEmpty();
|
||||
headerPickle.writeString(JSON.stringify(filesystem.header));
|
||||
const headerBuf = headerPickle.toBuffer();
|
||||
const sizePickle = pickle.createEmpty();
|
||||
sizePickle.writeUInt32(headerBuf.length);
|
||||
const sizeBuf = sizePickle.toBuffer();
|
||||
out.unshift(headerBuf);
|
||||
out.unshift(sizeBuf);
|
||||
}
|
||||
const contents = Buffer.concat(out);
|
||||
out.length = 0;
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: destFilename,
|
||||
contents: contents
|
||||
}));
|
||||
this.queue(null);
|
||||
};
|
||||
// Call finish() only when all file inserts have finished...
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
onFileInserted = () => {
|
||||
pendingInserts--;
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.createAsar = createAsar;
|
||||
131
build/lib/asar.ts
Normal file
131
build/lib/asar.ts
Normal file
@@ -0,0 +1,131 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as es from 'event-stream';
|
||||
const pickle = require('chromium-pickle-js');
|
||||
const Filesystem = require('asar/lib/filesystem');
|
||||
import * as VinylFile from 'vinyl';
|
||||
import * as minimatch from 'minimatch';
|
||||
|
||||
export function createAsar(folderPath: string, unpackGlobs: string[], destFilename: string): NodeJS.ReadWriteStream {
|
||||
|
||||
const shouldUnpackFile = (file: VinylFile): boolean => {
|
||||
for (let i = 0; i < unpackGlobs.length; i++) {
|
||||
if (minimatch(file.relative, unpackGlobs[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const filesystem = new Filesystem(folderPath);
|
||||
const out: Buffer[] = [];
|
||||
|
||||
// Keep track of pending inserts
|
||||
let pendingInserts = 0;
|
||||
let onFileInserted = () => { pendingInserts--; };
|
||||
|
||||
// Do not insert twice the same directory
|
||||
const seenDir: { [key: string]: boolean; } = {};
|
||||
const insertDirectoryRecursive = (dir: string) => {
|
||||
if (seenDir[dir]) {
|
||||
return;
|
||||
}
|
||||
|
||||
let lastSlash = dir.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = dir.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(dir.substring(0, lastSlash));
|
||||
}
|
||||
seenDir[dir] = true;
|
||||
filesystem.insertDirectory(dir);
|
||||
};
|
||||
|
||||
const insertDirectoryForFile = (file: string) => {
|
||||
let lastSlash = file.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = file.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(file.substring(0, lastSlash));
|
||||
}
|
||||
};
|
||||
|
||||
const insertFile = (relativePath: string, stat: { size: number; mode: number; }, shouldUnpack: boolean) => {
|
||||
insertDirectoryForFile(relativePath);
|
||||
pendingInserts++;
|
||||
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
|
||||
};
|
||||
|
||||
return es.through(function (file) {
|
||||
if (file.stat.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
if (!file.stat.isFile()) {
|
||||
throw new Error(`unknown item in stream!`);
|
||||
}
|
||||
const shouldUnpack = shouldUnpackFile(file);
|
||||
insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack);
|
||||
|
||||
if (shouldUnpack) {
|
||||
// The file goes outside of xx.asar, in a folder xx.asar.unpacked
|
||||
const relative = path.relative(folderPath, file.path);
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: path.join(destFilename + '.unpacked', relative),
|
||||
stat: file.stat,
|
||||
contents: file.contents
|
||||
}));
|
||||
} else {
|
||||
// The file goes inside of xx.asar
|
||||
out.push(file.contents);
|
||||
}
|
||||
}, function () {
|
||||
|
||||
let finish = () => {
|
||||
{
|
||||
const headerPickle = pickle.createEmpty();
|
||||
headerPickle.writeString(JSON.stringify(filesystem.header));
|
||||
const headerBuf = headerPickle.toBuffer();
|
||||
|
||||
const sizePickle = pickle.createEmpty();
|
||||
sizePickle.writeUInt32(headerBuf.length);
|
||||
const sizeBuf = sizePickle.toBuffer();
|
||||
|
||||
out.unshift(headerBuf);
|
||||
out.unshift(sizeBuf);
|
||||
}
|
||||
|
||||
const contents = Buffer.concat(out);
|
||||
out.length = 0;
|
||||
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: destFilename,
|
||||
contents: contents
|
||||
}));
|
||||
this.queue(null);
|
||||
};
|
||||
|
||||
// Call finish() only when all file inserts have finished...
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
} else {
|
||||
onFileInserted = () => {
|
||||
pendingInserts--;
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
122
build/lib/builtInExtensions.js
Normal file
122
build/lib/builtInExtensions.js
Normal file
@@ -0,0 +1,122 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const mkdirp = require('mkdirp');
|
||||
const rimraf = require('rimraf');
|
||||
const es = require('event-stream');
|
||||
const rename = require('gulp-rename');
|
||||
const vfs = require('vinyl-fs');
|
||||
const ext = require('./extensions');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const builtInExtensions = require('../builtInExtensions.json');
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
|
||||
function getExtensionPath(extension) {
|
||||
return path.join(root, '.build', 'builtInExtensions', extension.name);
|
||||
}
|
||||
|
||||
function isUpToDate(extension) {
|
||||
const packagePath = path.join(getExtensionPath(extension), 'package.json');
|
||||
|
||||
if (!fs.existsSync(packagePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const packageContents = fs.readFileSync(packagePath, { encoding: 'utf8' });
|
||||
|
||||
try {
|
||||
const diskVersion = JSON.parse(packageContents).version;
|
||||
return (diskVersion === extension.version);
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function syncMarketplaceExtension(extension) {
|
||||
if (isUpToDate(extension)) {
|
||||
fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
|
||||
return es.readArray([]);
|
||||
}
|
||||
|
||||
rimraf.sync(getExtensionPath(extension));
|
||||
|
||||
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
||||
.pipe(vfs.dest('.build/builtInExtensions'))
|
||||
.on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
|
||||
}
|
||||
|
||||
function syncExtension(extension, controlState) {
|
||||
switch (controlState) {
|
||||
case 'disabled':
|
||||
fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
|
||||
return es.readArray([]);
|
||||
|
||||
case 'marketplace':
|
||||
return syncMarketplaceExtension(extension);
|
||||
|
||||
default:
|
||||
if (!fs.existsSync(controlState)) {
|
||||
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
||||
return es.readArray([]);
|
||||
|
||||
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
||||
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
||||
return es.readArray([]);
|
||||
}
|
||||
|
||||
fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
|
||||
return es.readArray([]);
|
||||
}
|
||||
}
|
||||
|
||||
function readControlFile() {
|
||||
try {
|
||||
return JSON.parse(fs.readFileSync(controlFilePath, 'utf8'));
|
||||
} catch (err) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function writeControlFile(control) {
|
||||
mkdirp.sync(path.dirname(controlFilePath));
|
||||
fs.writeFileSync(controlFilePath, JSON.stringify(control, null, 2));
|
||||
}
|
||||
|
||||
function main() {
|
||||
fancyLog('Syncronizing built-in extensions...');
|
||||
fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
|
||||
|
||||
const control = readControlFile();
|
||||
const streams = [];
|
||||
|
||||
for (const extension of builtInExtensions) {
|
||||
let controlState = control[extension.name] || 'marketplace';
|
||||
control[extension.name] = controlState;
|
||||
|
||||
streams.push(syncExtension(extension, controlState));
|
||||
}
|
||||
|
||||
writeControlFile(control);
|
||||
|
||||
es.merge(streams)
|
||||
.on('error', err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
})
|
||||
.on('end', () => {
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -4,19 +4,19 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var vm = require("vm");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const vm = require("vm");
|
||||
/**
|
||||
* Bundle `entryPoints` given config `config`.
|
||||
*/
|
||||
function bundle(entryPoints, config, callback) {
|
||||
var entryPointsMap = {};
|
||||
entryPoints.forEach(function (module) {
|
||||
const entryPointsMap = {};
|
||||
entryPoints.forEach((module) => {
|
||||
entryPointsMap[module.name] = module;
|
||||
});
|
||||
var allMentionedModulesMap = {};
|
||||
entryPoints.forEach(function (module) {
|
||||
const allMentionedModulesMap = {};
|
||||
entryPoints.forEach((module) => {
|
||||
allMentionedModulesMap[module.name] = true;
|
||||
(module.include || []).forEach(function (includedModule) {
|
||||
allMentionedModulesMap[includedModule] = true;
|
||||
@@ -25,26 +25,30 @@ function bundle(entryPoints, config, callback) {
|
||||
allMentionedModulesMap[excludedModule] = true;
|
||||
});
|
||||
});
|
||||
var code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js'));
|
||||
var r = vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});');
|
||||
var loaderModule = { exports: {} };
|
||||
const code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js'));
|
||||
const r = vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});');
|
||||
const loaderModule = { exports: {} };
|
||||
r.call({}, require, loaderModule, loaderModule.exports);
|
||||
var loader = loaderModule.exports;
|
||||
const loader = loaderModule.exports;
|
||||
config.isBuild = true;
|
||||
config.paths = config.paths || {};
|
||||
config.paths['vs/nls'] = 'out-build/vs/nls.build';
|
||||
config.paths['vs/css'] = 'out-build/vs/css.build';
|
||||
if (!config.paths['vs/nls']) {
|
||||
config.paths['vs/nls'] = 'out-build/vs/nls.build';
|
||||
}
|
||||
if (!config.paths['vs/css']) {
|
||||
config.paths['vs/css'] = 'out-build/vs/css.build';
|
||||
}
|
||||
loader.config(config);
|
||||
loader(['require'], function (localRequire) {
|
||||
var resolvePath = function (path) {
|
||||
var r = localRequire.toUrl(path);
|
||||
loader(['require'], (localRequire) => {
|
||||
const resolvePath = (path) => {
|
||||
const r = localRequire.toUrl(path);
|
||||
if (!/\.js/.test(r)) {
|
||||
return r + '.js';
|
||||
}
|
||||
return r;
|
||||
};
|
||||
for (var moduleId in entryPointsMap) {
|
||||
var entryPoint = entryPointsMap[moduleId];
|
||||
for (const moduleId in entryPointsMap) {
|
||||
const entryPoint = entryPointsMap[moduleId];
|
||||
if (entryPoint.append) {
|
||||
entryPoint.append = entryPoint.append.map(resolvePath);
|
||||
}
|
||||
@@ -53,59 +57,59 @@ function bundle(entryPoints, config, callback) {
|
||||
}
|
||||
}
|
||||
});
|
||||
loader(Object.keys(allMentionedModulesMap), function () {
|
||||
var modules = loader.getBuildInfo();
|
||||
var partialResult = emitEntryPoints(modules, entryPointsMap);
|
||||
var cssInlinedResources = loader('vs/css').getInlinedResources();
|
||||
loader(Object.keys(allMentionedModulesMap), () => {
|
||||
const modules = loader.getBuildInfo();
|
||||
const partialResult = emitEntryPoints(modules, entryPointsMap);
|
||||
const cssInlinedResources = loader('vs/css').getInlinedResources();
|
||||
callback(null, {
|
||||
files: partialResult.files,
|
||||
cssInlinedResources: cssInlinedResources,
|
||||
bundleData: partialResult.bundleData
|
||||
});
|
||||
}, function (err) { return callback(err, null); });
|
||||
}, (err) => callback(err, null));
|
||||
}
|
||||
exports.bundle = bundle;
|
||||
function emitEntryPoints(modules, entryPoints) {
|
||||
var modulesMap = {};
|
||||
modules.forEach(function (m) {
|
||||
const modulesMap = {};
|
||||
modules.forEach((m) => {
|
||||
modulesMap[m.id] = m;
|
||||
});
|
||||
var modulesGraph = {};
|
||||
modules.forEach(function (m) {
|
||||
const modulesGraph = {};
|
||||
modules.forEach((m) => {
|
||||
modulesGraph[m.id] = m.dependencies;
|
||||
});
|
||||
var sortedModules = topologicalSort(modulesGraph);
|
||||
var result = [];
|
||||
var usedPlugins = {};
|
||||
var bundleData = {
|
||||
const sortedModules = topologicalSort(modulesGraph);
|
||||
let result = [];
|
||||
const usedPlugins = {};
|
||||
const bundleData = {
|
||||
graph: modulesGraph,
|
||||
bundles: {}
|
||||
};
|
||||
Object.keys(entryPoints).forEach(function (moduleToBundle) {
|
||||
var info = entryPoints[moduleToBundle];
|
||||
var rootNodes = [moduleToBundle].concat(info.include || []);
|
||||
var allDependencies = visit(rootNodes, modulesGraph);
|
||||
var excludes = ['require', 'exports', 'module'].concat(info.exclude || []);
|
||||
excludes.forEach(function (excludeRoot) {
|
||||
var allExcludes = visit([excludeRoot], modulesGraph);
|
||||
Object.keys(allExcludes).forEach(function (exclude) {
|
||||
Object.keys(entryPoints).forEach((moduleToBundle) => {
|
||||
const info = entryPoints[moduleToBundle];
|
||||
const rootNodes = [moduleToBundle].concat(info.include || []);
|
||||
const allDependencies = visit(rootNodes, modulesGraph);
|
||||
const excludes = ['require', 'exports', 'module'].concat(info.exclude || []);
|
||||
excludes.forEach((excludeRoot) => {
|
||||
const allExcludes = visit([excludeRoot], modulesGraph);
|
||||
Object.keys(allExcludes).forEach((exclude) => {
|
||||
delete allDependencies[exclude];
|
||||
});
|
||||
});
|
||||
var includedModules = sortedModules.filter(function (module) {
|
||||
const includedModules = sortedModules.filter((module) => {
|
||||
return allDependencies[module];
|
||||
});
|
||||
bundleData.bundles[moduleToBundle] = includedModules;
|
||||
var res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend, info.append, info.dest);
|
||||
const res = emitEntryPoint(modulesMap, modulesGraph, moduleToBundle, includedModules, info.prepend || [], info.append || [], info.dest);
|
||||
result = result.concat(res.files);
|
||||
for (var pluginName in res.usedPlugins) {
|
||||
for (const pluginName in res.usedPlugins) {
|
||||
usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName];
|
||||
}
|
||||
});
|
||||
Object.keys(usedPlugins).forEach(function (pluginName) {
|
||||
var plugin = usedPlugins[pluginName];
|
||||
Object.keys(usedPlugins).forEach((pluginName) => {
|
||||
const plugin = usedPlugins[pluginName];
|
||||
if (typeof plugin.finishBuild === 'function') {
|
||||
var write = function (filename, contents) {
|
||||
const write = (filename, contents) => {
|
||||
result.push({
|
||||
dest: filename,
|
||||
sources: [{
|
||||
@@ -124,16 +128,16 @@ function emitEntryPoints(modules, entryPoints) {
|
||||
};
|
||||
}
|
||||
function extractStrings(destFiles) {
|
||||
var parseDefineCall = function (moduleMatch, depsMatch) {
|
||||
var module = moduleMatch.replace(/^"|"$/g, '');
|
||||
var deps = depsMatch.split(',');
|
||||
deps = deps.map(function (dep) {
|
||||
const parseDefineCall = (moduleMatch, depsMatch) => {
|
||||
const module = moduleMatch.replace(/^"|"$/g, '');
|
||||
let deps = depsMatch.split(',');
|
||||
deps = deps.map((dep) => {
|
||||
dep = dep.trim();
|
||||
dep = dep.replace(/^"|"$/g, '');
|
||||
dep = dep.replace(/^'|'$/g, '');
|
||||
var prefix = null;
|
||||
var _path = null;
|
||||
var pieces = dep.split('!');
|
||||
let prefix = null;
|
||||
let _path = null;
|
||||
const pieces = dep.split('!');
|
||||
if (pieces.length > 1) {
|
||||
prefix = pieces[0] + '!';
|
||||
_path = pieces[1];
|
||||
@@ -143,7 +147,7 @@ function extractStrings(destFiles) {
|
||||
_path = pieces[0];
|
||||
}
|
||||
if (/^\.\//.test(_path) || /^\.\.\//.test(_path)) {
|
||||
var res = path.join(path.dirname(module), _path).replace(/\\/g, '/');
|
||||
const res = path.join(path.dirname(module), _path).replace(/\\/g, '/');
|
||||
return prefix + res;
|
||||
}
|
||||
return prefix + _path;
|
||||
@@ -153,7 +157,7 @@ function extractStrings(destFiles) {
|
||||
deps: deps
|
||||
};
|
||||
};
|
||||
destFiles.forEach(function (destFile, index) {
|
||||
destFiles.forEach((destFile) => {
|
||||
if (!/\.js$/.test(destFile.dest)) {
|
||||
return;
|
||||
}
|
||||
@@ -161,44 +165,44 @@ function extractStrings(destFiles) {
|
||||
return;
|
||||
}
|
||||
// Do one pass to record the usage counts for each module id
|
||||
var useCounts = {};
|
||||
destFile.sources.forEach(function (source) {
|
||||
var matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
|
||||
const useCounts = {};
|
||||
destFile.sources.forEach((source) => {
|
||||
const matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
|
||||
if (!matches) {
|
||||
return;
|
||||
}
|
||||
var defineCall = parseDefineCall(matches[1], matches[2]);
|
||||
const defineCall = parseDefineCall(matches[1], matches[2]);
|
||||
useCounts[defineCall.module] = (useCounts[defineCall.module] || 0) + 1;
|
||||
defineCall.deps.forEach(function (dep) {
|
||||
defineCall.deps.forEach((dep) => {
|
||||
useCounts[dep] = (useCounts[dep] || 0) + 1;
|
||||
});
|
||||
});
|
||||
var sortedByUseModules = Object.keys(useCounts);
|
||||
sortedByUseModules.sort(function (a, b) {
|
||||
const sortedByUseModules = Object.keys(useCounts);
|
||||
sortedByUseModules.sort((a, b) => {
|
||||
return useCounts[b] - useCounts[a];
|
||||
});
|
||||
var replacementMap = {};
|
||||
sortedByUseModules.forEach(function (module, index) {
|
||||
const replacementMap = {};
|
||||
sortedByUseModules.forEach((module, index) => {
|
||||
replacementMap[module] = index;
|
||||
});
|
||||
destFile.sources.forEach(function (source) {
|
||||
source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, function (_, moduleMatch, depsMatch) {
|
||||
var defineCall = parseDefineCall(moduleMatch, depsMatch);
|
||||
return "define(__m[" + replacementMap[defineCall.module] + "/*" + defineCall.module + "*/], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep] + '/*' + dep + '*/'; }).join(',') + "])";
|
||||
destFile.sources.forEach((source) => {
|
||||
source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, (_, moduleMatch, depsMatch) => {
|
||||
const defineCall = parseDefineCall(moduleMatch, depsMatch);
|
||||
return `define(__m[${replacementMap[defineCall.module]}/*${defineCall.module}*/], __M([${defineCall.deps.map(dep => replacementMap[dep] + '/*' + dep + '*/').join(',')}])`;
|
||||
});
|
||||
});
|
||||
destFile.sources.unshift({
|
||||
path: null,
|
||||
contents: [
|
||||
'(function() {',
|
||||
"var __m = " + JSON.stringify(sortedByUseModules) + ";",
|
||||
"var __M = function(deps) {",
|
||||
" var result = [];",
|
||||
" for (var i = 0, len = deps.length; i < len; i++) {",
|
||||
" result[i] = __m[deps[i]];",
|
||||
" }",
|
||||
" return result;",
|
||||
"};"
|
||||
`var __m = ${JSON.stringify(sortedByUseModules)};`,
|
||||
`var __M = function(deps) {`,
|
||||
` var result = [];`,
|
||||
` for (var i = 0, len = deps.length; i < len; i++) {`,
|
||||
` result[i] = __m[deps[i]];`,
|
||||
` }`,
|
||||
` return result;`,
|
||||
`};`
|
||||
].join('\n')
|
||||
});
|
||||
destFile.sources.push({
|
||||
@@ -210,22 +214,23 @@ function extractStrings(destFiles) {
|
||||
}
|
||||
function removeDuplicateTSBoilerplate(destFiles) {
|
||||
// Taken from typescript compiler => emitFiles
|
||||
var BOILERPLATE = [
|
||||
const BOILERPLATE = [
|
||||
{ start: /^var __extends/, end: /^}\)\(\);$/ },
|
||||
{ start: /^var __assign/, end: /^};$/ },
|
||||
{ start: /^var __decorate/, end: /^};$/ },
|
||||
{ start: /^var __metadata/, end: /^};$/ },
|
||||
{ start: /^var __param/, end: /^};$/ },
|
||||
{ start: /^var __awaiter/, end: /^};$/ },
|
||||
{ start: /^var __generator/, end: /^};$/ },
|
||||
];
|
||||
destFiles.forEach(function (destFile) {
|
||||
var SEEN_BOILERPLATE = [];
|
||||
destFile.sources.forEach(function (source) {
|
||||
var lines = source.contents.split(/\r\n|\n|\r/);
|
||||
var newLines = [];
|
||||
var IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE;
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var line = lines[i];
|
||||
destFiles.forEach((destFile) => {
|
||||
const SEEN_BOILERPLATE = [];
|
||||
destFile.sources.forEach((source) => {
|
||||
const lines = source.contents.split(/\r\n|\n|\r/);
|
||||
const newLines = [];
|
||||
let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (IS_REMOVING_BOILERPLATE) {
|
||||
newLines.push('');
|
||||
if (END_BOILERPLATE.test(line)) {
|
||||
@@ -233,8 +238,8 @@ function removeDuplicateTSBoilerplate(destFiles) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (var j = 0; j < BOILERPLATE.length; j++) {
|
||||
var boilerplate = BOILERPLATE[j];
|
||||
for (let j = 0; j < BOILERPLATE.length; j++) {
|
||||
const boilerplate = BOILERPLATE[j];
|
||||
if (boilerplate.start.test(line)) {
|
||||
if (SEEN_BOILERPLATE[j]) {
|
||||
IS_REMOVING_BOILERPLATE = true;
|
||||
@@ -262,45 +267,45 @@ function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend,
|
||||
if (!dest) {
|
||||
dest = entryPoint + '.js';
|
||||
}
|
||||
var mainResult = {
|
||||
const mainResult = {
|
||||
sources: [],
|
||||
dest: dest
|
||||
}, results = [mainResult];
|
||||
var usedPlugins = {};
|
||||
var getLoaderPlugin = function (pluginName) {
|
||||
const usedPlugins = {};
|
||||
const getLoaderPlugin = (pluginName) => {
|
||||
if (!usedPlugins[pluginName]) {
|
||||
usedPlugins[pluginName] = modulesMap[pluginName].exports;
|
||||
}
|
||||
return usedPlugins[pluginName];
|
||||
};
|
||||
includedModules.forEach(function (c) {
|
||||
var bangIndex = c.indexOf('!');
|
||||
includedModules.forEach((c) => {
|
||||
const bangIndex = c.indexOf('!');
|
||||
if (bangIndex >= 0) {
|
||||
var pluginName = c.substr(0, bangIndex);
|
||||
var plugin = getLoaderPlugin(pluginName);
|
||||
const pluginName = c.substr(0, bangIndex);
|
||||
const plugin = getLoaderPlugin(pluginName);
|
||||
mainResult.sources.push(emitPlugin(entryPoint, plugin, pluginName, c.substr(bangIndex + 1)));
|
||||
return;
|
||||
}
|
||||
var module = modulesMap[c];
|
||||
const module = modulesMap[c];
|
||||
if (module.path === 'empty:') {
|
||||
return;
|
||||
}
|
||||
var contents = readFileAndRemoveBOM(module.path);
|
||||
const contents = readFileAndRemoveBOM(module.path);
|
||||
if (module.shim) {
|
||||
mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents));
|
||||
}
|
||||
else {
|
||||
mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents));
|
||||
mainResult.sources.push(emitNamedModule(c, module.defineLocation, module.path, contents));
|
||||
}
|
||||
});
|
||||
Object.keys(usedPlugins).forEach(function (pluginName) {
|
||||
var plugin = usedPlugins[pluginName];
|
||||
Object.keys(usedPlugins).forEach((pluginName) => {
|
||||
const plugin = usedPlugins[pluginName];
|
||||
if (typeof plugin.writeFile === 'function') {
|
||||
var req = (function () {
|
||||
const req = (() => {
|
||||
throw new Error('no-no!');
|
||||
});
|
||||
req.toUrl = function (something) { return something; };
|
||||
var write = function (filename, contents) {
|
||||
req.toUrl = something => something;
|
||||
const write = (filename, contents) => {
|
||||
results.push({
|
||||
dest: filename,
|
||||
sources: [{
|
||||
@@ -312,15 +317,15 @@ function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend,
|
||||
plugin.writeFile(pluginName, entryPoint, req, write, {});
|
||||
}
|
||||
});
|
||||
var toIFile = function (path) {
|
||||
var contents = readFileAndRemoveBOM(path);
|
||||
const toIFile = (path) => {
|
||||
const contents = readFileAndRemoveBOM(path);
|
||||
return {
|
||||
path: path,
|
||||
contents: contents
|
||||
};
|
||||
};
|
||||
var toPrepend = (prepend || []).map(toIFile);
|
||||
var toAppend = (append || []).map(toIFile);
|
||||
const toPrepend = (prepend || []).map(toIFile);
|
||||
const toAppend = (append || []).map(toIFile);
|
||||
mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend);
|
||||
return {
|
||||
files: results,
|
||||
@@ -328,8 +333,8 @@ function emitEntryPoint(modulesMap, deps, entryPoint, includedModules, prepend,
|
||||
};
|
||||
}
|
||||
function readFileAndRemoveBOM(path) {
|
||||
var BOM_CHAR_CODE = 65279;
|
||||
var contents = fs.readFileSync(path, 'utf8');
|
||||
const BOM_CHAR_CODE = 65279;
|
||||
let contents = fs.readFileSync(path, 'utf8');
|
||||
// Remove BOM
|
||||
if (contents.charCodeAt(0) === BOM_CHAR_CODE) {
|
||||
contents = contents.substring(1);
|
||||
@@ -337,15 +342,15 @@ function readFileAndRemoveBOM(path) {
|
||||
return contents;
|
||||
}
|
||||
function emitPlugin(entryPoint, plugin, pluginName, moduleName) {
|
||||
var result = '';
|
||||
let result = '';
|
||||
if (typeof plugin.write === 'function') {
|
||||
var write = (function (what) {
|
||||
const write = ((what) => {
|
||||
result += what;
|
||||
});
|
||||
write.getEntryPoint = function () {
|
||||
write.getEntryPoint = () => {
|
||||
return entryPoint;
|
||||
};
|
||||
write.asModule = function (moduleId, code) {
|
||||
write.asModule = (moduleId, code) => {
|
||||
code = code.replace(/^define\(/, 'define("' + moduleId + '",');
|
||||
result += code;
|
||||
};
|
||||
@@ -356,20 +361,20 @@ function emitPlugin(entryPoint, plugin, pluginName, moduleName) {
|
||||
contents: result
|
||||
};
|
||||
}
|
||||
function emitNamedModule(moduleId, myDeps, defineCallPosition, path, contents) {
|
||||
function emitNamedModule(moduleId, defineCallPosition, path, contents) {
|
||||
// `defineCallPosition` is the position in code: |define()
|
||||
var defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col);
|
||||
const defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col);
|
||||
// `parensOffset` is the position in code: define|()
|
||||
var parensOffset = contents.indexOf('(', defineCallOffset);
|
||||
var insertStr = '"' + moduleId + '", ';
|
||||
const parensOffset = contents.indexOf('(', defineCallOffset);
|
||||
const insertStr = '"' + moduleId + '", ';
|
||||
return {
|
||||
path: path,
|
||||
contents: contents.substr(0, parensOffset + 1) + insertStr + contents.substr(parensOffset + 1)
|
||||
};
|
||||
}
|
||||
function emitShimmedModule(moduleId, myDeps, factory, path, contents) {
|
||||
var strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : '');
|
||||
var strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');';
|
||||
const strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : '');
|
||||
const strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');';
|
||||
return {
|
||||
path: path,
|
||||
contents: contents + '\n;\n' + strDefine
|
||||
@@ -382,7 +387,8 @@ function positionToOffset(str, desiredLine, desiredCol) {
|
||||
if (desiredLine === 1) {
|
||||
return desiredCol - 1;
|
||||
}
|
||||
var line = 1, lastNewLineOffset = -1;
|
||||
let line = 1;
|
||||
let lastNewLineOffset = -1;
|
||||
do {
|
||||
if (desiredLine === line) {
|
||||
return lastNewLineOffset + 1 + desiredCol - 1;
|
||||
@@ -396,14 +402,15 @@ function positionToOffset(str, desiredLine, desiredCol) {
|
||||
* Return a set of reachable nodes in `graph` starting from `rootNodes`
|
||||
*/
|
||||
function visit(rootNodes, graph) {
|
||||
var result = {}, queue = rootNodes;
|
||||
rootNodes.forEach(function (node) {
|
||||
const result = {};
|
||||
const queue = rootNodes;
|
||||
rootNodes.forEach((node) => {
|
||||
result[node] = true;
|
||||
});
|
||||
while (queue.length > 0) {
|
||||
var el = queue.shift();
|
||||
var myEdges = graph[el] || [];
|
||||
myEdges.forEach(function (toNode) {
|
||||
const el = queue.shift();
|
||||
const myEdges = graph[el] || [];
|
||||
myEdges.forEach((toNode) => {
|
||||
if (!result[toNode]) {
|
||||
result[toNode] = true;
|
||||
queue.push(toNode);
|
||||
@@ -416,11 +423,11 @@ function visit(rootNodes, graph) {
|
||||
* Perform a topological sort on `graph`
|
||||
*/
|
||||
function topologicalSort(graph) {
|
||||
var allNodes = {}, outgoingEdgeCount = {}, inverseEdges = {};
|
||||
Object.keys(graph).forEach(function (fromNode) {
|
||||
const allNodes = {}, outgoingEdgeCount = {}, inverseEdges = {};
|
||||
Object.keys(graph).forEach((fromNode) => {
|
||||
allNodes[fromNode] = true;
|
||||
outgoingEdgeCount[fromNode] = graph[fromNode].length;
|
||||
graph[fromNode].forEach(function (toNode) {
|
||||
graph[fromNode].forEach((toNode) => {
|
||||
allNodes[toNode] = true;
|
||||
outgoingEdgeCount[toNode] = outgoingEdgeCount[toNode] || 0;
|
||||
inverseEdges[toNode] = inverseEdges[toNode] || [];
|
||||
@@ -428,8 +435,8 @@ function topologicalSort(graph) {
|
||||
});
|
||||
});
|
||||
// https://en.wikipedia.org/wiki/Topological_sorting
|
||||
var S = [], L = [];
|
||||
Object.keys(allNodes).forEach(function (node) {
|
||||
const S = [], L = [];
|
||||
Object.keys(allNodes).forEach((node) => {
|
||||
if (outgoingEdgeCount[node] === 0) {
|
||||
delete outgoingEdgeCount[node];
|
||||
S.push(node);
|
||||
@@ -438,10 +445,10 @@ function topologicalSort(graph) {
|
||||
while (S.length > 0) {
|
||||
// Ensure the exact same order all the time with the same inputs
|
||||
S.sort();
|
||||
var n = S.shift();
|
||||
const n = S.shift();
|
||||
L.push(n);
|
||||
var myInverseEdges = inverseEdges[n] || [];
|
||||
myInverseEdges.forEach(function (m) {
|
||||
const myInverseEdges = inverseEdges[n] || [];
|
||||
myInverseEdges.forEach((m) => {
|
||||
outgoingEdgeCount[m]--;
|
||||
if (outgoingEdgeCount[m] === 0) {
|
||||
delete outgoingEdgeCount[m];
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
import vm = require('vm');
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as vm from 'vm';
|
||||
|
||||
interface IPosition {
|
||||
line: number;
|
||||
@@ -44,11 +44,11 @@ interface ILoaderPluginReqFunc {
|
||||
|
||||
export interface IEntryPoint {
|
||||
name: string;
|
||||
include: string[];
|
||||
exclude: string[];
|
||||
prepend: string[];
|
||||
append: string[];
|
||||
dest: string;
|
||||
include?: string[];
|
||||
exclude?: string[];
|
||||
prepend?: string[];
|
||||
append?: string[];
|
||||
dest?: string;
|
||||
}
|
||||
|
||||
interface IEntryPointMap {
|
||||
@@ -64,7 +64,7 @@ interface INodeSet {
|
||||
}
|
||||
|
||||
export interface IFile {
|
||||
path: string;
|
||||
path: string | null;
|
||||
contents: string;
|
||||
}
|
||||
|
||||
@@ -97,13 +97,13 @@ export interface ILoaderConfig {
|
||||
/**
|
||||
* Bundle `entryPoints` given config `config`.
|
||||
*/
|
||||
export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callback: (err: any, result: IBundleResult) => void): void {
|
||||
let entryPointsMap: IEntryPointMap = {};
|
||||
export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callback: (err: any, result: IBundleResult | null) => void): void {
|
||||
const entryPointsMap: IEntryPointMap = {};
|
||||
entryPoints.forEach((module: IEntryPoint) => {
|
||||
entryPointsMap[module.name] = module;
|
||||
});
|
||||
|
||||
let allMentionedModulesMap: { [modules: string]: boolean; } = {};
|
||||
const allMentionedModulesMap: { [modules: string]: boolean; } = {};
|
||||
entryPoints.forEach((module: IEntryPoint) => {
|
||||
allMentionedModulesMap[module.name] = true;
|
||||
(module.include || []).forEach(function (includedModule) {
|
||||
@@ -115,28 +115,32 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba
|
||||
});
|
||||
|
||||
|
||||
var code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js'));
|
||||
var r: Function = <any>vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});');
|
||||
var loaderModule = { exports: {} };
|
||||
const code = require('fs').readFileSync(path.join(__dirname, '../../src/vs/loader.js'));
|
||||
const r: Function = <any>vm.runInThisContext('(function(require, module, exports) { ' + code + '\n});');
|
||||
const loaderModule = { exports: {} };
|
||||
r.call({}, require, loaderModule, loaderModule.exports);
|
||||
|
||||
var loader: any = loaderModule.exports;
|
||||
const loader: any = loaderModule.exports;
|
||||
config.isBuild = true;
|
||||
config.paths = config.paths || {};
|
||||
config.paths['vs/nls'] = 'out-build/vs/nls.build';
|
||||
config.paths['vs/css'] = 'out-build/vs/css.build';
|
||||
if (!config.paths['vs/nls']) {
|
||||
config.paths['vs/nls'] = 'out-build/vs/nls.build';
|
||||
}
|
||||
if (!config.paths['vs/css']) {
|
||||
config.paths['vs/css'] = 'out-build/vs/css.build';
|
||||
}
|
||||
loader.config(config);
|
||||
|
||||
loader(['require'], (localRequire) => {
|
||||
let resolvePath = (path: string) => {
|
||||
let r = localRequire.toUrl(path);
|
||||
loader(['require'], (localRequire: any) => {
|
||||
const resolvePath = (path: string) => {
|
||||
const r = localRequire.toUrl(path);
|
||||
if (!/\.js/.test(r)) {
|
||||
return r + '.js';
|
||||
}
|
||||
return r;
|
||||
};
|
||||
for (let moduleId in entryPointsMap) {
|
||||
let entryPoint = entryPointsMap[moduleId];
|
||||
for (const moduleId in entryPointsMap) {
|
||||
const entryPoint = entryPointsMap[moduleId];
|
||||
if (entryPoint.append) {
|
||||
entryPoint.append = entryPoint.append.map(resolvePath);
|
||||
}
|
||||
@@ -147,76 +151,76 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba
|
||||
});
|
||||
|
||||
loader(Object.keys(allMentionedModulesMap), () => {
|
||||
let modules = <IBuildModuleInfo[]>loader.getBuildInfo();
|
||||
let partialResult = emitEntryPoints(modules, entryPointsMap);
|
||||
let cssInlinedResources = loader('vs/css').getInlinedResources();
|
||||
const modules = <IBuildModuleInfo[]>loader.getBuildInfo();
|
||||
const partialResult = emitEntryPoints(modules, entryPointsMap);
|
||||
const cssInlinedResources = loader('vs/css').getInlinedResources();
|
||||
callback(null, {
|
||||
files: partialResult.files,
|
||||
cssInlinedResources: cssInlinedResources,
|
||||
bundleData: partialResult.bundleData
|
||||
});
|
||||
}, (err) => callback(err, null));
|
||||
}, (err: any) => callback(err, null));
|
||||
}
|
||||
|
||||
function emitEntryPoints(modules: IBuildModuleInfo[], entryPoints: IEntryPointMap): IPartialBundleResult {
|
||||
let modulesMap: IBuildModuleInfoMap = {};
|
||||
const modulesMap: IBuildModuleInfoMap = {};
|
||||
modules.forEach((m: IBuildModuleInfo) => {
|
||||
modulesMap[m.id] = m;
|
||||
});
|
||||
|
||||
let modulesGraph: IGraph = {};
|
||||
const modulesGraph: IGraph = {};
|
||||
modules.forEach((m: IBuildModuleInfo) => {
|
||||
modulesGraph[m.id] = m.dependencies;
|
||||
});
|
||||
|
||||
let sortedModules = topologicalSort(modulesGraph);
|
||||
const sortedModules = topologicalSort(modulesGraph);
|
||||
|
||||
let result: IConcatFile[] = [];
|
||||
let usedPlugins: IPluginMap = {};
|
||||
let bundleData: IBundleData = {
|
||||
const usedPlugins: IPluginMap = {};
|
||||
const bundleData: IBundleData = {
|
||||
graph: modulesGraph,
|
||||
bundles: {}
|
||||
};
|
||||
|
||||
Object.keys(entryPoints).forEach((moduleToBundle: string) => {
|
||||
let info = entryPoints[moduleToBundle];
|
||||
let rootNodes = [moduleToBundle].concat(info.include || []);
|
||||
let allDependencies = visit(rootNodes, modulesGraph);
|
||||
let excludes: string[] = ['require', 'exports', 'module'].concat(info.exclude || []);
|
||||
const info = entryPoints[moduleToBundle];
|
||||
const rootNodes = [moduleToBundle].concat(info.include || []);
|
||||
const allDependencies = visit(rootNodes, modulesGraph);
|
||||
const excludes: string[] = ['require', 'exports', 'module'].concat(info.exclude || []);
|
||||
|
||||
excludes.forEach((excludeRoot: string) => {
|
||||
let allExcludes = visit([excludeRoot], modulesGraph);
|
||||
const allExcludes = visit([excludeRoot], modulesGraph);
|
||||
Object.keys(allExcludes).forEach((exclude: string) => {
|
||||
delete allDependencies[exclude];
|
||||
});
|
||||
});
|
||||
|
||||
let includedModules = sortedModules.filter((module: string) => {
|
||||
const includedModules = sortedModules.filter((module: string) => {
|
||||
return allDependencies[module];
|
||||
});
|
||||
|
||||
bundleData.bundles[moduleToBundle] = includedModules;
|
||||
|
||||
let res = emitEntryPoint(
|
||||
const res = emitEntryPoint(
|
||||
modulesMap,
|
||||
modulesGraph,
|
||||
moduleToBundle,
|
||||
includedModules,
|
||||
info.prepend,
|
||||
info.append,
|
||||
info.prepend || [],
|
||||
info.append || [],
|
||||
info.dest
|
||||
);
|
||||
|
||||
result = result.concat(res.files);
|
||||
for (let pluginName in res.usedPlugins) {
|
||||
for (const pluginName in res.usedPlugins) {
|
||||
usedPlugins[pluginName] = usedPlugins[pluginName] || res.usedPlugins[pluginName];
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(usedPlugins).forEach((pluginName: string) => {
|
||||
let plugin = usedPlugins[pluginName];
|
||||
const plugin = usedPlugins[pluginName];
|
||||
if (typeof plugin.finishBuild === 'function') {
|
||||
let write = (filename: string, contents: string) => {
|
||||
const write = (filename: string, contents: string) => {
|
||||
result.push({
|
||||
dest: filename,
|
||||
sources: [{
|
||||
@@ -237,16 +241,16 @@ function emitEntryPoints(modules: IBuildModuleInfo[], entryPoints: IEntryPointMa
|
||||
}
|
||||
|
||||
function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
|
||||
let parseDefineCall = (moduleMatch: string, depsMatch: string) => {
|
||||
let module = moduleMatch.replace(/^"|"$/g, '');
|
||||
const parseDefineCall = (moduleMatch: string, depsMatch: string) => {
|
||||
const module = moduleMatch.replace(/^"|"$/g, '');
|
||||
let deps = depsMatch.split(',');
|
||||
deps = deps.map((dep) => {
|
||||
dep = dep.trim();
|
||||
dep = dep.replace(/^"|"$/g, '');
|
||||
dep = dep.replace(/^'|'$/g, '');
|
||||
let prefix: string = null;
|
||||
let _path: string = null;
|
||||
let pieces = dep.split('!');
|
||||
let prefix: string | null = null;
|
||||
let _path: string | null = null;
|
||||
const pieces = dep.split('!');
|
||||
if (pieces.length > 1) {
|
||||
prefix = pieces[0] + '!';
|
||||
_path = pieces[1];
|
||||
@@ -256,7 +260,7 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
|
||||
}
|
||||
|
||||
if (/^\.\//.test(_path) || /^\.\.\//.test(_path)) {
|
||||
let res = path.join(path.dirname(module), _path).replace(/\\/g, '/');
|
||||
const res = path.join(path.dirname(module), _path).replace(/\\/g, '/');
|
||||
return prefix + res;
|
||||
}
|
||||
return prefix + _path;
|
||||
@@ -267,7 +271,7 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
|
||||
};
|
||||
};
|
||||
|
||||
destFiles.forEach((destFile, index) => {
|
||||
destFiles.forEach((destFile) => {
|
||||
if (!/\.js$/.test(destFile.dest)) {
|
||||
return;
|
||||
}
|
||||
@@ -276,33 +280,33 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
|
||||
}
|
||||
|
||||
// Do one pass to record the usage counts for each module id
|
||||
let useCounts: { [moduleId: string]: number; } = {};
|
||||
const useCounts: { [moduleId: string]: number; } = {};
|
||||
destFile.sources.forEach((source) => {
|
||||
let matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
|
||||
const matches = source.contents.match(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/);
|
||||
if (!matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
let defineCall = parseDefineCall(matches[1], matches[2]);
|
||||
const defineCall = parseDefineCall(matches[1], matches[2]);
|
||||
useCounts[defineCall.module] = (useCounts[defineCall.module] || 0) + 1;
|
||||
defineCall.deps.forEach((dep) => {
|
||||
useCounts[dep] = (useCounts[dep] || 0) + 1;
|
||||
});
|
||||
});
|
||||
|
||||
let sortedByUseModules = Object.keys(useCounts);
|
||||
const sortedByUseModules = Object.keys(useCounts);
|
||||
sortedByUseModules.sort((a, b) => {
|
||||
return useCounts[b] - useCounts[a];
|
||||
});
|
||||
|
||||
let replacementMap: { [moduleId: string]: number; } = {};
|
||||
const replacementMap: { [moduleId: string]: number; } = {};
|
||||
sortedByUseModules.forEach((module, index) => {
|
||||
replacementMap[module] = index;
|
||||
});
|
||||
|
||||
destFile.sources.forEach((source) => {
|
||||
source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, (_, moduleMatch, depsMatch) => {
|
||||
let defineCall = parseDefineCall(moduleMatch, depsMatch);
|
||||
const defineCall = parseDefineCall(moduleMatch, depsMatch);
|
||||
return `define(__m[${replacementMap[defineCall.module]}/*${defineCall.module}*/], __M([${defineCall.deps.map(dep => replacementMap[dep] + '/*' + dep + '*/').join(',')}])`;
|
||||
});
|
||||
});
|
||||
@@ -332,32 +336,33 @@ function extractStrings(destFiles: IConcatFile[]): IConcatFile[] {
|
||||
|
||||
function removeDuplicateTSBoilerplate(destFiles: IConcatFile[]): IConcatFile[] {
|
||||
// Taken from typescript compiler => emitFiles
|
||||
let BOILERPLATE = [
|
||||
const BOILERPLATE = [
|
||||
{ start: /^var __extends/, end: /^}\)\(\);$/ },
|
||||
{ start: /^var __assign/, end: /^};$/ },
|
||||
{ start: /^var __decorate/, end: /^};$/ },
|
||||
{ start: /^var __metadata/, end: /^};$/ },
|
||||
{ start: /^var __param/, end: /^};$/ },
|
||||
{ start: /^var __awaiter/, end: /^};$/ },
|
||||
{ start: /^var __generator/, end: /^};$/ },
|
||||
];
|
||||
|
||||
destFiles.forEach((destFile) => {
|
||||
let SEEN_BOILERPLATE = [];
|
||||
const SEEN_BOILERPLATE: boolean[] = [];
|
||||
destFile.sources.forEach((source) => {
|
||||
let lines = source.contents.split(/\r\n|\n|\r/);
|
||||
let newLines: string[] = [];
|
||||
const lines = source.contents.split(/\r\n|\n|\r/);
|
||||
const newLines: string[] = [];
|
||||
let IS_REMOVING_BOILERPLATE = false, END_BOILERPLATE: RegExp;
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i];
|
||||
const line = lines[i];
|
||||
if (IS_REMOVING_BOILERPLATE) {
|
||||
newLines.push('');
|
||||
if (END_BOILERPLATE.test(line)) {
|
||||
if (END_BOILERPLATE!.test(line)) {
|
||||
IS_REMOVING_BOILERPLATE = false;
|
||||
}
|
||||
} else {
|
||||
for (let j = 0; j < BOILERPLATE.length; j++) {
|
||||
let boilerplate = BOILERPLATE[j];
|
||||
const boilerplate = BOILERPLATE[j];
|
||||
if (boilerplate.start.test(line)) {
|
||||
if (SEEN_BOILERPLATE[j]) {
|
||||
IS_REMOVING_BOILERPLATE = true;
|
||||
@@ -397,19 +402,19 @@ function emitEntryPoint(
|
||||
includedModules: string[],
|
||||
prepend: string[],
|
||||
append: string[],
|
||||
dest: string
|
||||
dest: string | undefined
|
||||
): IEmitEntryPointResult {
|
||||
if (!dest) {
|
||||
dest = entryPoint + '.js';
|
||||
}
|
||||
let mainResult: IConcatFile = {
|
||||
const mainResult: IConcatFile = {
|
||||
sources: [],
|
||||
dest: dest
|
||||
},
|
||||
results: IConcatFile[] = [mainResult];
|
||||
|
||||
let usedPlugins: IPluginMap = {};
|
||||
let getLoaderPlugin = (pluginName: string): ILoaderPlugin => {
|
||||
const usedPlugins: IPluginMap = {};
|
||||
const getLoaderPlugin = (pluginName: string): ILoaderPlugin => {
|
||||
if (!usedPlugins[pluginName]) {
|
||||
usedPlugins[pluginName] = modulesMap[pluginName].exports;
|
||||
}
|
||||
@@ -417,39 +422,39 @@ function emitEntryPoint(
|
||||
};
|
||||
|
||||
includedModules.forEach((c: string) => {
|
||||
let bangIndex = c.indexOf('!');
|
||||
const bangIndex = c.indexOf('!');
|
||||
|
||||
if (bangIndex >= 0) {
|
||||
let pluginName = c.substr(0, bangIndex);
|
||||
let plugin = getLoaderPlugin(pluginName);
|
||||
const pluginName = c.substr(0, bangIndex);
|
||||
const plugin = getLoaderPlugin(pluginName);
|
||||
mainResult.sources.push(emitPlugin(entryPoint, plugin, pluginName, c.substr(bangIndex + 1)));
|
||||
return;
|
||||
}
|
||||
|
||||
let module = modulesMap[c];
|
||||
const module = modulesMap[c];
|
||||
|
||||
if (module.path === 'empty:') {
|
||||
return;
|
||||
}
|
||||
|
||||
let contents = readFileAndRemoveBOM(module.path);
|
||||
const contents = readFileAndRemoveBOM(module.path);
|
||||
|
||||
if (module.shim) {
|
||||
mainResult.sources.push(emitShimmedModule(c, deps[c], module.shim, module.path, contents));
|
||||
} else {
|
||||
mainResult.sources.push(emitNamedModule(c, deps[c], module.defineLocation, module.path, contents));
|
||||
mainResult.sources.push(emitNamedModule(c, module.defineLocation, module.path, contents));
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(usedPlugins).forEach((pluginName: string) => {
|
||||
let plugin = usedPlugins[pluginName];
|
||||
const plugin = usedPlugins[pluginName];
|
||||
if (typeof plugin.writeFile === 'function') {
|
||||
let req: ILoaderPluginReqFunc = <any>(() => {
|
||||
const req: ILoaderPluginReqFunc = <any>(() => {
|
||||
throw new Error('no-no!');
|
||||
});
|
||||
req.toUrl = something => something;
|
||||
|
||||
let write = (filename: string, contents: string) => {
|
||||
const write = (filename: string, contents: string) => {
|
||||
results.push({
|
||||
dest: filename,
|
||||
sources: [{
|
||||
@@ -462,16 +467,16 @@ function emitEntryPoint(
|
||||
}
|
||||
});
|
||||
|
||||
let toIFile = (path): IFile => {
|
||||
let contents = readFileAndRemoveBOM(path);
|
||||
const toIFile = (path: string): IFile => {
|
||||
const contents = readFileAndRemoveBOM(path);
|
||||
return {
|
||||
path: path,
|
||||
contents: contents
|
||||
};
|
||||
};
|
||||
|
||||
let toPrepend = (prepend || []).map(toIFile);
|
||||
let toAppend = (append || []).map(toIFile);
|
||||
const toPrepend = (prepend || []).map(toIFile);
|
||||
const toAppend = (append || []).map(toIFile);
|
||||
|
||||
mainResult.sources = toPrepend.concat(mainResult.sources).concat(toAppend);
|
||||
|
||||
@@ -482,8 +487,8 @@ function emitEntryPoint(
|
||||
}
|
||||
|
||||
function readFileAndRemoveBOM(path: string): string {
|
||||
var BOM_CHAR_CODE = 65279;
|
||||
var contents = fs.readFileSync(path, 'utf8');
|
||||
const BOM_CHAR_CODE = 65279;
|
||||
let contents = fs.readFileSync(path, 'utf8');
|
||||
// Remove BOM
|
||||
if (contents.charCodeAt(0) === BOM_CHAR_CODE) {
|
||||
contents = contents.substring(1);
|
||||
@@ -494,7 +499,7 @@ function readFileAndRemoveBOM(path: string): string {
|
||||
function emitPlugin(entryPoint: string, plugin: ILoaderPlugin, pluginName: string, moduleName: string): IFile {
|
||||
let result = '';
|
||||
if (typeof plugin.write === 'function') {
|
||||
let write: ILoaderPluginWriteFunc = <any>((what) => {
|
||||
const write: ILoaderPluginWriteFunc = <any>((what: string) => {
|
||||
result += what;
|
||||
});
|
||||
write.getEntryPoint = () => {
|
||||
@@ -512,15 +517,15 @@ function emitPlugin(entryPoint: string, plugin: ILoaderPlugin, pluginName: strin
|
||||
};
|
||||
}
|
||||
|
||||
function emitNamedModule(moduleId: string, myDeps: string[], defineCallPosition: IPosition, path: string, contents: string): IFile {
|
||||
function emitNamedModule(moduleId: string, defineCallPosition: IPosition, path: string, contents: string): IFile {
|
||||
|
||||
// `defineCallPosition` is the position in code: |define()
|
||||
let defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col);
|
||||
const defineCallOffset = positionToOffset(contents, defineCallPosition.line, defineCallPosition.col);
|
||||
|
||||
// `parensOffset` is the position in code: define|()
|
||||
let parensOffset = contents.indexOf('(', defineCallOffset);
|
||||
const parensOffset = contents.indexOf('(', defineCallOffset);
|
||||
|
||||
let insertStr = '"' + moduleId + '", ';
|
||||
const insertStr = '"' + moduleId + '", ';
|
||||
|
||||
return {
|
||||
path: path,
|
||||
@@ -529,8 +534,8 @@ function emitNamedModule(moduleId: string, myDeps: string[], defineCallPosition:
|
||||
}
|
||||
|
||||
function emitShimmedModule(moduleId: string, myDeps: string[], factory: string, path: string, contents: string): IFile {
|
||||
let strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : '');
|
||||
let strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');';
|
||||
const strDeps = (myDeps.length > 0 ? '"' + myDeps.join('", "') + '"' : '');
|
||||
const strDefine = 'define("' + moduleId + '", [' + strDeps + '], ' + factory + ');';
|
||||
return {
|
||||
path: path,
|
||||
contents: contents + '\n;\n' + strDefine
|
||||
@@ -545,8 +550,8 @@ function positionToOffset(str: string, desiredLine: number, desiredCol: number):
|
||||
return desiredCol - 1;
|
||||
}
|
||||
|
||||
let line = 1,
|
||||
lastNewLineOffset = -1;
|
||||
let line = 1;
|
||||
let lastNewLineOffset = -1;
|
||||
|
||||
do {
|
||||
if (desiredLine === line) {
|
||||
@@ -564,16 +569,16 @@ function positionToOffset(str: string, desiredLine: number, desiredCol: number):
|
||||
* Return a set of reachable nodes in `graph` starting from `rootNodes`
|
||||
*/
|
||||
function visit(rootNodes: string[], graph: IGraph): INodeSet {
|
||||
let result: INodeSet = {},
|
||||
queue = rootNodes;
|
||||
const result: INodeSet = {};
|
||||
const queue = rootNodes;
|
||||
|
||||
rootNodes.forEach((node) => {
|
||||
result[node] = true;
|
||||
});
|
||||
|
||||
while (queue.length > 0) {
|
||||
let el = queue.shift();
|
||||
let myEdges = graph[el] || [];
|
||||
const el = queue.shift();
|
||||
const myEdges = graph[el!] || [];
|
||||
myEdges.forEach((toNode) => {
|
||||
if (!result[toNode]) {
|
||||
result[toNode] = true;
|
||||
@@ -590,7 +595,7 @@ function visit(rootNodes: string[], graph: IGraph): INodeSet {
|
||||
*/
|
||||
function topologicalSort(graph: IGraph): string[] {
|
||||
|
||||
let allNodes: INodeSet = {},
|
||||
const allNodes: INodeSet = {},
|
||||
outgoingEdgeCount: { [node: string]: number; } = {},
|
||||
inverseEdges: IGraph = {};
|
||||
|
||||
@@ -608,7 +613,7 @@ function topologicalSort(graph: IGraph): string[] {
|
||||
});
|
||||
|
||||
// https://en.wikipedia.org/wiki/Topological_sorting
|
||||
let S: string[] = [],
|
||||
const S: string[] = [],
|
||||
L: string[] = [];
|
||||
|
||||
Object.keys(allNodes).forEach((node: string) => {
|
||||
@@ -622,10 +627,10 @@ function topologicalSort(graph: IGraph): string[] {
|
||||
// Ensure the exact same order all the time with the same inputs
|
||||
S.sort();
|
||||
|
||||
let n: string = S.shift();
|
||||
const n: string = S.shift()!;
|
||||
L.push(n);
|
||||
|
||||
let myInverseEdges = inverseEdges[n] || [];
|
||||
const myInverseEdges = inverseEdges[n] || [];
|
||||
myInverseEdges.forEach((m: string) => {
|
||||
outgoingEdgeCount[m]--;
|
||||
if (outgoingEdgeCount[m] === 0) {
|
||||
|
||||
@@ -4,37 +4,54 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var gulp = require("gulp");
|
||||
var tsb = require("gulp-tsb");
|
||||
var es = require("event-stream");
|
||||
var watch = require('./watch');
|
||||
var nls = require("./nls");
|
||||
var util = require("./util");
|
||||
var reporter_1 = require("./reporter");
|
||||
var path = require("path");
|
||||
var bom = require("gulp-bom");
|
||||
var sourcemaps = require("gulp-sourcemaps");
|
||||
var _ = require("underscore");
|
||||
var monacodts = require("../monaco/api");
|
||||
var fs = require("fs");
|
||||
var reporter = reporter_1.createReporter();
|
||||
var rootDir = path.join(__dirname, '../../src');
|
||||
var options = require('../../src/tsconfig.json').compilerOptions;
|
||||
options.verbose = false;
|
||||
options.sourceMap = true;
|
||||
options.rootDir = rootDir;
|
||||
options.sourceRoot = util.toFileUri(rootDir);
|
||||
function createCompile(build, emitError) {
|
||||
var opts = _.clone(options);
|
||||
const es = require("event-stream");
|
||||
const fs = require("fs");
|
||||
const gulp = require("gulp");
|
||||
const bom = require("gulp-bom");
|
||||
const sourcemaps = require("gulp-sourcemaps");
|
||||
const tsb = require("gulp-tsb");
|
||||
const path = require("path");
|
||||
const _ = require("underscore");
|
||||
const monacodts = require("../monaco/api");
|
||||
const nls = require("./nls");
|
||||
const reporter_1 = require("./reporter");
|
||||
const util = require("./util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const watch = require('./watch');
|
||||
const reporter = reporter_1.createReporter();
|
||||
function getTypeScriptCompilerOptions(src) {
|
||||
const rootDir = path.join(__dirname, `../../${src}`);
|
||||
const tsconfig = require(`../../${src}/tsconfig.json`);
|
||||
let options;
|
||||
if (tsconfig.extends) {
|
||||
options = Object.assign({}, require(path.join(rootDir, tsconfig.extends)).compilerOptions, tsconfig.compilerOptions);
|
||||
}
|
||||
else {
|
||||
options = tsconfig.compilerOptions;
|
||||
}
|
||||
options.verbose = false;
|
||||
options.sourceMap = true;
|
||||
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
|
||||
options.sourceMap = false;
|
||||
}
|
||||
options.rootDir = rootDir;
|
||||
options.baseUrl = rootDir;
|
||||
options.sourceRoot = util.toFileUri(rootDir);
|
||||
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF';
|
||||
return options;
|
||||
}
|
||||
function createCompile(src, build, emitError) {
|
||||
const opts = _.clone(getTypeScriptCompilerOptions(src));
|
||||
opts.inlineSources = !!build;
|
||||
opts.noFilesystemLookup = true;
|
||||
var ts = tsb.create(opts, null, null, function (err) { return reporter(err.toString()); });
|
||||
const ts = tsb.create(opts, true, undefined, err => reporter(err.toString()));
|
||||
return function (token) {
|
||||
var utf8Filter = util.filter(function (data) { return /(\/|\\)test(\/|\\).*utf8/.test(data.path); });
|
||||
var tsFilter = util.filter(function (data) { return /\.ts$/.test(data.path); });
|
||||
var noDeclarationsFilter = util.filter(function (data) { return !(/\.d\.ts$/.test(data.path)); });
|
||||
var input = es.through();
|
||||
var output = input
|
||||
const utf8Filter = util.filter(data => /(\/|\\)test(\/|\\).*utf8/.test(data.path));
|
||||
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
|
||||
const noDeclarationsFilter = util.filter(data => !(/\.d\.ts$/.test(data.path)));
|
||||
const input = es.through();
|
||||
const output = input
|
||||
.pipe(utf8Filter)
|
||||
.pipe(bom())
|
||||
.pipe(utf8Filter.restore)
|
||||
@@ -47,124 +64,139 @@ function createCompile(build, emitError) {
|
||||
.pipe(sourcemaps.write('.', {
|
||||
addComment: false,
|
||||
includeContent: !!build,
|
||||
sourceRoot: options.sourceRoot
|
||||
sourceRoot: opts.sourceRoot
|
||||
}))
|
||||
.pipe(tsFilter.restore)
|
||||
.pipe(reporter.end(emitError));
|
||||
.pipe(reporter.end(!!emitError));
|
||||
return es.duplex(input, output);
|
||||
};
|
||||
}
|
||||
function compileTask(out, build) {
|
||||
const typesDts = [
|
||||
'node_modules/typescript/lib/*.d.ts',
|
||||
'node_modules/@types/**/*.d.ts',
|
||||
'!node_modules/@types/webpack/**/*',
|
||||
'!node_modules/@types/uglify-js/**/*',
|
||||
];
|
||||
function compileTask(src, out, build) {
|
||||
return function () {
|
||||
var compile = createCompile(build, true);
|
||||
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'));
|
||||
return src
|
||||
const compile = createCompile(src, build, true);
|
||||
const srcPipe = es.merge(gulp.src(`${src}/**`, { base: `${src}` }), gulp.src(typesDts));
|
||||
let generator = new MonacoGenerator(false);
|
||||
if (src === 'src') {
|
||||
generator.execute();
|
||||
}
|
||||
return srcPipe
|
||||
.pipe(generator.stream)
|
||||
.pipe(compile())
|
||||
.pipe(gulp.dest(out))
|
||||
.pipe(monacodtsTask(out, false));
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
}
|
||||
exports.compileTask = compileTask;
|
||||
function watchTask(out, build) {
|
||||
return function () {
|
||||
var compile = createCompile(build);
|
||||
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'));
|
||||
var watchSrc = watch('src/**', { base: 'src' });
|
||||
const compile = createCompile('src', build);
|
||||
const src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src(typesDts));
|
||||
const watchSrc = watch('src/**', { base: 'src' });
|
||||
let generator = new MonacoGenerator(true);
|
||||
generator.execute();
|
||||
return watchSrc
|
||||
.pipe(generator.stream)
|
||||
.pipe(util.incremental(compile, src, true))
|
||||
.pipe(gulp.dest(out))
|
||||
.pipe(monacodtsTask(out, true));
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
}
|
||||
exports.watchTask = watchTask;
|
||||
function reloadTypeScriptNodeModule() {
|
||||
var util = require('gulp-util');
|
||||
function log(message) {
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
util.log.apply(util, [util.colors.cyan('[memory watch dog]'), message].concat(rest));
|
||||
}
|
||||
function heapUsed() {
|
||||
return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB';
|
||||
}
|
||||
return es.through(function (data) {
|
||||
this.emit('data', data);
|
||||
}, function () {
|
||||
log('memory usage after compilation finished: ' + heapUsed());
|
||||
// It appears we are running into some variant of
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=2073
|
||||
//
|
||||
// Even though all references are dropped, some
|
||||
// optimized methods in the TS compiler end up holding references
|
||||
// to the entire TypeScript language host (>600MB)
|
||||
//
|
||||
// The idea is to force v8 to drop references to these
|
||||
// optimized methods, by "reloading" the typescript node module
|
||||
log('Reloading typescript node module...');
|
||||
var resolvedName = require.resolve('typescript');
|
||||
var originalModule = require.cache[resolvedName];
|
||||
delete require.cache[resolvedName];
|
||||
var newExports = require('typescript');
|
||||
require.cache[resolvedName] = originalModule;
|
||||
for (var prop in newExports) {
|
||||
if (newExports.hasOwnProperty(prop)) {
|
||||
originalModule.exports[prop] = newExports[prop];
|
||||
const REPO_SRC_FOLDER = path.join(__dirname, '../../src');
|
||||
class MonacoGenerator {
|
||||
constructor(isWatch) {
|
||||
this._executeSoonTimer = null;
|
||||
this._isWatch = isWatch;
|
||||
this.stream = es.through();
|
||||
this._watchers = [];
|
||||
this._watchedFiles = {};
|
||||
let onWillReadFile = (moduleId, filePath) => {
|
||||
if (!this._isWatch) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
log('typescript node module reloaded.');
|
||||
this.emit('end');
|
||||
});
|
||||
}
|
||||
function monacodtsTask(out, isWatch) {
|
||||
var neededFiles = {};
|
||||
monacodts.getFilesToWatch(out).forEach(function (filePath) {
|
||||
filePath = path.normalize(filePath);
|
||||
neededFiles[filePath] = true;
|
||||
});
|
||||
var inputFiles = {};
|
||||
for (var filePath in neededFiles) {
|
||||
if (/\bsrc(\/|\\)vs\b/.test(filePath)) {
|
||||
// This file is needed from source => simply read it now
|
||||
inputFiles[filePath] = fs.readFileSync(filePath).toString();
|
||||
if (this._watchedFiles[filePath]) {
|
||||
return;
|
||||
}
|
||||
this._watchedFiles[filePath] = true;
|
||||
const watcher = fs.watch(filePath);
|
||||
watcher.addListener('change', () => {
|
||||
this._declarationResolver.invalidateCache(moduleId);
|
||||
this._executeSoon();
|
||||
});
|
||||
watcher.addListener('error', (err) => {
|
||||
console.error(`Encountered error while watching ${filePath}.`);
|
||||
console.log(err);
|
||||
delete this._watchedFiles[filePath];
|
||||
for (let i = 0; i < this._watchers.length; i++) {
|
||||
if (this._watchers[i] === watcher) {
|
||||
this._watchers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
watcher.close();
|
||||
this._declarationResolver.invalidateCache(moduleId);
|
||||
this._executeSoon();
|
||||
});
|
||||
this._watchers.push(watcher);
|
||||
};
|
||||
this._fsProvider = new class extends monacodts.FSProvider {
|
||||
readFileSync(moduleId, filePath) {
|
||||
onWillReadFile(moduleId, filePath);
|
||||
return super.readFileSync(moduleId, filePath);
|
||||
}
|
||||
};
|
||||
this._declarationResolver = new monacodts.DeclarationResolver(this._fsProvider);
|
||||
if (this._isWatch) {
|
||||
const recipeWatcher = fs.watch(monacodts.RECIPE_PATH);
|
||||
recipeWatcher.addListener('change', () => {
|
||||
this._executeSoon();
|
||||
});
|
||||
this._watchers.push(recipeWatcher);
|
||||
}
|
||||
}
|
||||
var setInputFile = function (filePath, contents) {
|
||||
if (inputFiles[filePath] === contents) {
|
||||
// no change
|
||||
_executeSoon() {
|
||||
if (this._executeSoonTimer !== null) {
|
||||
clearTimeout(this._executeSoonTimer);
|
||||
this._executeSoonTimer = null;
|
||||
}
|
||||
this._executeSoonTimer = setTimeout(() => {
|
||||
this._executeSoonTimer = null;
|
||||
this.execute();
|
||||
}, 20);
|
||||
}
|
||||
dispose() {
|
||||
this._watchers.forEach(watcher => watcher.close());
|
||||
}
|
||||
_run() {
|
||||
let r = monacodts.run3(this._declarationResolver);
|
||||
if (!r && !this._isWatch) {
|
||||
// The build must always be able to generate the monaco.d.ts
|
||||
throw new Error(`monaco.d.ts generation error - Cannot continue`);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
_log(message, ...rest) {
|
||||
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
}
|
||||
execute() {
|
||||
const startTime = Date.now();
|
||||
const result = this._run();
|
||||
if (!result) {
|
||||
// nothing really changed
|
||||
return;
|
||||
}
|
||||
inputFiles[filePath] = contents;
|
||||
var neededInputFilesCount = Object.keys(neededFiles).length;
|
||||
var availableInputFilesCount = Object.keys(inputFiles).length;
|
||||
if (neededInputFilesCount === availableInputFilesCount) {
|
||||
run();
|
||||
if (result.isTheSame) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
var run = function () {
|
||||
var result = monacodts.run(out, inputFiles);
|
||||
if (!result.isTheSame) {
|
||||
if (isWatch) {
|
||||
fs.writeFileSync(result.filePath, result.content);
|
||||
}
|
||||
else {
|
||||
resultStream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.');
|
||||
}
|
||||
fs.writeFileSync(result.filePath, result.content);
|
||||
fs.writeFileSync(path.join(REPO_SRC_FOLDER, 'vs/editor/common/standalone/standaloneEnums.ts'), result.enums);
|
||||
this._log(`monaco.d.ts is changed - total time took ${Date.now() - startTime} ms`);
|
||||
if (!this._isWatch) {
|
||||
this.stream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.');
|
||||
}
|
||||
};
|
||||
var resultStream;
|
||||
if (isWatch) {
|
||||
watch('build/monaco/*').pipe(es.through(function () {
|
||||
run();
|
||||
}));
|
||||
}
|
||||
resultStream = es.through(function (data) {
|
||||
var filePath = path.normalize(data.path);
|
||||
if (neededFiles[filePath]) {
|
||||
setInputFile(filePath, data.contents.toString());
|
||||
}
|
||||
this.emit('data', data);
|
||||
});
|
||||
return resultStream;
|
||||
}
|
||||
|
||||
@@ -5,35 +5,52 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as gulp from 'gulp';
|
||||
import * as tsb from 'gulp-tsb';
|
||||
import * as es from 'event-stream';
|
||||
const watch = require('./watch');
|
||||
import * as nls from './nls';
|
||||
import * as util from './util';
|
||||
import { createReporter } from './reporter';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as gulp from 'gulp';
|
||||
import * as bom from 'gulp-bom';
|
||||
import * as sourcemaps from 'gulp-sourcemaps';
|
||||
import * as tsb from 'gulp-tsb';
|
||||
import * as path from 'path';
|
||||
import * as _ from 'underscore';
|
||||
import * as monacodts from '../monaco/api';
|
||||
import * as fs from 'fs';
|
||||
import * as nls from './nls';
|
||||
import { createReporter } from './reporter';
|
||||
import * as util from './util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
|
||||
const watch = require('./watch');
|
||||
|
||||
const reporter = createReporter();
|
||||
|
||||
const rootDir = path.join(__dirname, '../../src');
|
||||
const options = require('../../src/tsconfig.json').compilerOptions;
|
||||
options.verbose = false;
|
||||
options.sourceMap = true;
|
||||
options.rootDir = rootDir;
|
||||
options.sourceRoot = util.toFileUri(rootDir);
|
||||
function getTypeScriptCompilerOptions(src: string) {
|
||||
const rootDir = path.join(__dirname, `../../${src}`);
|
||||
const tsconfig = require(`../../${src}/tsconfig.json`);
|
||||
let options: { [key: string]: any };
|
||||
if (tsconfig.extends) {
|
||||
options = Object.assign({}, require(path.join(rootDir, tsconfig.extends)).compilerOptions, tsconfig.compilerOptions);
|
||||
} else {
|
||||
options = tsconfig.compilerOptions;
|
||||
}
|
||||
options.verbose = false;
|
||||
options.sourceMap = true;
|
||||
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
|
||||
options.sourceMap = false;
|
||||
}
|
||||
options.rootDir = rootDir;
|
||||
options.baseUrl = rootDir;
|
||||
options.sourceRoot = util.toFileUri(rootDir);
|
||||
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF';
|
||||
return options;
|
||||
}
|
||||
|
||||
function createCompile(build: boolean, emitError?: boolean): (token?: util.ICancellationToken) => NodeJS.ReadWriteStream {
|
||||
const opts = _.clone(options);
|
||||
function createCompile(src: string, build: boolean, emitError?: boolean): (token?: util.ICancellationToken) => NodeJS.ReadWriteStream {
|
||||
const opts = _.clone(getTypeScriptCompilerOptions(src));
|
||||
opts.inlineSources = !!build;
|
||||
opts.noFilesystemLookup = true;
|
||||
|
||||
const ts = tsb.create(opts, null, null, err => reporter(err.toString()));
|
||||
const ts = tsb.create(opts, true, undefined, err => reporter(err.toString()));
|
||||
|
||||
return function (token?: util.ICancellationToken) {
|
||||
|
||||
@@ -49,159 +66,179 @@ function createCompile(build: boolean, emitError?: boolean): (token?: util.ICanc
|
||||
.pipe(tsFilter)
|
||||
.pipe(util.loadSourcemaps())
|
||||
.pipe(ts(token))
|
||||
// .pipe(build ? reloadTypeScriptNodeModule() : es.through())
|
||||
.pipe(noDeclarationsFilter)
|
||||
.pipe(build ? nls() : es.through())
|
||||
.pipe(noDeclarationsFilter.restore)
|
||||
.pipe(sourcemaps.write('.', {
|
||||
addComment: false,
|
||||
includeContent: !!build,
|
||||
sourceRoot: options.sourceRoot
|
||||
sourceRoot: opts.sourceRoot
|
||||
}))
|
||||
.pipe(tsFilter.restore)
|
||||
.pipe(reporter.end(emitError));
|
||||
.pipe(reporter.end(!!emitError));
|
||||
|
||||
return es.duplex(input, output);
|
||||
};
|
||||
}
|
||||
|
||||
export function compileTask(out: string, build: boolean): () => NodeJS.ReadWriteStream {
|
||||
const typesDts = [
|
||||
'node_modules/typescript/lib/*.d.ts',
|
||||
'node_modules/@types/**/*.d.ts',
|
||||
'!node_modules/@types/webpack/**/*',
|
||||
'!node_modules/@types/uglify-js/**/*',
|
||||
];
|
||||
|
||||
export function compileTask(src: string, out: string, build: boolean): () => NodeJS.ReadWriteStream {
|
||||
|
||||
return function () {
|
||||
const compile = createCompile(build, true);
|
||||
const compile = createCompile(src, build, true);
|
||||
|
||||
const src = es.merge(
|
||||
gulp.src('src/**', { base: 'src' }),
|
||||
gulp.src('node_modules/typescript/lib/lib.d.ts'),
|
||||
const srcPipe = es.merge(
|
||||
gulp.src(`${src}/**`, { base: `${src}` }),
|
||||
gulp.src(typesDts),
|
||||
);
|
||||
|
||||
return src
|
||||
let generator = new MonacoGenerator(false);
|
||||
if (src === 'src') {
|
||||
generator.execute();
|
||||
}
|
||||
|
||||
return srcPipe
|
||||
.pipe(generator.stream)
|
||||
.pipe(compile())
|
||||
.pipe(gulp.dest(out))
|
||||
.pipe(monacodtsTask(out, false));
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
}
|
||||
|
||||
export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteStream {
|
||||
|
||||
return function () {
|
||||
const compile = createCompile(build);
|
||||
const compile = createCompile('src', build);
|
||||
|
||||
const src = es.merge(
|
||||
gulp.src('src/**', { base: 'src' }),
|
||||
gulp.src('node_modules/typescript/lib/lib.d.ts'),
|
||||
gulp.src(typesDts),
|
||||
);
|
||||
const watchSrc = watch('src/**', { base: 'src' });
|
||||
|
||||
let generator = new MonacoGenerator(true);
|
||||
generator.execute();
|
||||
|
||||
return watchSrc
|
||||
.pipe(generator.stream)
|
||||
.pipe(util.incremental(compile, src, true))
|
||||
.pipe(gulp.dest(out))
|
||||
.pipe(monacodtsTask(out, true));
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
}
|
||||
|
||||
function reloadTypeScriptNodeModule(): NodeJS.ReadWriteStream {
|
||||
var util = require('gulp-util');
|
||||
function log(message: any, ...rest: any[]): void {
|
||||
util.log(util.colors.cyan('[memory watch dog]'), message, ...rest);
|
||||
}
|
||||
const REPO_SRC_FOLDER = path.join(__dirname, '../../src');
|
||||
|
||||
function heapUsed(): string {
|
||||
return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB';
|
||||
}
|
||||
class MonacoGenerator {
|
||||
private readonly _isWatch: boolean;
|
||||
public readonly stream: NodeJS.ReadWriteStream;
|
||||
|
||||
return es.through(function (data) {
|
||||
this.emit('data', data);
|
||||
}, function () {
|
||||
private readonly _watchers: fs.FSWatcher[];
|
||||
private readonly _watchedFiles: { [filePath: string]: boolean; };
|
||||
private readonly _fsProvider: monacodts.FSProvider;
|
||||
private readonly _declarationResolver: monacodts.DeclarationResolver;
|
||||
|
||||
log('memory usage after compilation finished: ' + heapUsed());
|
||||
|
||||
// It appears we are running into some variant of
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=2073
|
||||
//
|
||||
// Even though all references are dropped, some
|
||||
// optimized methods in the TS compiler end up holding references
|
||||
// to the entire TypeScript language host (>600MB)
|
||||
//
|
||||
// The idea is to force v8 to drop references to these
|
||||
// optimized methods, by "reloading" the typescript node module
|
||||
|
||||
log('Reloading typescript node module...');
|
||||
|
||||
var resolvedName = require.resolve('typescript');
|
||||
|
||||
var originalModule = require.cache[resolvedName];
|
||||
delete require.cache[resolvedName];
|
||||
var newExports = require('typescript');
|
||||
require.cache[resolvedName] = originalModule;
|
||||
|
||||
for (var prop in newExports) {
|
||||
if (newExports.hasOwnProperty(prop)) {
|
||||
originalModule.exports[prop] = newExports[prop];
|
||||
constructor(isWatch: boolean) {
|
||||
this._isWatch = isWatch;
|
||||
this.stream = es.through();
|
||||
this._watchers = [];
|
||||
this._watchedFiles = {};
|
||||
let onWillReadFile = (moduleId: string, filePath: string) => {
|
||||
if (!this._isWatch) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this._watchedFiles[filePath]) {
|
||||
return;
|
||||
}
|
||||
this._watchedFiles[filePath] = true;
|
||||
|
||||
log('typescript node module reloaded.');
|
||||
const watcher = fs.watch(filePath);
|
||||
watcher.addListener('change', () => {
|
||||
this._declarationResolver.invalidateCache(moduleId);
|
||||
this._executeSoon();
|
||||
});
|
||||
watcher.addListener('error', (err) => {
|
||||
console.error(`Encountered error while watching ${filePath}.`);
|
||||
console.log(err);
|
||||
delete this._watchedFiles[filePath];
|
||||
for (let i = 0; i < this._watchers.length; i++) {
|
||||
if (this._watchers[i] === watcher) {
|
||||
this._watchers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
watcher.close();
|
||||
this._declarationResolver.invalidateCache(moduleId);
|
||||
this._executeSoon();
|
||||
});
|
||||
this._watchers.push(watcher);
|
||||
};
|
||||
this._fsProvider = new class extends monacodts.FSProvider {
|
||||
public readFileSync(moduleId: string, filePath: string): Buffer {
|
||||
onWillReadFile(moduleId, filePath);
|
||||
return super.readFileSync(moduleId, filePath);
|
||||
}
|
||||
};
|
||||
this._declarationResolver = new monacodts.DeclarationResolver(this._fsProvider);
|
||||
|
||||
this.emit('end');
|
||||
});
|
||||
}
|
||||
|
||||
function monacodtsTask(out: string, isWatch: boolean): NodeJS.ReadWriteStream {
|
||||
|
||||
const neededFiles: { [file: string]: boolean; } = {};
|
||||
monacodts.getFilesToWatch(out).forEach(function (filePath) {
|
||||
filePath = path.normalize(filePath);
|
||||
neededFiles[filePath] = true;
|
||||
});
|
||||
|
||||
const inputFiles: { [file: string]: string; } = {};
|
||||
for (let filePath in neededFiles) {
|
||||
if (/\bsrc(\/|\\)vs\b/.test(filePath)) {
|
||||
// This file is needed from source => simply read it now
|
||||
inputFiles[filePath] = fs.readFileSync(filePath).toString();
|
||||
if (this._isWatch) {
|
||||
const recipeWatcher = fs.watch(monacodts.RECIPE_PATH);
|
||||
recipeWatcher.addListener('change', () => {
|
||||
this._executeSoon();
|
||||
});
|
||||
this._watchers.push(recipeWatcher);
|
||||
}
|
||||
}
|
||||
|
||||
const setInputFile = (filePath: string, contents: string) => {
|
||||
if (inputFiles[filePath] === contents) {
|
||||
// no change
|
||||
private _executeSoonTimer: NodeJS.Timer | null = null;
|
||||
private _executeSoon(): void {
|
||||
if (this._executeSoonTimer !== null) {
|
||||
clearTimeout(this._executeSoonTimer);
|
||||
this._executeSoonTimer = null;
|
||||
}
|
||||
this._executeSoonTimer = setTimeout(() => {
|
||||
this._executeSoonTimer = null;
|
||||
this.execute();
|
||||
}, 20);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._watchers.forEach(watcher => watcher.close());
|
||||
}
|
||||
|
||||
private _run(): monacodts.IMonacoDeclarationResult | null {
|
||||
let r = monacodts.run3(this._declarationResolver);
|
||||
if (!r && !this._isWatch) {
|
||||
// The build must always be able to generate the monaco.d.ts
|
||||
throw new Error(`monaco.d.ts generation error - Cannot continue`);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
private _log(message: any, ...rest: any[]): void {
|
||||
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
}
|
||||
|
||||
public execute(): void {
|
||||
const startTime = Date.now();
|
||||
const result = this._run();
|
||||
if (!result) {
|
||||
// nothing really changed
|
||||
return;
|
||||
}
|
||||
inputFiles[filePath] = contents;
|
||||
const neededInputFilesCount = Object.keys(neededFiles).length;
|
||||
const availableInputFilesCount = Object.keys(inputFiles).length;
|
||||
if (neededInputFilesCount === availableInputFilesCount) {
|
||||
run();
|
||||
if (result.isTheSame) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const run = () => {
|
||||
const result = monacodts.run(out, inputFiles);
|
||||
if (!result.isTheSame) {
|
||||
if (isWatch) {
|
||||
fs.writeFileSync(result.filePath, result.content);
|
||||
} else {
|
||||
resultStream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.');
|
||||
}
|
||||
fs.writeFileSync(result.filePath, result.content);
|
||||
fs.writeFileSync(path.join(REPO_SRC_FOLDER, 'vs/editor/common/standalone/standaloneEnums.ts'), result.enums);
|
||||
this._log(`monaco.d.ts is changed - total time took ${Date.now() - startTime} ms`);
|
||||
if (!this._isWatch) {
|
||||
this.stream.emit('error', 'monaco.d.ts is no longer up to date. Please run gulp watch and commit the new file.');
|
||||
}
|
||||
};
|
||||
|
||||
let resultStream: NodeJS.ReadWriteStream;
|
||||
|
||||
if (isWatch) {
|
||||
watch('build/monaco/*').pipe(es.through(function () {
|
||||
run();
|
||||
}));
|
||||
}
|
||||
|
||||
resultStream = es.through(function (data) {
|
||||
const filePath = path.normalize(data.path);
|
||||
if (neededFiles[filePath]) {
|
||||
setInputFile(filePath, data.contents.toString());
|
||||
}
|
||||
this.emit('data', data);
|
||||
});
|
||||
|
||||
return resultStream;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ const root = path.dirname(path.dirname(__dirname));
|
||||
|
||||
function getElectronVersion() {
|
||||
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
|
||||
// @ts-ignore
|
||||
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
|
||||
|
||||
return target;
|
||||
@@ -19,6 +20,7 @@ function getElectronVersion() {
|
||||
module.exports.getElectronVersion = getElectronVersion;
|
||||
|
||||
// returns 0 if the right version of electron is in .build/electron
|
||||
// @ts-ignore
|
||||
if (require.main === module) {
|
||||
const version = getElectronVersion();
|
||||
const versionFile = path.join(root, '.build', 'electron', 'version');
|
||||
|
||||
@@ -4,115 +4,319 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var es = require("event-stream");
|
||||
var assign = require("object-assign");
|
||||
var remote = require("gulp-remote-src");
|
||||
var flatmap = require('gulp-flatmap');
|
||||
var vzip = require('gulp-vinyl-zip');
|
||||
var filter = require('gulp-filter');
|
||||
var rename = require('gulp-rename');
|
||||
var util = require('gulp-util');
|
||||
var buffer = require('gulp-buffer');
|
||||
var json = require('gulp-json-editor');
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var vsce = require("vsce");
|
||||
var File = require("vinyl");
|
||||
function fromLocal(extensionPath) {
|
||||
var result = es.through();
|
||||
vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn })
|
||||
.then(function (fileNames) {
|
||||
var files = fileNames
|
||||
.map(function (fileName) { return path.join(extensionPath, fileName); })
|
||||
.map(function (filePath) { return new File({
|
||||
const es = require("event-stream");
|
||||
const fs = require("fs");
|
||||
const glob = require("glob");
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
const File = require("vinyl");
|
||||
const vsce = require("vsce");
|
||||
const stats_1 = require("./stats");
|
||||
const util2 = require("./util");
|
||||
const remote = require("gulp-remote-src");
|
||||
const vzip = require('gulp-vinyl-zip');
|
||||
const filter = require("gulp-filter");
|
||||
const rename = require("gulp-rename");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const buffer = require('gulp-buffer');
|
||||
const json = require("gulp-json-editor");
|
||||
const webpack = require('webpack');
|
||||
const webpackGulp = require('webpack-stream');
|
||||
const root = path.resolve(path.join(__dirname, '..', '..'));
|
||||
// {{SQL CARBON EDIT}}
|
||||
const _ = require("underscore");
|
||||
const vfs = require("vinyl-fs");
|
||||
const deps = require('../dependencies');
|
||||
const extensionsRoot = path.join(root, 'extensions');
|
||||
const extensionsProductionDependencies = deps.getProductionDependencies(extensionsRoot);
|
||||
function packageBuiltInExtensions() {
|
||||
const sqlBuiltInLocalExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
||||
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
||||
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
|
||||
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
||||
vsce.createVSIX({
|
||||
cwd: element.path,
|
||||
packagePath: packagePath,
|
||||
useYarn: true
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.packageBuiltInExtensions = packageBuiltInExtensions;
|
||||
function packageExtensionTask(extensionName, platform, arch) {
|
||||
var destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
if (platform === 'darwin') {
|
||||
destination = path.join(destination, 'Azure Data Studio.app', 'Contents', 'Resources', 'app', 'extensions', extensionName);
|
||||
}
|
||||
else {
|
||||
destination = path.join(destination, 'resources', 'app', 'extensions', extensionName);
|
||||
}
|
||||
platform = platform || process.platform;
|
||||
return () => {
|
||||
const root = path.resolve(path.join(__dirname, '../..'));
|
||||
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => extensionName === name);
|
||||
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
|
||||
return fromLocal(extension.path);
|
||||
}));
|
||||
let result = localExtensions
|
||||
.pipe(util2.skipDirectories())
|
||||
.pipe(util2.fixWin32DirectoryPermissions())
|
||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||
return result.pipe(vfs.dest(destination));
|
||||
};
|
||||
}
|
||||
exports.packageExtensionTask = packageExtensionTask;
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
function fromLocal(extensionPath, sourceMappingURLBase) {
|
||||
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
|
||||
if (fs.existsSync(webpackFilename)) {
|
||||
return fromLocalWebpack(extensionPath, sourceMappingURLBase);
|
||||
}
|
||||
else {
|
||||
return fromLocalNormal(extensionPath);
|
||||
}
|
||||
}
|
||||
function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
|
||||
const result = es.through();
|
||||
const packagedDependencies = [];
|
||||
const packageJsonConfig = require(path.join(extensionPath, 'package.json'));
|
||||
if (packageJsonConfig.dependencies) {
|
||||
const webpackRootConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
|
||||
for (const key in webpackRootConfig.externals) {
|
||||
if (key in packageJsonConfig.dependencies) {
|
||||
packagedDependencies.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn, packagedDependencies }).then(fileNames => {
|
||||
const files = fileNames
|
||||
.map(fileName => path.join(extensionPath, fileName))
|
||||
.map(filePath => new File({
|
||||
path: filePath,
|
||||
stat: fs.statSync(filePath),
|
||||
base: extensionPath,
|
||||
contents: fs.createReadStream(filePath)
|
||||
}); });
|
||||
}));
|
||||
const filesStream = es.readArray(files);
|
||||
// check for a webpack configuration files, then invoke webpack
|
||||
// and merge its output with the files stream. also rewrite the package.json
|
||||
// file to a new entry point
|
||||
const webpackConfigLocations = glob.sync(path.join(extensionPath, '/**/extension.webpack.config.js'), { ignore: ['**/node_modules'] });
|
||||
const packageJsonFilter = filter(f => {
|
||||
if (path.basename(f.path) === 'package.json') {
|
||||
// only modify package.json's next to the webpack file.
|
||||
// to be safe, use existsSync instead of path comparison.
|
||||
return fs.existsSync(path.join(path.dirname(f.path), 'extension.webpack.config.js'));
|
||||
}
|
||||
return false;
|
||||
}, { restore: true });
|
||||
const patchFilesStream = filesStream
|
||||
.pipe(packageJsonFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(json((data) => {
|
||||
if (data.main) {
|
||||
// hardcoded entry point directory!
|
||||
data.main = data.main.replace('/out/', /dist/);
|
||||
}
|
||||
return data;
|
||||
}))
|
||||
.pipe(packageJsonFilter.restore);
|
||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||
const webpackDone = (err, stats) => {
|
||||
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
}
|
||||
const { compilation } = stats;
|
||||
if (compilation.errors.length > 0) {
|
||||
result.emit('error', compilation.errors.join('\n'));
|
||||
}
|
||||
if (compilation.warnings.length > 0) {
|
||||
result.emit('error', compilation.warnings.join('\n'));
|
||||
}
|
||||
};
|
||||
const webpackConfig = Object.assign({}, require(webpackConfigPath), { mode: 'production' });
|
||||
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
|
||||
return webpackGulp(webpackConfig, webpack, webpackDone)
|
||||
.pipe(es.through(function (data) {
|
||||
data.stat = data.stat || {};
|
||||
data.base = extensionPath;
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(es.through(function (data) {
|
||||
// source map handling:
|
||||
// * rewrite sourceMappingURL
|
||||
// * save to disk so that upload-task picks this up
|
||||
if (sourceMappingURLBase) {
|
||||
const contents = data.contents.toString('utf8');
|
||||
data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
|
||||
return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
|
||||
}), 'utf8');
|
||||
if (/\.js\.map$/.test(data.path)) {
|
||||
if (!fs.existsSync(path.dirname(data.path))) {
|
||||
fs.mkdirSync(path.dirname(data.path));
|
||||
}
|
||||
fs.writeFileSync(data.path, data.contents);
|
||||
}
|
||||
}
|
||||
this.emit('data', data);
|
||||
}));
|
||||
});
|
||||
es.merge(sequence(webpackStreams), patchFilesStream)
|
||||
// .pipe(es.through(function (data) {
|
||||
// // debug
|
||||
// console.log('out', data.path, data.contents.length);
|
||||
// this.emit('data', data);
|
||||
// }))
|
||||
.pipe(result);
|
||||
}).catch(err => {
|
||||
console.error(extensionPath);
|
||||
console.error(packagedDependencies);
|
||||
result.emit('error', err);
|
||||
});
|
||||
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
|
||||
}
|
||||
function fromLocalNormal(extensionPath) {
|
||||
const result = es.through();
|
||||
vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn })
|
||||
.then(fileNames => {
|
||||
const files = fileNames
|
||||
.map(fileName => path.join(extensionPath, fileName))
|
||||
.map(filePath => new File({
|
||||
path: filePath,
|
||||
stat: fs.statSync(filePath),
|
||||
base: extensionPath,
|
||||
contents: fs.createReadStream(filePath)
|
||||
}));
|
||||
es.readArray(files).pipe(result);
|
||||
})
|
||||
.catch(function (err) { return result.emit('error', err); });
|
||||
return result;
|
||||
.catch(err => result.emit('error', err));
|
||||
return result.pipe(stats_1.createStatsStream(path.basename(extensionPath)));
|
||||
}
|
||||
exports.fromLocal = fromLocal;
|
||||
function error(err) {
|
||||
var result = es.through();
|
||||
setTimeout(function () { return result.emit('error', err); });
|
||||
return result;
|
||||
}
|
||||
var baseHeaders = {
|
||||
const baseHeaders = {
|
||||
'X-Market-Client-Id': 'VSCode Build',
|
||||
'User-Agent': 'VSCode Build',
|
||||
'X-Market-User-Id': '291C1CD0-051A-4123-9B4B-30D60EF52EE2',
|
||||
};
|
||||
function fromMarketplace(extensionName, version) {
|
||||
var filterType = 7;
|
||||
var value = extensionName;
|
||||
var criterium = { filterType: filterType, value: value };
|
||||
var criteria = [criterium];
|
||||
var pageNumber = 1;
|
||||
var pageSize = 1;
|
||||
var sortBy = 0;
|
||||
var sortOrder = 0;
|
||||
var flags = 0x1 | 0x2 | 0x80;
|
||||
var assetTypes = ['Microsoft.VisualStudio.Services.VSIXPackage'];
|
||||
var filters = [{ criteria: criteria, pageNumber: pageNumber, pageSize: pageSize, sortBy: sortBy, sortOrder: sortOrder }];
|
||||
var body = JSON.stringify({ filters: filters, assetTypes: assetTypes, flags: flags });
|
||||
var headers = assign({}, baseHeaders, {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json;api-version=3.0-preview.1',
|
||||
'Content-Length': body.length
|
||||
});
|
||||
var options = {
|
||||
base: 'https://marketplace.visualstudio.com/_apis/public/gallery',
|
||||
function fromMarketplace(extensionName, version, metadata) {
|
||||
const [publisher, name] = extensionName.split('.');
|
||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||
const options = {
|
||||
base: url,
|
||||
requestOptions: {
|
||||
method: 'POST',
|
||||
gzip: true,
|
||||
headers: headers,
|
||||
body: body
|
||||
headers: baseHeaders
|
||||
}
|
||||
};
|
||||
return remote('/extensionquery', options)
|
||||
.pipe(flatmap(function (stream, f) {
|
||||
var rawResult = f.contents.toString('utf8');
|
||||
var result = JSON.parse(rawResult);
|
||||
var extension = result.results[0].extensions[0];
|
||||
if (!extension) {
|
||||
return error("No such extension: " + extension);
|
||||
}
|
||||
var metadata = {
|
||||
id: extension.extensionId,
|
||||
publisherId: extension.publisher,
|
||||
publisherDisplayName: extension.publisher.displayName
|
||||
};
|
||||
var extensionVersion = extension.versions.filter(function (v) { return v.version === version; })[0];
|
||||
if (!extensionVersion) {
|
||||
return error("No such extension version: " + extensionName + " @ " + version);
|
||||
}
|
||||
var asset = extensionVersion.files.filter(function (f) { return f.assetType === 'Microsoft.VisualStudio.Services.VSIXPackage'; })[0];
|
||||
if (!asset) {
|
||||
return error("No VSIX found for extension version: " + extensionName + " @ " + version);
|
||||
}
|
||||
util.log('Downloading extension:', util.colors.yellow(extensionName + "@" + version), '...');
|
||||
var options = {
|
||||
base: asset.source,
|
||||
requestOptions: {
|
||||
gzip: true,
|
||||
headers: baseHeaders
|
||||
}
|
||||
};
|
||||
return remote('', options)
|
||||
.pipe(flatmap(function (stream) {
|
||||
var packageJsonFilter = filter('package.json', { restore: true });
|
||||
return stream
|
||||
.pipe(vzip.src())
|
||||
.pipe(filter('extension/**'))
|
||||
.pipe(rename(function (p) { return p.dirname = p.dirname.replace(/^extension\/?/, ''); }))
|
||||
.pipe(packageJsonFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(json({ __metadata: metadata }))
|
||||
.pipe(packageJsonFilter.restore);
|
||||
}));
|
||||
}));
|
||||
const packageJsonFilter = filter('package.json', { restore: true });
|
||||
return remote('', options)
|
||||
.pipe(vzip.src())
|
||||
.pipe(filter('extension/**'))
|
||||
.pipe(rename(p => p.dirname = p.dirname.replace(/^extension\/?/, '')))
|
||||
.pipe(packageJsonFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(json({ __metadata: metadata }))
|
||||
.pipe(packageJsonFilter.restore);
|
||||
}
|
||||
exports.fromMarketplace = fromMarketplace;
|
||||
const excludedExtensions = [
|
||||
'vscode-api-tests',
|
||||
'vscode-colorize-tests',
|
||||
'ms-vscode.node-debug',
|
||||
'ms-vscode.node-debug2',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'integration-tests'
|
||||
];
|
||||
// {{SQL CARBON EDIT}}
|
||||
const sqlBuiltInExtensions = [
|
||||
// Add SQL built-in extensions here.
|
||||
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
||||
'admin-tool-ext-win',
|
||||
'agent',
|
||||
'import',
|
||||
'profiler',
|
||||
'admin-pack',
|
||||
'big-data-cluster',
|
||||
'dacpac'
|
||||
];
|
||||
var azureExtensions = ['azurecore', 'mssql'];
|
||||
const builtInExtensions = require('../builtInExtensions.json');
|
||||
/**
|
||||
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
||||
* that while downloading extensions from the marketplace, node js doesn't get enough
|
||||
* stack frames to complete the download in under 2 minutes, at which point the
|
||||
* marketplace server cuts off the http request. So, we sequentialize the extensino tasks.
|
||||
*/
|
||||
function sequence(streamProviders) {
|
||||
const result = es.through();
|
||||
function pop() {
|
||||
if (streamProviders.length === 0) {
|
||||
result.emit('end');
|
||||
}
|
||||
else {
|
||||
const fn = streamProviders.shift();
|
||||
fn()
|
||||
.on('end', function () { setTimeout(pop, 0); })
|
||||
.pipe(result, { end: false });
|
||||
}
|
||||
}
|
||||
pop();
|
||||
return result;
|
||||
}
|
||||
function packageExtensionsStream(optsIn) {
|
||||
const opts = optsIn || {};
|
||||
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||
})]);
|
||||
// {{SQL CARBON EDIT}}
|
||||
const extensionDepsSrc = [
|
||||
..._.flatten(extensionsProductionDependencies.map((d) => path.relative(root, d.path)).map((d) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||
];
|
||||
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||
.pipe(filter(['**', '!**/package-lock.json']))
|
||||
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
||||
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
|
||||
// Original code commented out here
|
||||
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
||||
// const marketplaceExtensions = () => es.merge(
|
||||
// ...builtInExtensions
|
||||
// .filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||
// .map(extension => {
|
||||
// return fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||
// .pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||
// })
|
||||
// );
|
||||
return sequence([localExtensions, localExtensionDependencies,])
|
||||
.pipe(util2.setExecutableBit(['**/*.sh']))
|
||||
.pipe(filter(['**', '!**/*.js.map']));
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
}
|
||||
exports.packageExtensionsStream = packageExtensionsStream;
|
||||
|
||||
@@ -4,22 +4,222 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as es from 'event-stream';
|
||||
import { Stream } from 'stream';
|
||||
import assign = require('object-assign');
|
||||
import remote = require('gulp-remote-src');
|
||||
const flatmap = require('gulp-flatmap');
|
||||
const vzip = require('gulp-vinyl-zip');
|
||||
const filter = require('gulp-filter');
|
||||
const rename = require('gulp-rename');
|
||||
const util = require('gulp-util');
|
||||
const buffer = require('gulp-buffer');
|
||||
const json = require('gulp-json-editor');
|
||||
import * as fs from 'fs';
|
||||
import * as glob from 'glob';
|
||||
import * as gulp from 'gulp';
|
||||
import * as path from 'path';
|
||||
import * as vsce from 'vsce';
|
||||
import { Stream } from 'stream';
|
||||
import * as File from 'vinyl';
|
||||
import * as vsce from 'vsce';
|
||||
import { createStatsStream } from './stats';
|
||||
import * as util2 from './util';
|
||||
import remote = require('gulp-remote-src');
|
||||
const vzip = require('gulp-vinyl-zip');
|
||||
import filter = require('gulp-filter');
|
||||
import rename = require('gulp-rename');
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
const buffer = require('gulp-buffer');
|
||||
import json = require('gulp-json-editor');
|
||||
const webpack = require('webpack');
|
||||
const webpackGulp = require('webpack-stream');
|
||||
|
||||
export function fromLocal(extensionPath: string): Stream {
|
||||
const root = path.resolve(path.join(__dirname, '..', '..'));
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
import * as _ from 'underscore';
|
||||
import * as vfs from 'vinyl-fs';
|
||||
const deps = require('../dependencies');
|
||||
const extensionsRoot = path.join(root, 'extensions');
|
||||
const extensionsProductionDependencies = deps.getProductionDependencies(extensionsRoot);
|
||||
|
||||
export function packageBuiltInExtensions() {
|
||||
const sqlBuiltInLocalExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) >= 0);
|
||||
sqlBuiltInLocalExtensionDescriptions.forEach(element => {
|
||||
const packagePath = path.join(path.dirname(root), element.name + '.vsix');
|
||||
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
|
||||
vsce.createVSIX({
|
||||
cwd: element.path,
|
||||
packagePath: packagePath,
|
||||
useYarn: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function packageExtensionTask(extensionName: string, platform: string, arch: string) {
|
||||
var destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
if (platform === 'darwin') {
|
||||
destination = path.join(destination, 'Azure Data Studio.app', 'Contents', 'Resources', 'app', 'extensions', extensionName);
|
||||
} else {
|
||||
destination = path.join(destination, 'resources', 'app', 'extensions', extensionName);
|
||||
}
|
||||
|
||||
platform = platform || process.platform;
|
||||
|
||||
return () => {
|
||||
const root = path.resolve(path.join(__dirname, '../..'));
|
||||
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => extensionName === name);
|
||||
|
||||
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
|
||||
return fromLocal(extension.path);
|
||||
}));
|
||||
|
||||
let result = localExtensions
|
||||
.pipe(util2.skipDirectories())
|
||||
.pipe(util2.fixWin32DirectoryPermissions())
|
||||
.pipe(filter(['**', '!LICENSE', '!LICENSES.chromium.html', '!version']));
|
||||
|
||||
return result.pipe(vfs.dest(destination));
|
||||
};
|
||||
}
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
|
||||
function fromLocal(extensionPath: string, sourceMappingURLBase?: string): Stream {
|
||||
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
|
||||
if (fs.existsSync(webpackFilename)) {
|
||||
return fromLocalWebpack(extensionPath, sourceMappingURLBase);
|
||||
} else {
|
||||
return fromLocalNormal(extensionPath);
|
||||
}
|
||||
}
|
||||
|
||||
function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string | undefined): Stream {
|
||||
const result = es.through();
|
||||
|
||||
const packagedDependencies: string[] = [];
|
||||
const packageJsonConfig = require(path.join(extensionPath, 'package.json'));
|
||||
if (packageJsonConfig.dependencies) {
|
||||
const webpackRootConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
|
||||
for (const key in webpackRootConfig.externals) {
|
||||
if (key in packageJsonConfig.dependencies) {
|
||||
packagedDependencies.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn, packagedDependencies }).then(fileNames => {
|
||||
const files = fileNames
|
||||
.map(fileName => path.join(extensionPath, fileName))
|
||||
.map(filePath => new File({
|
||||
path: filePath,
|
||||
stat: fs.statSync(filePath),
|
||||
base: extensionPath,
|
||||
contents: fs.createReadStream(filePath) as any
|
||||
}));
|
||||
|
||||
const filesStream = es.readArray(files);
|
||||
|
||||
// check for a webpack configuration files, then invoke webpack
|
||||
// and merge its output with the files stream. also rewrite the package.json
|
||||
// file to a new entry point
|
||||
const webpackConfigLocations = (<string[]>glob.sync(
|
||||
path.join(extensionPath, '/**/extension.webpack.config.js'),
|
||||
{ ignore: ['**/node_modules'] }
|
||||
));
|
||||
|
||||
const packageJsonFilter = filter(f => {
|
||||
if (path.basename(f.path) === 'package.json') {
|
||||
// only modify package.json's next to the webpack file.
|
||||
// to be safe, use existsSync instead of path comparison.
|
||||
return fs.existsSync(path.join(path.dirname(f.path), 'extension.webpack.config.js'));
|
||||
}
|
||||
return false;
|
||||
}, { restore: true });
|
||||
|
||||
const patchFilesStream = filesStream
|
||||
.pipe(packageJsonFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(json((data: any) => {
|
||||
if (data.main) {
|
||||
// hardcoded entry point directory!
|
||||
data.main = data.main.replace('/out/', /dist/);
|
||||
}
|
||||
return data;
|
||||
}))
|
||||
.pipe(packageJsonFilter.restore);
|
||||
|
||||
|
||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||
|
||||
const webpackDone = (err: any, stats: any) => {
|
||||
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
}
|
||||
const { compilation } = stats;
|
||||
if (compilation.errors.length > 0) {
|
||||
result.emit('error', compilation.errors.join('\n'));
|
||||
}
|
||||
if (compilation.warnings.length > 0) {
|
||||
result.emit('error', compilation.warnings.join('\n'));
|
||||
}
|
||||
};
|
||||
|
||||
const webpackConfig = {
|
||||
...require(webpackConfigPath),
|
||||
...{ mode: 'production' }
|
||||
};
|
||||
const relativeOutputPath = path.relative(extensionPath, webpackConfig.output.path);
|
||||
|
||||
return webpackGulp(webpackConfig, webpack, webpackDone)
|
||||
.pipe(es.through(function (data) {
|
||||
data.stat = data.stat || {};
|
||||
data.base = extensionPath;
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(es.through(function (data: File) {
|
||||
// source map handling:
|
||||
// * rewrite sourceMappingURL
|
||||
// * save to disk so that upload-task picks this up
|
||||
if (sourceMappingURLBase) {
|
||||
const contents = (<Buffer>data.contents).toString('utf8');
|
||||
data.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, function (_m, g1) {
|
||||
return `\n//# sourceMappingURL=${sourceMappingURLBase}/extensions/${path.basename(extensionPath)}/${relativeOutputPath}/${g1}`;
|
||||
}), 'utf8');
|
||||
|
||||
if (/\.js\.map$/.test(data.path)) {
|
||||
if (!fs.existsSync(path.dirname(data.path))) {
|
||||
fs.mkdirSync(path.dirname(data.path));
|
||||
}
|
||||
fs.writeFileSync(data.path, data.contents);
|
||||
}
|
||||
}
|
||||
this.emit('data', data);
|
||||
}));
|
||||
});
|
||||
|
||||
es.merge(sequence(webpackStreams), patchFilesStream)
|
||||
// .pipe(es.through(function (data) {
|
||||
// // debug
|
||||
// console.log('out', data.path, data.contents.length);
|
||||
// this.emit('data', data);
|
||||
// }))
|
||||
.pipe(result);
|
||||
|
||||
}).catch(err => {
|
||||
console.error(extensionPath);
|
||||
console.error(packagedDependencies);
|
||||
result.emit('error', err);
|
||||
});
|
||||
|
||||
return result.pipe(createStatsStream(path.basename(extensionPath)));
|
||||
}
|
||||
|
||||
function fromLocalNormal(extensionPath: string): Stream {
|
||||
const result = es.through();
|
||||
|
||||
vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Yarn })
|
||||
@@ -37,96 +237,151 @@ export function fromLocal(extensionPath: string): Stream {
|
||||
})
|
||||
.catch(err => result.emit('error', err));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function error(err: any): Stream {
|
||||
const result = es.through();
|
||||
setTimeout(() => result.emit('error', err));
|
||||
return result;
|
||||
return result.pipe(createStatsStream(path.basename(extensionPath)));
|
||||
}
|
||||
|
||||
const baseHeaders = {
|
||||
'X-Market-Client-Id': 'VSCode Build',
|
||||
'User-Agent': 'VSCode Build',
|
||||
'X-Market-User-Id': '291C1CD0-051A-4123-9B4B-30D60EF52EE2',
|
||||
};
|
||||
|
||||
export function fromMarketplace(extensionName: string, version: string): Stream {
|
||||
const filterType = 7;
|
||||
const value = extensionName;
|
||||
const criterium = { filterType, value };
|
||||
const criteria = [criterium];
|
||||
const pageNumber = 1;
|
||||
const pageSize = 1;
|
||||
const sortBy = 0;
|
||||
const sortOrder = 0;
|
||||
const flags = 0x1 | 0x2 | 0x80;
|
||||
const assetTypes = ['Microsoft.VisualStudio.Services.VSIXPackage'];
|
||||
const filters = [{ criteria, pageNumber, pageSize, sortBy, sortOrder }];
|
||||
const body = JSON.stringify({ filters, assetTypes, flags });
|
||||
const headers: any = assign({}, baseHeaders, {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json;api-version=3.0-preview.1',
|
||||
'Content-Length': body.length
|
||||
});
|
||||
export function fromMarketplace(extensionName: string, version: string, metadata: any): Stream {
|
||||
const [publisher, name] = extensionName.split('.');
|
||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||
|
||||
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||
|
||||
const options = {
|
||||
base: 'https://marketplace.visualstudio.com/_apis/public/gallery',
|
||||
base: url,
|
||||
requestOptions: {
|
||||
method: 'POST',
|
||||
gzip: true,
|
||||
headers,
|
||||
body: body
|
||||
headers: baseHeaders
|
||||
}
|
||||
};
|
||||
|
||||
return remote('/extensionquery', options)
|
||||
.pipe(flatmap((stream, f) => {
|
||||
const rawResult = f.contents.toString('utf8');
|
||||
const result = JSON.parse(rawResult);
|
||||
const extension = result.results[0].extensions[0];
|
||||
if (!extension) {
|
||||
return error(`No such extension: ${extension}`);
|
||||
}
|
||||
const packageJsonFilter = filter('package.json', { restore: true });
|
||||
|
||||
const metadata = {
|
||||
id: extension.extensionId,
|
||||
publisherId: extension.publisher,
|
||||
publisherDisplayName: extension.publisher.displayName
|
||||
};
|
||||
|
||||
const extensionVersion = extension.versions.filter(v => v.version === version)[0];
|
||||
if (!extensionVersion) {
|
||||
return error(`No such extension version: ${extensionName} @ ${version}`);
|
||||
}
|
||||
|
||||
const asset = extensionVersion.files.filter(f => f.assetType === 'Microsoft.VisualStudio.Services.VSIXPackage')[0];
|
||||
if (!asset) {
|
||||
return error(`No VSIX found for extension version: ${extensionName} @ ${version}`);
|
||||
}
|
||||
|
||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
||||
|
||||
const options = {
|
||||
base: asset.source,
|
||||
requestOptions: {
|
||||
gzip: true,
|
||||
headers: baseHeaders
|
||||
}
|
||||
};
|
||||
|
||||
return remote('', options)
|
||||
.pipe(flatmap(stream => {
|
||||
const packageJsonFilter = filter('package.json', { restore: true });
|
||||
|
||||
return stream
|
||||
.pipe(vzip.src())
|
||||
.pipe(filter('extension/**'))
|
||||
.pipe(rename(p => p.dirname = p.dirname.replace(/^extension\/?/, '')))
|
||||
.pipe(packageJsonFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(json({ __metadata: metadata }))
|
||||
.pipe(packageJsonFilter.restore);
|
||||
}));
|
||||
}));
|
||||
return remote('', options)
|
||||
.pipe(vzip.src())
|
||||
.pipe(filter('extension/**'))
|
||||
.pipe(rename(p => p.dirname = p.dirname!.replace(/^extension\/?/, '')))
|
||||
.pipe(packageJsonFilter)
|
||||
.pipe(buffer())
|
||||
.pipe(json({ __metadata: metadata }))
|
||||
.pipe(packageJsonFilter.restore);
|
||||
}
|
||||
|
||||
interface IPackageExtensionsOptions {
|
||||
/**
|
||||
* Set to undefined to package all of them.
|
||||
*/
|
||||
desiredExtensions?: string[];
|
||||
sourceMappingURLBase?: string;
|
||||
}
|
||||
|
||||
const excludedExtensions = [
|
||||
'vscode-api-tests',
|
||||
'vscode-colorize-tests',
|
||||
'ms-vscode.node-debug',
|
||||
'ms-vscode.node-debug2',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'integration-tests'
|
||||
];
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const sqlBuiltInExtensions = [
|
||||
// Add SQL built-in extensions here.
|
||||
// the extension will be excluded from SQLOps package and will have separate vsix packages
|
||||
'admin-tool-ext-win',
|
||||
'agent',
|
||||
'import',
|
||||
'profiler',
|
||||
'admin-pack',
|
||||
'big-data-cluster',
|
||||
'dacpac'
|
||||
];
|
||||
var azureExtensions = ['azurecore', 'mssql'];
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
|
||||
interface IBuiltInExtension {
|
||||
name: string;
|
||||
version: string;
|
||||
repo: string;
|
||||
metadata: any;
|
||||
}
|
||||
|
||||
const builtInExtensions: IBuiltInExtension[] = require('../builtInExtensions.json');
|
||||
|
||||
/**
|
||||
* We're doing way too much stuff at once, with webpack et al. So much stuff
|
||||
* that while downloading extensions from the marketplace, node js doesn't get enough
|
||||
* stack frames to complete the download in under 2 minutes, at which point the
|
||||
* marketplace server cuts off the http request. So, we sequentialize the extensino tasks.
|
||||
*/
|
||||
function sequence(streamProviders: { (): Stream }[]): Stream {
|
||||
const result = es.through();
|
||||
|
||||
function pop() {
|
||||
if (streamProviders.length === 0) {
|
||||
result.emit('end');
|
||||
} else {
|
||||
const fn = streamProviders.shift()!;
|
||||
fn()
|
||||
.on('end', function () { setTimeout(pop, 0); })
|
||||
.pipe(result, { end: false });
|
||||
}
|
||||
}
|
||||
|
||||
pop();
|
||||
return result;
|
||||
}
|
||||
|
||||
export function packageExtensionsStream(optsIn?: IPackageExtensionsOptions): NodeJS.ReadWriteStream {
|
||||
const opts = optsIn || {};
|
||||
|
||||
const localExtensionDescriptions = (<string[]>glob.sync('extensions/*/package.json'))
|
||||
.map(manifestPath => {
|
||||
const extensionPath = path.dirname(path.join(root, manifestPath));
|
||||
const extensionName = path.basename(extensionPath);
|
||||
return { name: extensionName, path: extensionPath };
|
||||
})
|
||||
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||
.filter(({ name }) => builtInExtensions.every(b => b.name !== name))
|
||||
// {{SQL CARBON EDIT}}
|
||||
.filter(({ name }) => sqlBuiltInExtensions.indexOf(name) === -1)
|
||||
.filter(({ name }) => azureExtensions.indexOf(name) === -1);
|
||||
|
||||
const localExtensions = () => sequence([...localExtensionDescriptions.map(extension => () => {
|
||||
return fromLocal(extension.path, opts.sourceMappingURLBase)
|
||||
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||
})]);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const extensionDepsSrc = [
|
||||
..._.flatten(extensionsProductionDependencies.map((d: any) => path.relative(root, d.path)).map((d: any) => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||
];
|
||||
|
||||
const localExtensionDependencies = () => gulp.src(extensionDepsSrc, { base: '.', dot: true })
|
||||
.pipe(filter(['**', '!**/package-lock.json']))
|
||||
.pipe(util2.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
|
||||
.pipe(util2.cleanNodeModule('typescript', ['**/**'], undefined));
|
||||
|
||||
// Original code commented out here
|
||||
// const localExtensionDependencies = () => gulp.src('extensions/node_modules/**', { base: '.' });
|
||||
|
||||
// const marketplaceExtensions = () => es.merge(
|
||||
// ...builtInExtensions
|
||||
// .filter(({ name }) => opts.desiredExtensions ? opts.desiredExtensions.indexOf(name) >= 0 : true)
|
||||
// .map(extension => {
|
||||
// return fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||
// .pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
|
||||
// })
|
||||
// );
|
||||
|
||||
return sequence([localExtensions, localExtensionDependencies, /*marketplaceExtensions*/])
|
||||
.pipe(util2.setExecutableBit(['**/*.sh']))
|
||||
.pipe(filter(['**', '!**/*.js.map']));
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
}
|
||||
|
||||
@@ -4,47 +4,47 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
/**
|
||||
* Returns the sha1 commit version of a repository or undefined in case of failure.
|
||||
*/
|
||||
function getVersion(repo) {
|
||||
var git = path.join(repo, '.git');
|
||||
var headPath = path.join(git, 'HEAD');
|
||||
var head;
|
||||
const git = path.join(repo, '.git');
|
||||
const headPath = path.join(git, 'HEAD');
|
||||
let head;
|
||||
try {
|
||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||
}
|
||||
catch (e) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||
return head;
|
||||
}
|
||||
var refMatch = /^ref: (.*)$/.exec(head);
|
||||
const refMatch = /^ref: (.*)$/.exec(head);
|
||||
if (!refMatch) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
var ref = refMatch[1];
|
||||
var refPath = path.join(git, ref);
|
||||
const ref = refMatch[1];
|
||||
const refPath = path.join(git, ref);
|
||||
try {
|
||||
return fs.readFileSync(refPath, 'utf8').trim();
|
||||
}
|
||||
catch (e) {
|
||||
// noop
|
||||
}
|
||||
var packedRefsPath = path.join(git, 'packed-refs');
|
||||
var refsRaw;
|
||||
const packedRefsPath = path.join(git, 'packed-refs');
|
||||
let refsRaw;
|
||||
try {
|
||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||
}
|
||||
catch (e) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
var refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||
var refsMatch;
|
||||
var refs = {};
|
||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||
let refsMatch;
|
||||
let refs = {};
|
||||
while (refsMatch = refsRegex.exec(refsRaw)) {
|
||||
refs[refsMatch[2]] = refsMatch[1];
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as fs from 'fs';
|
||||
/**
|
||||
* Returns the sha1 commit version of a repository or undefined in case of failure.
|
||||
*/
|
||||
export function getVersion(repo: string): string {
|
||||
export function getVersion(repo: string): string | undefined {
|
||||
const git = path.join(repo, '.git');
|
||||
const headPath = path.join(git, 'HEAD');
|
||||
let head: string;
|
||||
@@ -18,7 +18,7 @@ export function getVersion(repo: string): string {
|
||||
try {
|
||||
head = fs.readFileSync(headPath, 'utf8').trim();
|
||||
} catch (e) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (/^[0-9a-f]{40}$/i.test(head)) {
|
||||
@@ -28,7 +28,7 @@ export function getVersion(repo: string): string {
|
||||
const refMatch = /^ref: (.*)$/.exec(head);
|
||||
|
||||
if (!refMatch) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const ref = refMatch[1];
|
||||
@@ -46,11 +46,11 @@ export function getVersion(repo: string): string {
|
||||
try {
|
||||
refsRaw = fs.readFileSync(packedRefsPath, 'utf8').trim();
|
||||
} catch (e) {
|
||||
return void 0;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const refsRegex = /^([0-9a-f]{40})\s+(.+)$/gm;
|
||||
let refsMatch: RegExpExecArray;
|
||||
let refsMatch: RegExpExecArray | null;
|
||||
let refs: { [ref: string]: string } = {};
|
||||
|
||||
while (refsMatch = refsRegex.exec(refsRaw)) {
|
||||
|
||||
1381
build/lib/i18n.js
1381
build/lib/i18n.js
File diff suppressed because it is too large
Load Diff
@@ -27,125 +27,185 @@
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/cli",
|
||||
"name": "vs/workbench/api/common",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/codeEditor",
|
||||
"name": "vs/workbench/contrib/cli",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/debug",
|
||||
"name": "vs/workbench/contrib/codeEditor",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/emmet",
|
||||
"name": "vs/workbench/contrib/codeinset",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/execution",
|
||||
"name": "vs/workbench/contrib/callHierarchy",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/explorers",
|
||||
"name": "vs/workbench/contrib/comments",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/extensions",
|
||||
"name": "vs/workbench/contrib/debug",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/feedback",
|
||||
"name": "vs/workbench/contrib/emmet",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/files",
|
||||
"name": "vs/workbench/contrib/extensions",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/html",
|
||||
"name": "vs/workbench/contrib/externalTerminal",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/markers",
|
||||
"name": "vs/workbench/contrib/feedback",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/nps",
|
||||
"name": "vs/workbench/contrib/files",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/output",
|
||||
"name": "vs/workbench/contrib/html",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/performance",
|
||||
"name": "vs/workbench/contrib/issue",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/preferences",
|
||||
"name": "vs/workbench/contrib/markers",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/quickopen",
|
||||
"name": "vs/workbench/contrib/localizations",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/relauncher",
|
||||
"name": "vs/workbench/contrib/logs",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/scm",
|
||||
"name": "vs/workbench/contrib/output",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/search",
|
||||
"name": "vs/workbench/contrib/performance",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/snippets",
|
||||
"name": "vs/workbench/contrib/preferences",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/surveys",
|
||||
"name": "vs/workbench/contrib/quickopen",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/tasks",
|
||||
"name": "vs/workbench/contrib/relauncher",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/terminal",
|
||||
"name": "vs/workbench/contrib/scm",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/themes",
|
||||
"name": "vs/workbench/contrib/search",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/trust",
|
||||
"name": "vs/workbench/contrib/snippets",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/update",
|
||||
"name": "vs/workbench/contrib/format",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/watermark",
|
||||
"name": "vs/workbench/contrib/stats",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/welcome",
|
||||
"name": "vs/workbench/contrib/surveys",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/tasks",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/terminal",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/themes",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/trust",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/update",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/url",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/watermark",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/webview",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/welcome",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/outline",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/actions",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/bulkEdit",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/commands",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/configuration",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/configurationResolver",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/crashReporter",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/dialogs",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/editor",
|
||||
"project": "vscode-workbench"
|
||||
@@ -154,16 +214,24 @@
|
||||
"name": "vs/workbench/services/extensions",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/extensionManagement",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/files",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/keybinding",
|
||||
"name": "vs/workbench/services/files2",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/message",
|
||||
"name": "vs/workbench/services/integrity",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/keybinding",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
@@ -174,6 +242,10 @@
|
||||
"name": "vs/workbench/services/progress",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/remote",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/textfile",
|
||||
"project": "vscode-workbench"
|
||||
@@ -195,8 +267,12 @@
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "setup_messages",
|
||||
"name": "vs/workbench/services/label",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/preferences",
|
||||
"project": "vscode-preferences"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
1131
build/lib/i18n.ts
1131
build/lib/i18n.ts
File diff suppressed because it is too large
Load Diff
309
build/lib/nls.js
309
build/lib/nls.js
@@ -3,13 +3,12 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var ts = require("typescript");
|
||||
var lazy = require("lazy.js");
|
||||
var event_stream_1 = require("event-stream");
|
||||
var File = require("vinyl");
|
||||
var sm = require("source-map");
|
||||
var assign = require("object-assign");
|
||||
var path = require("path");
|
||||
const ts = require("typescript");
|
||||
const lazy = require("lazy.js");
|
||||
const event_stream_1 = require("event-stream");
|
||||
const File = require("vinyl");
|
||||
const sm = require("source-map");
|
||||
const path = require("path");
|
||||
var CollectStepResult;
|
||||
(function (CollectStepResult) {
|
||||
CollectStepResult[CollectStepResult["Yes"] = 0] = "Yes";
|
||||
@@ -18,9 +17,9 @@ var CollectStepResult;
|
||||
CollectStepResult[CollectStepResult["NoAndRecurse"] = 3] = "NoAndRecurse";
|
||||
})(CollectStepResult || (CollectStepResult = {}));
|
||||
function collect(node, fn) {
|
||||
var result = [];
|
||||
const result = [];
|
||||
function loop(node) {
|
||||
var stepResult = fn(node);
|
||||
const stepResult = fn(node);
|
||||
if (stepResult === CollectStepResult.Yes || stepResult === CollectStepResult.YesAndRecurse) {
|
||||
result.push(node);
|
||||
}
|
||||
@@ -32,43 +31,45 @@ function collect(node, fn) {
|
||||
return result;
|
||||
}
|
||||
function clone(object) {
|
||||
var result = {};
|
||||
for (var id in object) {
|
||||
const result = {};
|
||||
for (const id in object) {
|
||||
result[id] = object[id];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function template(lines) {
|
||||
var indent = '', wrap = '';
|
||||
let indent = '', wrap = '';
|
||||
if (lines.length > 1) {
|
||||
indent = '\t';
|
||||
wrap = '\n';
|
||||
}
|
||||
return "/*---------------------------------------------------------\n * Copyright (C) Microsoft Corporation. All rights reserved.\n *--------------------------------------------------------*/\ndefine([], [" + (wrap + lines.map(function (l) { return indent + l; }).join(',\n') + wrap) + "]);";
|
||||
return `/*---------------------------------------------------------
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*--------------------------------------------------------*/
|
||||
define([], [${wrap + lines.map(l => indent + l).join(',\n') + wrap}]);`;
|
||||
}
|
||||
/**
|
||||
* Returns a stream containing the patched JavaScript and source maps.
|
||||
*/
|
||||
function nls() {
|
||||
var input = event_stream_1.through();
|
||||
var output = input.pipe(event_stream_1.through(function (f) {
|
||||
var _this = this;
|
||||
const input = event_stream_1.through();
|
||||
const output = input.pipe(event_stream_1.through(function (f) {
|
||||
if (!f.sourceMap) {
|
||||
return this.emit('error', new Error("File " + f.relative + " does not have sourcemaps."));
|
||||
return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
|
||||
}
|
||||
var source = f.sourceMap.sources[0];
|
||||
let source = f.sourceMap.sources[0];
|
||||
if (!source) {
|
||||
return this.emit('error', new Error("File " + f.relative + " does not have a source in the source map."));
|
||||
return this.emit('error', new Error(`File ${f.relative} does not have a source in the source map.`));
|
||||
}
|
||||
var root = f.sourceMap.sourceRoot;
|
||||
const root = f.sourceMap.sourceRoot;
|
||||
if (root) {
|
||||
source = path.join(root, source);
|
||||
}
|
||||
var typescript = f.sourceMap.sourcesContent[0];
|
||||
const typescript = f.sourceMap.sourcesContent[0];
|
||||
if (!typescript) {
|
||||
return this.emit('error', new Error("File " + f.relative + " does not have the original content in the source map."));
|
||||
return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`));
|
||||
}
|
||||
nls.patchFiles(f, typescript).forEach(function (f) { return _this.emit('data', f); });
|
||||
nls.patchFiles(f, typescript).forEach(f => this.emit('data', f));
|
||||
}));
|
||||
return event_stream_1.duplex(input, output);
|
||||
}
|
||||
@@ -76,10 +77,9 @@ function isImportNode(node) {
|
||||
return node.kind === ts.SyntaxKind.ImportDeclaration || node.kind === ts.SyntaxKind.ImportEqualsDeclaration;
|
||||
}
|
||||
(function (nls_1) {
|
||||
function fileFrom(file, contents, path) {
|
||||
if (path === void 0) { path = file.path; }
|
||||
function fileFrom(file, contents, path = file.path) {
|
||||
return new File({
|
||||
contents: new Buffer(contents),
|
||||
contents: Buffer.from(contents),
|
||||
base: file.base,
|
||||
cwd: file.cwd,
|
||||
path: path
|
||||
@@ -87,29 +87,27 @@ function isImportNode(node) {
|
||||
}
|
||||
nls_1.fileFrom = fileFrom;
|
||||
function mappedPositionFrom(source, lc) {
|
||||
return { source: source, line: lc.line + 1, column: lc.character };
|
||||
return { source, line: lc.line + 1, column: lc.character };
|
||||
}
|
||||
nls_1.mappedPositionFrom = mappedPositionFrom;
|
||||
function lcFrom(position) {
|
||||
return { line: position.line - 1, character: position.column };
|
||||
}
|
||||
nls_1.lcFrom = lcFrom;
|
||||
var SingleFileServiceHost = /** @class */ (function () {
|
||||
function SingleFileServiceHost(options, filename, contents) {
|
||||
var _this = this;
|
||||
class SingleFileServiceHost {
|
||||
constructor(options, filename, contents) {
|
||||
this.options = options;
|
||||
this.filename = filename;
|
||||
this.getCompilationSettings = function () { return _this.options; };
|
||||
this.getScriptFileNames = function () { return [_this.filename]; };
|
||||
this.getScriptVersion = function () { return '1'; };
|
||||
this.getScriptSnapshot = function (name) { return name === _this.filename ? _this.file : _this.lib; };
|
||||
this.getCurrentDirectory = function () { return ''; };
|
||||
this.getDefaultLibFileName = function () { return 'lib.d.ts'; };
|
||||
this.getCompilationSettings = () => this.options;
|
||||
this.getScriptFileNames = () => [this.filename];
|
||||
this.getScriptVersion = () => '1';
|
||||
this.getScriptSnapshot = (name) => name === this.filename ? this.file : this.lib;
|
||||
this.getCurrentDirectory = () => '';
|
||||
this.getDefaultLibFileName = () => 'lib.d.ts';
|
||||
this.file = ts.ScriptSnapshot.fromString(contents);
|
||||
this.lib = ts.ScriptSnapshot.fromString('');
|
||||
}
|
||||
return SingleFileServiceHost;
|
||||
}());
|
||||
}
|
||||
nls_1.SingleFileServiceHost = SingleFileServiceHost;
|
||||
function isCallExpressionWithinTextSpanCollectStep(textSpan, node) {
|
||||
if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) {
|
||||
@@ -117,94 +115,96 @@ function isImportNode(node) {
|
||||
}
|
||||
return node.kind === ts.SyntaxKind.CallExpression ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse;
|
||||
}
|
||||
function analyze(contents, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
var filename = 'file.ts';
|
||||
var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents);
|
||||
var service = ts.createLanguageService(serviceHost);
|
||||
var sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true);
|
||||
function analyze(contents, options = {}) {
|
||||
const filename = 'file.ts';
|
||||
const serviceHost = new SingleFileServiceHost(Object.assign(clone(options), { noResolve: true }), filename, contents);
|
||||
const service = ts.createLanguageService(serviceHost);
|
||||
const sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true);
|
||||
// all imports
|
||||
var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; }));
|
||||
const imports = lazy(collect(sourceFile, n => isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse));
|
||||
// import nls = require('vs/nls');
|
||||
var importEqualsDeclarations = imports
|
||||
.filter(function (n) { return n.kind === ts.SyntaxKind.ImportEqualsDeclaration; })
|
||||
.map(function (n) { return n; })
|
||||
.filter(function (d) { return d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference; })
|
||||
.filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; });
|
||||
const importEqualsDeclarations = imports
|
||||
.filter(n => n.kind === ts.SyntaxKind.ImportEqualsDeclaration)
|
||||
.map(n => n)
|
||||
.filter(d => d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference)
|
||||
.filter(d => d.moduleReference.expression.getText() === '\'vs/nls\'');
|
||||
// import ... from 'vs/nls';
|
||||
var importDeclarations = imports
|
||||
.filter(function (n) { return n.kind === ts.SyntaxKind.ImportDeclaration; })
|
||||
.map(function (n) { return n; })
|
||||
.filter(function (d) { return d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral; })
|
||||
.filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; })
|
||||
.filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; });
|
||||
var nlsExpressions = importEqualsDeclarations
|
||||
.map(function (d) { return d.moduleReference.expression; })
|
||||
.concat(importDeclarations.map(function (d) { return d.moduleSpecifier; }))
|
||||
.map(function (d) { return ({
|
||||
const importDeclarations = imports
|
||||
.filter(n => n.kind === ts.SyntaxKind.ImportDeclaration)
|
||||
.map(n => n)
|
||||
.filter(d => d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral)
|
||||
.filter(d => d.moduleSpecifier.getText() === '\'vs/nls\'')
|
||||
.filter(d => !!d.importClause && !!d.importClause.namedBindings);
|
||||
const nlsExpressions = importEqualsDeclarations
|
||||
.map(d => d.moduleReference.expression)
|
||||
.concat(importDeclarations.map(d => d.moduleSpecifier))
|
||||
.map(d => ({
|
||||
start: ts.getLineAndCharacterOfPosition(sourceFile, d.getStart()),
|
||||
end: ts.getLineAndCharacterOfPosition(sourceFile, d.getEnd())
|
||||
}); });
|
||||
}));
|
||||
// `nls.localize(...)` calls
|
||||
var nlsLocalizeCallExpressions = importDeclarations
|
||||
.filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport; })
|
||||
.map(function (d) { return d.importClause.namedBindings.name; })
|
||||
.concat(importEqualsDeclarations.map(function (d) { return d.name; }))
|
||||
.map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); })
|
||||
const nlsLocalizeCallExpressions = importDeclarations
|
||||
.filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport))
|
||||
.map(d => d.importClause.namedBindings.name)
|
||||
.concat(importEqualsDeclarations.map(d => d.name))
|
||||
// find read-only references to `nls`
|
||||
.map(n => service.getReferencesAtPosition(filename, n.pos + 1))
|
||||
.flatten()
|
||||
.filter(function (r) { return !r.isWriteAccess; })
|
||||
.map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); })
|
||||
.map(function (a) { return lazy(a).last(); })
|
||||
.filter(function (n) { return !!n; })
|
||||
.map(function (n) { return n; })
|
||||
.filter(function (n) { return n.expression.kind === ts.SyntaxKind.PropertyAccessExpression && n.expression.name.getText() === 'localize'; });
|
||||
.filter(r => !r.isWriteAccess)
|
||||
// find the deepest call expressions AST nodes that contain those references
|
||||
.map(r => collect(sourceFile, n => isCallExpressionWithinTextSpanCollectStep(r.textSpan, n)))
|
||||
.map(a => lazy(a).last())
|
||||
.filter(n => !!n)
|
||||
.map(n => n)
|
||||
// only `localize` calls
|
||||
.filter(n => n.expression.kind === ts.SyntaxKind.PropertyAccessExpression && n.expression.name.getText() === 'localize');
|
||||
// `localize` named imports
|
||||
var allLocalizeImportDeclarations = importDeclarations
|
||||
.filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports; })
|
||||
.map(function (d) { return [].concat(d.importClause.namedBindings.elements); })
|
||||
const allLocalizeImportDeclarations = importDeclarations
|
||||
.filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports))
|
||||
.map(d => [].concat(d.importClause.namedBindings.elements))
|
||||
.flatten();
|
||||
// `localize` read-only references
|
||||
var localizeReferences = allLocalizeImportDeclarations
|
||||
.filter(function (d) { return d.name.getText() === 'localize'; })
|
||||
.map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); })
|
||||
const localizeReferences = allLocalizeImportDeclarations
|
||||
.filter(d => d.name.getText() === 'localize')
|
||||
.map(n => service.getReferencesAtPosition(filename, n.pos + 1))
|
||||
.flatten()
|
||||
.filter(function (r) { return !r.isWriteAccess; });
|
||||
.filter(r => !r.isWriteAccess);
|
||||
// custom named `localize` read-only references
|
||||
var namedLocalizeReferences = allLocalizeImportDeclarations
|
||||
.filter(function (d) { return d.propertyName && d.propertyName.getText() === 'localize'; })
|
||||
.map(function (n) { return service.getReferencesAtPosition(filename, n.name.pos + 1); })
|
||||
const namedLocalizeReferences = allLocalizeImportDeclarations
|
||||
.filter(d => d.propertyName && d.propertyName.getText() === 'localize')
|
||||
.map(n => service.getReferencesAtPosition(filename, n.name.pos + 1))
|
||||
.flatten()
|
||||
.filter(function (r) { return !r.isWriteAccess; });
|
||||
.filter(r => !r.isWriteAccess);
|
||||
// find the deepest call expressions AST nodes that contain those references
|
||||
var localizeCallExpressions = localizeReferences
|
||||
const localizeCallExpressions = localizeReferences
|
||||
.concat(namedLocalizeReferences)
|
||||
.map(function (r) { return collect(sourceFile, function (n) { return isCallExpressionWithinTextSpanCollectStep(r.textSpan, n); }); })
|
||||
.map(function (a) { return lazy(a).last(); })
|
||||
.filter(function (n) { return !!n; })
|
||||
.map(function (n) { return n; });
|
||||
.map(r => collect(sourceFile, n => isCallExpressionWithinTextSpanCollectStep(r.textSpan, n)))
|
||||
.map(a => lazy(a).last())
|
||||
.filter(n => !!n)
|
||||
.map(n => n);
|
||||
// collect everything
|
||||
var localizeCalls = nlsLocalizeCallExpressions
|
||||
const localizeCalls = nlsLocalizeCallExpressions
|
||||
.concat(localizeCallExpressions)
|
||||
.map(function (e) { return e.arguments; })
|
||||
.filter(function (a) { return a.length > 1; })
|
||||
.sort(function (a, b) { return a[0].getStart() - b[0].getStart(); })
|
||||
.map(function (a) { return ({
|
||||
.map(e => e.arguments)
|
||||
.filter(a => a.length > 1)
|
||||
.sort((a, b) => a[0].getStart() - b[0].getStart())
|
||||
.map(a => ({
|
||||
keySpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[0].getEnd()) },
|
||||
key: a[0].getText(),
|
||||
valueSpan: { start: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getStart()), end: ts.getLineAndCharacterOfPosition(sourceFile, a[1].getEnd()) },
|
||||
value: a[1].getText()
|
||||
}); });
|
||||
}));
|
||||
return {
|
||||
localizeCalls: localizeCalls.toArray(),
|
||||
nlsExpressions: nlsExpressions.toArray()
|
||||
};
|
||||
}
|
||||
nls_1.analyze = analyze;
|
||||
var TextModel = /** @class */ (function () {
|
||||
function TextModel(contents) {
|
||||
var regex = /\r\n|\r|\n/g;
|
||||
var index = 0;
|
||||
var match;
|
||||
class TextModel {
|
||||
constructor(contents) {
|
||||
const regex = /\r\n|\r|\n/g;
|
||||
let index = 0;
|
||||
let match;
|
||||
this.lines = [];
|
||||
this.lineEndings = [];
|
||||
while (match = regex.exec(contents)) {
|
||||
@@ -217,85 +217,80 @@ function isImportNode(node) {
|
||||
this.lineEndings.push('');
|
||||
}
|
||||
}
|
||||
TextModel.prototype.get = function (index) {
|
||||
get(index) {
|
||||
return this.lines[index];
|
||||
};
|
||||
TextModel.prototype.set = function (index, line) {
|
||||
}
|
||||
set(index, line) {
|
||||
this.lines[index] = line;
|
||||
};
|
||||
Object.defineProperty(TextModel.prototype, "lineCount", {
|
||||
get: function () {
|
||||
return this.lines.length;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
get lineCount() {
|
||||
return this.lines.length;
|
||||
}
|
||||
/**
|
||||
* Applies patch(es) to the model.
|
||||
* Multiple patches must be ordered.
|
||||
* Does not support patches spanning multiple lines.
|
||||
*/
|
||||
TextModel.prototype.apply = function (patch) {
|
||||
var startLineNumber = patch.span.start.line;
|
||||
var endLineNumber = patch.span.end.line;
|
||||
var startLine = this.lines[startLineNumber] || '';
|
||||
var endLine = this.lines[endLineNumber] || '';
|
||||
apply(patch) {
|
||||
const startLineNumber = patch.span.start.line;
|
||||
const endLineNumber = patch.span.end.line;
|
||||
const startLine = this.lines[startLineNumber] || '';
|
||||
const endLine = this.lines[endLineNumber] || '';
|
||||
this.lines[startLineNumber] = [
|
||||
startLine.substring(0, patch.span.start.character),
|
||||
patch.content,
|
||||
endLine.substring(patch.span.end.character)
|
||||
].join('');
|
||||
for (var i = startLineNumber + 1; i <= endLineNumber; i++) {
|
||||
for (let i = startLineNumber + 1; i <= endLineNumber; i++) {
|
||||
this.lines[i] = '';
|
||||
}
|
||||
};
|
||||
TextModel.prototype.toString = function () {
|
||||
}
|
||||
toString() {
|
||||
return lazy(this.lines).zip(this.lineEndings)
|
||||
.flatten().toArray().join('');
|
||||
};
|
||||
return TextModel;
|
||||
}());
|
||||
}
|
||||
}
|
||||
nls_1.TextModel = TextModel;
|
||||
function patchJavascript(patches, contents, moduleId) {
|
||||
var model = new nls.TextModel(contents);
|
||||
const model = new nls.TextModel(contents);
|
||||
// patch the localize calls
|
||||
lazy(patches).reverse().each(function (p) { return model.apply(p); });
|
||||
lazy(patches).reverse().each(p => model.apply(p));
|
||||
// patch the 'vs/nls' imports
|
||||
var firstLine = model.get(0);
|
||||
var patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1");
|
||||
const firstLine = model.get(0);
|
||||
const patchedFirstLine = firstLine.replace(/(['"])vs\/nls\1/g, `$1vs/nls!${moduleId}$1`);
|
||||
model.set(0, patchedFirstLine);
|
||||
return model.toString();
|
||||
}
|
||||
nls_1.patchJavascript = patchJavascript;
|
||||
function patchSourcemap(patches, rsm, smc) {
|
||||
var smg = new sm.SourceMapGenerator({
|
||||
const smg = new sm.SourceMapGenerator({
|
||||
file: rsm.file,
|
||||
sourceRoot: rsm.sourceRoot
|
||||
});
|
||||
patches = patches.reverse();
|
||||
var currentLine = -1;
|
||||
var currentLineDiff = 0;
|
||||
var source = null;
|
||||
smc.eachMapping(function (m) {
|
||||
var patch = patches[patches.length - 1];
|
||||
var original = { line: m.originalLine, column: m.originalColumn };
|
||||
var generated = { line: m.generatedLine, column: m.generatedColumn };
|
||||
let currentLine = -1;
|
||||
let currentLineDiff = 0;
|
||||
let source = null;
|
||||
smc.eachMapping(m => {
|
||||
const patch = patches[patches.length - 1];
|
||||
const original = { line: m.originalLine, column: m.originalColumn };
|
||||
const generated = { line: m.generatedLine, column: m.generatedColumn };
|
||||
if (currentLine !== generated.line) {
|
||||
currentLineDiff = 0;
|
||||
}
|
||||
currentLine = generated.line;
|
||||
generated.column += currentLineDiff;
|
||||
if (patch && m.generatedLine - 1 === patch.span.end.line && m.generatedColumn === patch.span.end.character) {
|
||||
var originalLength = patch.span.end.character - patch.span.start.character;
|
||||
var modifiedLength = patch.content.length;
|
||||
var lengthDiff = modifiedLength - originalLength;
|
||||
const originalLength = patch.span.end.character - patch.span.start.character;
|
||||
const modifiedLength = patch.content.length;
|
||||
const lengthDiff = modifiedLength - originalLength;
|
||||
currentLineDiff += lengthDiff;
|
||||
generated.column += lengthDiff;
|
||||
patches.pop();
|
||||
}
|
||||
source = rsm.sourceRoot ? path.relative(rsm.sourceRoot, m.source) : m.source;
|
||||
source = source.replace(/\\/g, '/');
|
||||
smg.addMapping({ source: source, name: m.name, original: original, generated: generated });
|
||||
smg.addMapping({ source, name: m.name, original, generated });
|
||||
}, null, sm.SourceMapConsumer.GENERATED_ORDER);
|
||||
if (source) {
|
||||
smg.setSourceContent(source, smc.sourceContentFor(source));
|
||||
@@ -304,47 +299,47 @@ function isImportNode(node) {
|
||||
}
|
||||
nls_1.patchSourcemap = patchSourcemap;
|
||||
function patch(moduleId, typescript, javascript, sourcemap) {
|
||||
var _a = analyze(typescript), localizeCalls = _a.localizeCalls, nlsExpressions = _a.nlsExpressions;
|
||||
const { localizeCalls, nlsExpressions } = analyze(typescript);
|
||||
if (localizeCalls.length === 0) {
|
||||
return { javascript: javascript, sourcemap: sourcemap };
|
||||
return { javascript, sourcemap };
|
||||
}
|
||||
var nlsKeys = template(localizeCalls.map(function (lc) { return lc.key; }));
|
||||
var nls = template(localizeCalls.map(function (lc) { return lc.value; }));
|
||||
var smc = new sm.SourceMapConsumer(sourcemap);
|
||||
var positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]);
|
||||
var i = 0;
|
||||
const nlsKeys = template(localizeCalls.map(lc => lc.key));
|
||||
const nls = template(localizeCalls.map(lc => lc.value));
|
||||
const smc = new sm.SourceMapConsumer(sourcemap);
|
||||
const positionFrom = mappedPositionFrom.bind(null, sourcemap.sources[0]);
|
||||
let i = 0;
|
||||
// build patches
|
||||
var patches = lazy(localizeCalls)
|
||||
.map(function (lc) { return ([
|
||||
const patches = lazy(localizeCalls)
|
||||
.map(lc => ([
|
||||
{ range: lc.keySpan, content: '' + (i++) },
|
||||
{ range: lc.valueSpan, content: 'null' }
|
||||
]); })
|
||||
]))
|
||||
.flatten()
|
||||
.map(function (c) {
|
||||
var start = lcFrom(smc.generatedPositionFor(positionFrom(c.range.start)));
|
||||
var end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end)));
|
||||
return { span: { start: start, end: end }, content: c.content };
|
||||
.map(c => {
|
||||
const start = lcFrom(smc.generatedPositionFor(positionFrom(c.range.start)));
|
||||
const end = lcFrom(smc.generatedPositionFor(positionFrom(c.range.end)));
|
||||
return { span: { start, end }, content: c.content };
|
||||
})
|
||||
.toArray();
|
||||
javascript = patchJavascript(patches, javascript, moduleId);
|
||||
// since imports are not within the sourcemap information,
|
||||
// we must do this MacGyver style
|
||||
if (nlsExpressions.length) {
|
||||
javascript = javascript.replace(/^define\(.*$/m, function (line) {
|
||||
return line.replace(/(['"])vs\/nls\1/g, "$1vs/nls!" + moduleId + "$1");
|
||||
javascript = javascript.replace(/^define\(.*$/m, line => {
|
||||
return line.replace(/(['"])vs\/nls\1/g, `$1vs/nls!${moduleId}$1`);
|
||||
});
|
||||
}
|
||||
sourcemap = patchSourcemap(patches, sourcemap, smc);
|
||||
return { javascript: javascript, sourcemap: sourcemap, nlsKeys: nlsKeys, nls: nls };
|
||||
return { javascript, sourcemap, nlsKeys, nls };
|
||||
}
|
||||
nls_1.patch = patch;
|
||||
function patchFiles(javascriptFile, typescript) {
|
||||
// hack?
|
||||
var moduleId = javascriptFile.relative
|
||||
const moduleId = javascriptFile.relative
|
||||
.replace(/\.js$/, '')
|
||||
.replace(/\\/g, '/');
|
||||
var _a = patch(moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap), javascript = _a.javascript, sourcemap = _a.sourcemap, nlsKeys = _a.nlsKeys, nls = _a.nls;
|
||||
var result = [fileFrom(javascriptFile, javascript)];
|
||||
const { javascript, sourcemap, nlsKeys, nls } = patch(moduleId, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap);
|
||||
const result = [fileFrom(javascriptFile, javascript)];
|
||||
result[0].sourceMap = sourcemap;
|
||||
if (nlsKeys) {
|
||||
result.push(fileFrom(javascriptFile, nlsKeys, javascriptFile.path.replace(/\.js$/, '.nls.keys.js')));
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
import * as ts from 'typescript';
|
||||
import * as lazy from 'lazy.js';
|
||||
import { duplex, through } from 'event-stream';
|
||||
import File = require('vinyl');
|
||||
import * as File from 'vinyl';
|
||||
import * as sm from 'source-map';
|
||||
import assign = require('object-assign');
|
||||
import path = require('path');
|
||||
import * as path from 'path';
|
||||
|
||||
declare class FileSourceMap extends File {
|
||||
public sourceMap: sm.RawSourceMap;
|
||||
@@ -26,7 +25,7 @@ function collect(node: ts.Node, fn: (node: ts.Node) => CollectStepResult): ts.No
|
||||
const result: ts.Node[] = [];
|
||||
|
||||
function loop(node: ts.Node) {
|
||||
var stepResult = fn(node);
|
||||
const stepResult = fn(node);
|
||||
|
||||
if (stepResult === CollectStepResult.Yes || stepResult === CollectStepResult.YesAndRecurse) {
|
||||
result.push(node);
|
||||
@@ -42,8 +41,8 @@ function collect(node: ts.Node, fn: (node: ts.Node) => CollectStepResult): ts.No
|
||||
}
|
||||
|
||||
function clone<T>(object: T): T {
|
||||
var result = <T>{};
|
||||
for (var id in object) {
|
||||
const result = <T>{};
|
||||
for (const id in object) {
|
||||
result[id] = object[id];
|
||||
}
|
||||
return result;
|
||||
@@ -67,8 +66,8 @@ define([], [${ wrap + lines.map(l => indent + l).join(',\n') + wrap}]);`;
|
||||
* Returns a stream containing the patched JavaScript and source maps.
|
||||
*/
|
||||
function nls(): NodeJS.ReadWriteStream {
|
||||
var input = through();
|
||||
var output = input.pipe(through(function (f: FileSourceMap) {
|
||||
const input = through();
|
||||
const output = input.pipe(through(function (f: FileSourceMap) {
|
||||
if (!f.sourceMap) {
|
||||
return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
|
||||
}
|
||||
@@ -83,7 +82,7 @@ function nls(): NodeJS.ReadWriteStream {
|
||||
source = path.join(root, source);
|
||||
}
|
||||
|
||||
const typescript = f.sourceMap.sourcesContent[0];
|
||||
const typescript = f.sourceMap.sourcesContent![0];
|
||||
if (!typescript) {
|
||||
return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`));
|
||||
}
|
||||
@@ -131,7 +130,7 @@ module nls {
|
||||
|
||||
export function fileFrom(file: File, contents: string, path: string = file.path) {
|
||||
return new File({
|
||||
contents: new Buffer(contents),
|
||||
contents: Buffer.from(contents),
|
||||
base: file.base,
|
||||
cwd: file.cwd,
|
||||
path: path
|
||||
@@ -174,7 +173,7 @@ module nls {
|
||||
|
||||
export function analyze(contents: string, options: ts.CompilerOptions = {}): ILocalizeAnalysisResult {
|
||||
const filename = 'file.ts';
|
||||
const serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents);
|
||||
const serviceHost = new SingleFileServiceHost(Object.assign(clone(options), { noResolve: true }), filename, contents);
|
||||
const service = ts.createLanguageService(serviceHost);
|
||||
const sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true);
|
||||
|
||||
@@ -206,8 +205,8 @@ module nls {
|
||||
|
||||
// `nls.localize(...)` calls
|
||||
const nlsLocalizeCallExpressions = importDeclarations
|
||||
.filter(d => d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport)
|
||||
.map(d => (<ts.NamespaceImport>d.importClause.namedBindings).name)
|
||||
.filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport))
|
||||
.map(d => (<ts.NamespaceImport>d.importClause!.namedBindings).name)
|
||||
.concat(importEqualsDeclarations.map(d => d.name))
|
||||
|
||||
// find read-only references to `nls`
|
||||
@@ -226,8 +225,8 @@ module nls {
|
||||
|
||||
// `localize` named imports
|
||||
const allLocalizeImportDeclarations = importDeclarations
|
||||
.filter(d => d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports)
|
||||
.map(d => [].concat((<ts.NamedImports>d.importClause.namedBindings).elements))
|
||||
.filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports))
|
||||
.map(d => ([] as any[]).concat((<ts.NamedImports>d.importClause!.namedBindings!).elements))
|
||||
.flatten();
|
||||
|
||||
// `localize` read-only references
|
||||
@@ -279,7 +278,7 @@ module nls {
|
||||
constructor(contents: string) {
|
||||
const regex = /\r\n|\r|\n/g;
|
||||
let index = 0;
|
||||
let match: RegExpExecArray;
|
||||
let match: RegExpExecArray | null;
|
||||
|
||||
this.lines = [];
|
||||
this.lineEndings = [];
|
||||
@@ -360,7 +359,7 @@ module nls {
|
||||
patches = patches.reverse();
|
||||
let currentLine = -1;
|
||||
let currentLineDiff = 0;
|
||||
let source = null;
|
||||
let source: string | null = null;
|
||||
|
||||
smc.eachMapping(m => {
|
||||
const patch = patches[patches.length - 1];
|
||||
|
||||
@@ -4,30 +4,32 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var path = require("path");
|
||||
var gulp = require("gulp");
|
||||
var sourcemaps = require("gulp-sourcemaps");
|
||||
var filter = require("gulp-filter");
|
||||
var minifyCSS = require("gulp-cssnano");
|
||||
var uglify = require("gulp-uglify");
|
||||
var composer = require("gulp-uglify/composer");
|
||||
var uglifyes = require("uglify-es");
|
||||
var es = require("event-stream");
|
||||
var concat = require("gulp-concat");
|
||||
var VinylFile = require("vinyl");
|
||||
var bundle = require("./bundle");
|
||||
var util = require("./util");
|
||||
var i18n = require("./i18n");
|
||||
var gulpUtil = require("gulp-util");
|
||||
var flatmap = require("gulp-flatmap");
|
||||
var pump = require("pump");
|
||||
var REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||
const es = require("event-stream");
|
||||
const gulp = require("gulp");
|
||||
const concat = require("gulp-concat");
|
||||
const minifyCSS = require("gulp-cssnano");
|
||||
const filter = require("gulp-filter");
|
||||
const flatmap = require("gulp-flatmap");
|
||||
const sourcemaps = require("gulp-sourcemaps");
|
||||
const uglify = require("gulp-uglify");
|
||||
const composer = require("gulp-uglify/composer");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const path = require("path");
|
||||
const pump = require("pump");
|
||||
const uglifyes = require("uglify-es");
|
||||
const VinylFile = require("vinyl");
|
||||
const bundle = require("./bundle");
|
||||
const i18n_1 = require("./i18n");
|
||||
const stats_1 = require("./stats");
|
||||
const util = require("./util");
|
||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||
function log(prefix, message) {
|
||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
||||
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||
}
|
||||
// {{SQL CARBON EDIT}}
|
||||
function loaderConfig(emptyPaths) {
|
||||
var result = {
|
||||
const result = {
|
||||
paths: {
|
||||
'vs': 'out-build/vs',
|
||||
'sql': 'out-build/sql',
|
||||
@@ -39,27 +41,27 @@ function loaderConfig(emptyPaths) {
|
||||
return result;
|
||||
}
|
||||
exports.loaderConfig = loaderConfig;
|
||||
var IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i;
|
||||
function loader(bundledFileHeader, bundleLoader) {
|
||||
var sources = [
|
||||
'out-build/vs/loader.js'
|
||||
const IS_OUR_COPYRIGHT_REGEXP = /Copyright \(C\) Microsoft Corporation/i;
|
||||
function loader(src, bundledFileHeader, bundleLoader) {
|
||||
let sources = [
|
||||
`${src}/vs/loader.js`
|
||||
];
|
||||
if (bundleLoader) {
|
||||
sources = sources.concat([
|
||||
'out-build/vs/css.js',
|
||||
'out-build/vs/nls.js'
|
||||
`${src}/vs/css.js`,
|
||||
`${src}/vs/nls.js`
|
||||
]);
|
||||
}
|
||||
var isFirst = true;
|
||||
let isFirst = true;
|
||||
return (gulp
|
||||
.src(sources, { base: 'out-build' })
|
||||
.src(sources, { base: `${src}` })
|
||||
.pipe(es.through(function (data) {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
this.emit('data', new VinylFile({
|
||||
path: 'fake',
|
||||
base: '',
|
||||
contents: new Buffer(bundledFileHeader)
|
||||
base: undefined,
|
||||
contents: Buffer.from(bundledFileHeader)
|
||||
}));
|
||||
this.emit('data', data);
|
||||
}
|
||||
@@ -74,13 +76,13 @@ function loader(bundledFileHeader, bundleLoader) {
|
||||
return f;
|
||||
})));
|
||||
}
|
||||
function toConcatStream(bundledFileHeader, sources, dest) {
|
||||
var useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest);
|
||||
function toConcatStream(src, bundledFileHeader, sources, dest) {
|
||||
const useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest);
|
||||
// If a bundle ends up including in any of the sources our copyright, then
|
||||
// insert a fake source at the beginning of each bundle with our copyright
|
||||
var containsOurCopyright = false;
|
||||
for (var i = 0, len = sources.length; i < len; i++) {
|
||||
var fileContents = sources[i].contents;
|
||||
let containsOurCopyright = false;
|
||||
for (let i = 0, len = sources.length; i < len; i++) {
|
||||
const fileContents = sources[i].contents;
|
||||
if (IS_OUR_COPYRIGHT_REGEXP.test(fileContents)) {
|
||||
containsOurCopyright = true;
|
||||
break;
|
||||
@@ -92,102 +94,89 @@ function toConcatStream(bundledFileHeader, sources, dest) {
|
||||
contents: bundledFileHeader
|
||||
});
|
||||
}
|
||||
var treatedSources = sources.map(function (source) {
|
||||
var root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : '';
|
||||
var base = source.path ? root + '/out-build' : '';
|
||||
const treatedSources = sources.map(function (source) {
|
||||
const root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : '';
|
||||
const base = source.path ? root + `/${src}` : undefined;
|
||||
return new VinylFile({
|
||||
path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake',
|
||||
base: base,
|
||||
contents: new Buffer(source.contents)
|
||||
contents: Buffer.from(source.contents)
|
||||
});
|
||||
});
|
||||
return es.readArray(treatedSources)
|
||||
.pipe(useSourcemaps ? util.loadSourcemaps() : es.through())
|
||||
.pipe(concat(dest));
|
||||
.pipe(concat(dest))
|
||||
.pipe(stats_1.createStatsStream(dest));
|
||||
}
|
||||
function toBundleStream(bundledFileHeader, bundles) {
|
||||
function toBundleStream(src, bundledFileHeader, bundles) {
|
||||
return es.merge(bundles.map(function (bundle) {
|
||||
return toConcatStream(bundledFileHeader, bundle.sources, bundle.dest);
|
||||
return toConcatStream(src, bundledFileHeader, bundle.sources, bundle.dest);
|
||||
}));
|
||||
}
|
||||
function optimizeTask(opts) {
|
||||
var entryPoints = opts.entryPoints;
|
||||
var otherSources = opts.otherSources;
|
||||
var resources = opts.resources;
|
||||
var loaderConfig = opts.loaderConfig;
|
||||
var bundledFileHeader = opts.header;
|
||||
var bundleLoader = (typeof opts.bundleLoader === 'undefined' ? true : opts.bundleLoader);
|
||||
var out = opts.out;
|
||||
const src = opts.src;
|
||||
const entryPoints = opts.entryPoints;
|
||||
const resources = opts.resources;
|
||||
const loaderConfig = opts.loaderConfig;
|
||||
const bundledFileHeader = opts.header;
|
||||
const bundleLoader = (typeof opts.bundleLoader === 'undefined' ? true : opts.bundleLoader);
|
||||
const out = opts.out;
|
||||
return function () {
|
||||
var bundlesStream = es.through(); // this stream will contain the bundled files
|
||||
var resourcesStream = es.through(); // this stream will contain the resources
|
||||
var bundleInfoStream = es.through(); // this stream will contain bundleInfo.json
|
||||
const bundlesStream = es.through(); // this stream will contain the bundled files
|
||||
const resourcesStream = es.through(); // this stream will contain the resources
|
||||
const bundleInfoStream = es.through(); // this stream will contain bundleInfo.json
|
||||
bundle.bundle(entryPoints, loaderConfig, function (err, result) {
|
||||
if (err) {
|
||||
if (err || !result) {
|
||||
return bundlesStream.emit('error', JSON.stringify(err));
|
||||
}
|
||||
toBundleStream(bundledFileHeader, result.files).pipe(bundlesStream);
|
||||
toBundleStream(src, bundledFileHeader, result.files).pipe(bundlesStream);
|
||||
// Remove css inlined resources
|
||||
var filteredResources = resources.slice();
|
||||
const filteredResources = resources.slice();
|
||||
result.cssInlinedResources.forEach(function (resource) {
|
||||
if (process.env['VSCODE_BUILD_VERBOSE']) {
|
||||
log('optimizer', 'excluding inlined: ' + resource);
|
||||
}
|
||||
filteredResources.push('!' + resource);
|
||||
});
|
||||
gulp.src(filteredResources, { base: 'out-build' }).pipe(resourcesStream);
|
||||
var bundleInfoArray = [];
|
||||
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||
const bundleInfoArray = [];
|
||||
if (opts.bundleInfo) {
|
||||
bundleInfoArray.push(new VinylFile({
|
||||
path: 'bundleInfo.json',
|
||||
base: '.',
|
||||
contents: new Buffer(JSON.stringify(result.bundleData, null, '\t'))
|
||||
contents: Buffer.from(JSON.stringify(result.bundleData, null, '\t'))
|
||||
}));
|
||||
}
|
||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||
});
|
||||
var otherSourcesStream = es.through();
|
||||
var otherSourcesStreamArr = [];
|
||||
gulp.src(otherSources, { base: 'out-build' })
|
||||
.pipe(es.through(function (data) {
|
||||
otherSourcesStreamArr.push(toConcatStream(bundledFileHeader, [data], data.relative));
|
||||
}, function () {
|
||||
if (!otherSourcesStreamArr.length) {
|
||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
||||
}
|
||||
else {
|
||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
||||
}
|
||||
}));
|
||||
var result = es.merge(loader(bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
|
||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
|
||||
return result
|
||||
.pipe(sourcemaps.write('./', {
|
||||
sourceRoot: null,
|
||||
sourceRoot: undefined,
|
||||
addComment: true,
|
||||
includeContent: true
|
||||
}))
|
||||
.pipe(i18n.processNlsFiles({
|
||||
.pipe(opts.languages && opts.languages.length ? i18n_1.processNlsFiles({
|
||||
fileHeader: bundledFileHeader,
|
||||
languages: opts.languages
|
||||
}))
|
||||
}) : es.through())
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
}
|
||||
exports.optimizeTask = optimizeTask;
|
||||
;
|
||||
/**
|
||||
* Wrap around uglify and allow the preserveComments function
|
||||
* to have a file "context" to include our copyright only once per file.
|
||||
*/
|
||||
function uglifyWithCopyrights() {
|
||||
var preserveComments = function (f) {
|
||||
return function (node, comment) {
|
||||
var text = comment.value;
|
||||
var type = comment.type;
|
||||
const preserveComments = (f) => {
|
||||
return (_node, comment) => {
|
||||
const text = comment.value;
|
||||
const type = comment.type;
|
||||
if (/@minifier_do_not_preserve/.test(text)) {
|
||||
return false;
|
||||
}
|
||||
var isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text);
|
||||
const isOurCopyright = IS_OUR_COPYRIGHT_REGEXP.test(text);
|
||||
if (isOurCopyright) {
|
||||
if (f.__hasOurCopyright) {
|
||||
return false;
|
||||
@@ -205,10 +194,10 @@ function uglifyWithCopyrights() {
|
||||
return false;
|
||||
};
|
||||
};
|
||||
var minify = composer(uglifyes);
|
||||
var input = es.through();
|
||||
var output = input
|
||||
.pipe(flatmap(function (stream, f) {
|
||||
const minify = composer(uglifyes);
|
||||
const input = es.through();
|
||||
const output = input
|
||||
.pipe(flatmap((stream, f) => {
|
||||
return stream.pipe(minify({
|
||||
output: {
|
||||
comments: preserveComments(f),
|
||||
@@ -219,22 +208,26 @@ function uglifyWithCopyrights() {
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
function minifyTask(src, sourceMapBaseUrl) {
|
||||
var sourceMappingURL = sourceMapBaseUrl && (function (f) { return sourceMapBaseUrl + "/" + f.relative + ".map"; });
|
||||
return function (cb) {
|
||||
var jsFilter = filter('**/*.js', { restore: true });
|
||||
var cssFilter = filter('**/*.css', { restore: true });
|
||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', {
|
||||
sourceMappingURL: sourceMappingURL,
|
||||
sourceRoot: null,
|
||||
const sourceMappingURL = sourceMapBaseUrl ? ((f) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
|
||||
return cb => {
|
||||
const jsFilter = filter('**/*.js', { restore: true });
|
||||
const cssFilter = filter('**/*.css', { restore: true });
|
||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||
if (sourcePath === 'bootstrap-fork.js') {
|
||||
return 'bootstrap-fork.orig.js';
|
||||
}
|
||||
return sourcePath;
|
||||
}), sourcemaps.write('./', {
|
||||
sourceMappingURL,
|
||||
sourceRoot: undefined,
|
||||
includeContent: true,
|
||||
addComment: true
|
||||
}), gulp.dest(src + '-min'), function (err) {
|
||||
}), gulp.dest(src + '-min'), (err) => {
|
||||
if (err instanceof uglify.GulpUglifyError) {
|
||||
console.error("Uglify error in '" + (err.cause && err.cause.filename) + "'");
|
||||
console.error(`Uglify error in '${err.cause && err.cause.filename}'`);
|
||||
}
|
||||
cb(err);
|
||||
});
|
||||
};
|
||||
}
|
||||
exports.minifyTask = minifyTask;
|
||||
;
|
||||
|
||||
@@ -5,34 +5,36 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as es from 'event-stream';
|
||||
import * as gulp from 'gulp';
|
||||
import * as sourcemaps from 'gulp-sourcemaps';
|
||||
import * as filter from 'gulp-filter';
|
||||
import * as concat from 'gulp-concat';
|
||||
import * as minifyCSS from 'gulp-cssnano';
|
||||
import * as filter from 'gulp-filter';
|
||||
import * as flatmap from 'gulp-flatmap';
|
||||
import * as sourcemaps from 'gulp-sourcemaps';
|
||||
import * as uglify from 'gulp-uglify';
|
||||
import * as composer from 'gulp-uglify/composer';
|
||||
import * as uglifyes from 'uglify-es';
|
||||
import * as es from 'event-stream';
|
||||
import * as concat from 'gulp-concat';
|
||||
import * as VinylFile from 'vinyl';
|
||||
import * as bundle from './bundle';
|
||||
import * as util from './util';
|
||||
import * as i18n from './i18n';
|
||||
import * as gulpUtil from 'gulp-util';
|
||||
import * as flatmap from 'gulp-flatmap';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as path from 'path';
|
||||
import * as pump from 'pump';
|
||||
import * as sm from 'source-map';
|
||||
import * as uglifyes from 'uglify-es';
|
||||
import * as VinylFile from 'vinyl';
|
||||
import * as bundle from './bundle';
|
||||
import { Language, processNlsFiles } from './i18n';
|
||||
import { createStatsStream } from './stats';
|
||||
import * as util from './util';
|
||||
|
||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||
|
||||
function log(prefix: string, message: string): void {
|
||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
||||
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
export function loaderConfig(emptyPaths: string[]) {
|
||||
const result = {
|
||||
export function loaderConfig(emptyPaths?: string[]) {
|
||||
const result: any = {
|
||||
paths: {
|
||||
'vs': 'out-build/vs',
|
||||
'sql': 'out-build/sql',
|
||||
@@ -52,28 +54,28 @@ declare class FileSourceMap extends VinylFile {
|
||||
public sourceMap: sm.RawSourceMap;
|
||||
}
|
||||
|
||||
function loader(bundledFileHeader: string, bundleLoader: boolean): NodeJS.ReadWriteStream {
|
||||
function loader(src: string, bundledFileHeader: string, bundleLoader: boolean): NodeJS.ReadWriteStream {
|
||||
let sources = [
|
||||
'out-build/vs/loader.js'
|
||||
`${src}/vs/loader.js`
|
||||
];
|
||||
if (bundleLoader) {
|
||||
sources = sources.concat([
|
||||
'out-build/vs/css.js',
|
||||
'out-build/vs/nls.js'
|
||||
`${src}/vs/css.js`,
|
||||
`${src}/vs/nls.js`
|
||||
]);
|
||||
}
|
||||
|
||||
let isFirst = true;
|
||||
return (
|
||||
gulp
|
||||
.src(sources, { base: 'out-build' })
|
||||
.src(sources, { base: `${src}` })
|
||||
.pipe(es.through(function (data) {
|
||||
if (isFirst) {
|
||||
isFirst = false;
|
||||
this.emit('data', new VinylFile({
|
||||
path: 'fake',
|
||||
base: '',
|
||||
contents: new Buffer(bundledFileHeader)
|
||||
base: undefined,
|
||||
contents: Buffer.from(bundledFileHeader)
|
||||
}));
|
||||
this.emit('data', data);
|
||||
} else {
|
||||
@@ -89,7 +91,7 @@ function loader(bundledFileHeader: string, bundleLoader: boolean): NodeJS.ReadWr
|
||||
);
|
||||
}
|
||||
|
||||
function toConcatStream(bundledFileHeader: string, sources: bundle.IFile[], dest: string): NodeJS.ReadWriteStream {
|
||||
function toConcatStream(src: string, bundledFileHeader: string, sources: bundle.IFile[], dest: string): NodeJS.ReadWriteStream {
|
||||
const useSourcemaps = /\.js$/.test(dest) && !/\.nls\.js$/.test(dest);
|
||||
|
||||
// If a bundle ends up including in any of the sources our copyright, then
|
||||
@@ -112,35 +114,36 @@ function toConcatStream(bundledFileHeader: string, sources: bundle.IFile[], dest
|
||||
|
||||
const treatedSources = sources.map(function (source) {
|
||||
const root = source.path ? REPO_ROOT_PATH.replace(/\\/g, '/') : '';
|
||||
const base = source.path ? root + '/out-build' : '';
|
||||
const base = source.path ? root + `/${src}` : undefined;
|
||||
|
||||
return new VinylFile({
|
||||
path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake',
|
||||
base: base,
|
||||
contents: new Buffer(source.contents)
|
||||
contents: Buffer.from(source.contents)
|
||||
});
|
||||
});
|
||||
|
||||
return es.readArray(treatedSources)
|
||||
.pipe(useSourcemaps ? util.loadSourcemaps() : es.through())
|
||||
.pipe(concat(dest));
|
||||
.pipe(concat(dest))
|
||||
.pipe(createStatsStream(dest));
|
||||
}
|
||||
|
||||
function toBundleStream(bundledFileHeader: string, bundles: bundle.IConcatFile[]): NodeJS.ReadWriteStream {
|
||||
function toBundleStream(src: string, bundledFileHeader: string, bundles: bundle.IConcatFile[]): NodeJS.ReadWriteStream {
|
||||
return es.merge(bundles.map(function (bundle) {
|
||||
return toConcatStream(bundledFileHeader, bundle.sources, bundle.dest);
|
||||
return toConcatStream(src, bundledFileHeader, bundle.sources, bundle.dest);
|
||||
}));
|
||||
}
|
||||
|
||||
export interface IOptimizeTaskOpts {
|
||||
/**
|
||||
* The folder to read files from.
|
||||
*/
|
||||
src: string;
|
||||
/**
|
||||
* (for AMD files, will get bundled and get Copyright treatment)
|
||||
*/
|
||||
entryPoints: bundle.IEntryPoint[];
|
||||
/**
|
||||
* (for non-AMD files that should get Copyright treatment)
|
||||
*/
|
||||
otherSources: string[];
|
||||
/**
|
||||
* (svg, etc.)
|
||||
*/
|
||||
@@ -163,13 +166,14 @@ export interface IOptimizeTaskOpts {
|
||||
*/
|
||||
out: string;
|
||||
/**
|
||||
* (languages to process)
|
||||
* (out folder name)
|
||||
*/
|
||||
languages: string[];
|
||||
languages?: Language[];
|
||||
}
|
||||
|
||||
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
||||
const src = opts.src;
|
||||
const entryPoints = opts.entryPoints;
|
||||
const otherSources = opts.otherSources;
|
||||
const resources = opts.resources;
|
||||
const loaderConfig = opts.loaderConfig;
|
||||
const bundledFileHeader = opts.header;
|
||||
@@ -182,9 +186,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
||||
const bundleInfoStream = es.through(); // this stream will contain bundleInfo.json
|
||||
|
||||
bundle.bundle(entryPoints, loaderConfig, function (err, result) {
|
||||
if (err) { return bundlesStream.emit('error', JSON.stringify(err)); }
|
||||
if (err || !result) { return bundlesStream.emit('error', JSON.stringify(err)); }
|
||||
|
||||
toBundleStream(bundledFileHeader, result.files).pipe(bundlesStream);
|
||||
toBundleStream(src, bundledFileHeader, result.files).pipe(bundlesStream);
|
||||
|
||||
// Remove css inlined resources
|
||||
const filteredResources = resources.slice();
|
||||
@@ -194,54 +198,39 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
||||
}
|
||||
filteredResources.push('!' + resource);
|
||||
});
|
||||
gulp.src(filteredResources, { base: 'out-build' }).pipe(resourcesStream);
|
||||
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||
|
||||
const bundleInfoArray: VinylFile[] = [];
|
||||
if (opts.bundleInfo) {
|
||||
bundleInfoArray.push(new VinylFile({
|
||||
path: 'bundleInfo.json',
|
||||
base: '.',
|
||||
contents: new Buffer(JSON.stringify(result.bundleData, null, '\t'))
|
||||
contents: Buffer.from(JSON.stringify(result.bundleData, null, '\t'))
|
||||
}));
|
||||
}
|
||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||
});
|
||||
|
||||
const otherSourcesStream = es.through();
|
||||
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
|
||||
|
||||
gulp.src(otherSources, { base: 'out-build' })
|
||||
.pipe(es.through(function (data) {
|
||||
otherSourcesStreamArr.push(toConcatStream(bundledFileHeader, [data], data.relative));
|
||||
}, function () {
|
||||
if (!otherSourcesStreamArr.length) {
|
||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
||||
} else {
|
||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
||||
}
|
||||
}));
|
||||
|
||||
const result = es.merge(
|
||||
loader(bundledFileHeader, bundleLoader),
|
||||
loader(src, bundledFileHeader, bundleLoader),
|
||||
bundlesStream,
|
||||
otherSourcesStream,
|
||||
resourcesStream,
|
||||
bundleInfoStream
|
||||
);
|
||||
|
||||
return result
|
||||
.pipe(sourcemaps.write('./', {
|
||||
sourceRoot: null,
|
||||
sourceRoot: undefined,
|
||||
addComment: true,
|
||||
includeContent: true
|
||||
}))
|
||||
.pipe(i18n.processNlsFiles({
|
||||
.pipe(opts.languages && opts.languages.length ? processNlsFiles({
|
||||
fileHeader: bundledFileHeader,
|
||||
languages: opts.languages
|
||||
}))
|
||||
}) : es.through())
|
||||
.pipe(gulp.dest(out));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
declare class FileWithCopyright extends VinylFile {
|
||||
public __hasOurCopyright: boolean;
|
||||
@@ -252,7 +241,7 @@ declare class FileWithCopyright extends VinylFile {
|
||||
*/
|
||||
function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
|
||||
const preserveComments = (f: FileWithCopyright) => {
|
||||
return (node, comment: { value: string; type: string; }) => {
|
||||
return (_node: any, comment: { value: string; type: string; }) => {
|
||||
const text = comment.value;
|
||||
const type = comment.type;
|
||||
|
||||
@@ -280,7 +269,7 @@ function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
|
||||
};
|
||||
};
|
||||
|
||||
const minify = composer(uglifyes);
|
||||
const minify = (composer as any)(uglifyes);
|
||||
const input = es.through();
|
||||
const output = input
|
||||
.pipe(flatmap((stream, f) => {
|
||||
@@ -295,8 +284,8 @@ function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
export function minifyTask(src: string, sourceMapBaseUrl: string): (cb: any) => void {
|
||||
const sourceMappingURL = sourceMapBaseUrl && (f => `${sourceMapBaseUrl}/${f.relative}.map`);
|
||||
export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) => void {
|
||||
const sourceMappingURL = sourceMapBaseUrl ? ((f: any) => `${sourceMapBaseUrl}/${f.relative}.map`) : undefined;
|
||||
|
||||
return cb => {
|
||||
const jsFilter = filter('**/*.js', { restore: true });
|
||||
@@ -311,19 +300,26 @@ export function minifyTask(src: string, sourceMapBaseUrl: string): (cb: any) =>
|
||||
cssFilter,
|
||||
minifyCSS({ reduceIdents: false }),
|
||||
cssFilter.restore,
|
||||
(<any>sourcemaps).mapSources((sourcePath: string) => {
|
||||
if (sourcePath === 'bootstrap-fork.js') {
|
||||
return 'bootstrap-fork.orig.js';
|
||||
}
|
||||
|
||||
return sourcePath;
|
||||
}),
|
||||
sourcemaps.write('./', {
|
||||
sourceMappingURL,
|
||||
sourceRoot: null,
|
||||
sourceRoot: undefined,
|
||||
includeContent: true,
|
||||
addComment: true
|
||||
}),
|
||||
} as any),
|
||||
gulp.dest(src + '-min')
|
||||
, (err: any) => {
|
||||
if (err instanceof uglify.GulpUglifyError) {
|
||||
if (err instanceof (uglify as any).GulpUglifyError) {
|
||||
console.error(`Uglify error in '${err.cause && err.cause.filename}'`);
|
||||
}
|
||||
|
||||
cb(err);
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,20 +4,21 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var es = require("event-stream");
|
||||
var _ = require("underscore");
|
||||
var util = require("gulp-util");
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var allErrors = [];
|
||||
var startTime = null;
|
||||
var count = 0;
|
||||
const es = require("event-stream");
|
||||
const _ = require("underscore");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const allErrors = [];
|
||||
let startTime = null;
|
||||
let count = 0;
|
||||
function onStart() {
|
||||
if (count++ > 0) {
|
||||
return;
|
||||
}
|
||||
startTime = new Date().getTime();
|
||||
util.log("Starting " + util.colors.green('compilation') + "...");
|
||||
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||
}
|
||||
function onEnd() {
|
||||
if (--count > 0) {
|
||||
@@ -25,7 +26,7 @@ function onEnd() {
|
||||
}
|
||||
log();
|
||||
}
|
||||
var buildLogPath = path.join(path.dirname(path.dirname(__dirname)), '.build', 'log');
|
||||
const buildLogPath = path.join(path.dirname(path.dirname(__dirname)), '.build', 'log');
|
||||
try {
|
||||
fs.mkdirSync(path.dirname(buildLogPath));
|
||||
}
|
||||
@@ -33,51 +34,52 @@ catch (err) {
|
||||
// ignore
|
||||
}
|
||||
function log() {
|
||||
var errors = _.flatten(allErrors);
|
||||
errors.map(function (err) { return util.log(util.colors.red('Error') + ": " + err); });
|
||||
var regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||
var messages = errors
|
||||
.map(function (err) { return regex.exec(err); })
|
||||
.filter(function (match) { return !!match; })
|
||||
.map(function (_a) {
|
||||
var path = _a[1], line = _a[2], column = _a[3], message = _a[4];
|
||||
return ({ path: path, line: parseInt(line), column: parseInt(column), message: message });
|
||||
const errors = _.flatten(allErrors);
|
||||
const seen = new Set();
|
||||
errors.map(err => {
|
||||
if (!seen.has(err)) {
|
||||
seen.add(err);
|
||||
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||
}
|
||||
});
|
||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||
const messages = errors
|
||||
.map(err => regex.exec(err))
|
||||
.filter(match => !!match)
|
||||
.map(x => x)
|
||||
.map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message }));
|
||||
try {
|
||||
fs.writeFileSync(buildLogPath, JSON.stringify(messages));
|
||||
}
|
||||
catch (err) {
|
||||
//noop
|
||||
}
|
||||
util.log("Finished " + util.colors.green('compilation') + " with " + errors.length + " errors after " + util.colors.magenta((new Date().getTime() - startTime) + ' ms'));
|
||||
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||
}
|
||||
function createReporter() {
|
||||
var errors = [];
|
||||
const errors = [];
|
||||
allErrors.push(errors);
|
||||
var ReportFunc = /** @class */ (function () {
|
||||
function ReportFunc(err) {
|
||||
errors.push(err);
|
||||
}
|
||||
ReportFunc.hasErrors = function () {
|
||||
return errors.length > 0;
|
||||
};
|
||||
ReportFunc.end = function (emitError) {
|
||||
errors.length = 0;
|
||||
onStart();
|
||||
return es.through(null, function () {
|
||||
onEnd();
|
||||
if (emitError && errors.length > 0) {
|
||||
const result = (err) => errors.push(err);
|
||||
result.hasErrors = () => errors.length > 0;
|
||||
result.end = (emitError) => {
|
||||
errors.length = 0;
|
||||
onStart();
|
||||
return es.through(undefined, function () {
|
||||
onEnd();
|
||||
if (emitError && errors.length > 0) {
|
||||
if (!errors.__logged__) {
|
||||
log();
|
||||
this.emit('error');
|
||||
}
|
||||
else {
|
||||
this.emit('end');
|
||||
}
|
||||
});
|
||||
};
|
||||
return ReportFunc;
|
||||
}());
|
||||
return ReportFunc;
|
||||
errors.__logged__ = true;
|
||||
const err = new Error(`Found ${errors.length} errors`);
|
||||
err.__reporter__ = true;
|
||||
this.emit('error', err);
|
||||
}
|
||||
else {
|
||||
this.emit('end');
|
||||
}
|
||||
});
|
||||
};
|
||||
return result;
|
||||
}
|
||||
exports.createReporter = createReporter;
|
||||
;
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
import * as es from 'event-stream';
|
||||
import * as _ from 'underscore';
|
||||
import * as util from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
const allErrors: Error[][] = [];
|
||||
let startTime: number = null;
|
||||
const allErrors: string[][] = [];
|
||||
let startTime: number | null = null;
|
||||
let count = 0;
|
||||
|
||||
function onStart(): void {
|
||||
@@ -21,7 +22,7 @@ function onStart(): void {
|
||||
}
|
||||
|
||||
startTime = new Date().getTime();
|
||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
||||
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||
}
|
||||
|
||||
function onEnd(): void {
|
||||
@@ -42,12 +43,20 @@ try {
|
||||
|
||||
function log(): void {
|
||||
const errors = _.flatten(allErrors);
|
||||
errors.map(err => util.log(`${util.colors.red('Error')}: ${err}`));
|
||||
const seen = new Set<string>();
|
||||
|
||||
errors.map(err => {
|
||||
if (!seen.has(err)) {
|
||||
seen.add(err);
|
||||
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||
}
|
||||
});
|
||||
|
||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||
const messages = errors
|
||||
.map(err => regex.exec(err))
|
||||
.filter(match => !!match)
|
||||
.map(x => x as string[])
|
||||
.map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message }));
|
||||
|
||||
try {
|
||||
@@ -57,44 +66,45 @@ function log(): void {
|
||||
//noop
|
||||
}
|
||||
|
||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
||||
}
|
||||
|
||||
export interface IReporter {
|
||||
(err: Error): void;
|
||||
(err: string): void;
|
||||
hasErrors(): boolean;
|
||||
end(emitError: boolean): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
export function createReporter(): IReporter {
|
||||
const errors: Error[] = [];
|
||||
const errors: string[] = [];
|
||||
allErrors.push(errors);
|
||||
|
||||
class ReportFunc {
|
||||
constructor(err: Error) {
|
||||
errors.push(err);
|
||||
}
|
||||
const result = (err: string) => errors.push(err);
|
||||
|
||||
static hasErrors(): boolean {
|
||||
return errors.length > 0;
|
||||
}
|
||||
result.hasErrors = () => errors.length > 0;
|
||||
|
||||
static end(emitError: boolean): NodeJS.ReadWriteStream {
|
||||
errors.length = 0;
|
||||
onStart();
|
||||
result.end = (emitError: boolean): NodeJS.ReadWriteStream => {
|
||||
errors.length = 0;
|
||||
onStart();
|
||||
|
||||
return es.through(null, function () {
|
||||
onEnd();
|
||||
return es.through(undefined, function () {
|
||||
onEnd();
|
||||
|
||||
if (emitError && errors.length > 0) {
|
||||
if (emitError && errors.length > 0) {
|
||||
if (!(errors as any).__logged__) {
|
||||
log();
|
||||
this.emit('error');
|
||||
} else {
|
||||
this.emit('end');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return <IReporter><any>ReportFunc;
|
||||
};
|
||||
(errors as any).__logged__ = true;
|
||||
|
||||
const err = new Error(`Found ${errors.length} errors`);
|
||||
(err as any).__reporter__ = true;
|
||||
this.emit('error', err);
|
||||
} else {
|
||||
this.emit('end');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -5,35 +5,51 @@
|
||||
'use strict';
|
||||
var snaps;
|
||||
(function (snaps) {
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var os = require('os');
|
||||
var cp = require('child_process');
|
||||
var mksnapshot = path.join(__dirname, "../../node_modules/.bin/" + (process.platform === 'win32' ? 'mksnapshot.cmd' : 'mksnapshot'));
|
||||
var product = require('../../product.json');
|
||||
var arch = (process.argv.join('').match(/--arch=(.*)/) || [])[1];
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const cp = require('child_process');
|
||||
const mksnapshot = path.join(__dirname, `../../node_modules/.bin/${process.platform === 'win32' ? 'mksnapshot.cmd' : 'mksnapshot'}`);
|
||||
const product = require('../../product.json');
|
||||
const arch = (process.argv.join('').match(/--arch=(.*)/) || [])[1];
|
||||
//
|
||||
var loaderFilepath;
|
||||
var startupBlobFilepath;
|
||||
let loaderFilepath;
|
||||
let startupBlobFilepath;
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
loaderFilepath = "VSCode-darwin/" + product.nameLong + ".app/Contents/Resources/app/out/vs/loader.js";
|
||||
startupBlobFilepath = "VSCode-darwin/" + product.nameLong + ".app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin";
|
||||
loaderFilepath = `VSCode-darwin/${product.nameLong}.app/Contents/Resources/app/out/vs/loader.js`;
|
||||
startupBlobFilepath = `VSCode-darwin/${product.nameLong}.app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin`;
|
||||
break;
|
||||
case 'win32':
|
||||
case 'linux':
|
||||
loaderFilepath = "VSCode-" + process.platform + "-" + arch + "/resources/app/out/vs/loader.js";
|
||||
startupBlobFilepath = "VSCode-" + process.platform + "-" + arch + "/snapshot_blob.bin";
|
||||
loaderFilepath = `VSCode-${process.platform}-${arch}/resources/app/out/vs/loader.js`;
|
||||
startupBlobFilepath = `VSCode-${process.platform}-${arch}/snapshot_blob.bin`;
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unknown platform');
|
||||
}
|
||||
loaderFilepath = path.join(__dirname, '../../../', loaderFilepath);
|
||||
startupBlobFilepath = path.join(__dirname, '../../../', startupBlobFilepath);
|
||||
snapshotLoader(loaderFilepath, startupBlobFilepath);
|
||||
function snapshotLoader(loaderFilepath, startupBlobFilepath) {
|
||||
var inputFile = fs.readFileSync(loaderFilepath);
|
||||
var wrappedInputFile = "\n\t\tvar Monaco_Loader_Init;\n\t\t(function() {\n\t\t\tvar doNotInitLoader = true;\n\t\t\t" + inputFile.toString() + ";\n\t\t\tMonaco_Loader_Init = function() {\n\t\t\t\tAMDLoader.init();\n\t\t\t\tCSSLoaderPlugin.init();\n\t\t\t\tNLSLoaderPlugin.init();\n\n\t\t\t\treturn { define, require };\n\t\t\t}\n\t\t})();\n\t\t";
|
||||
var wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
|
||||
const inputFile = fs.readFileSync(loaderFilepath);
|
||||
const wrappedInputFile = `
|
||||
var Monaco_Loader_Init;
|
||||
(function() {
|
||||
var doNotInitLoader = true;
|
||||
${inputFile.toString()};
|
||||
Monaco_Loader_Init = function() {
|
||||
AMDLoader.init();
|
||||
CSSLoaderPlugin.init();
|
||||
NLSLoaderPlugin.init();
|
||||
|
||||
return { define, require };
|
||||
}
|
||||
})();
|
||||
`;
|
||||
const wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
|
||||
console.log(wrappedInputFilepath);
|
||||
fs.writeFileSync(wrappedInputFilepath, wrappedInputFile);
|
||||
cp.execFileSync(mksnapshot, [wrappedInputFilepath, "--startup_blob", startupBlobFilepath]);
|
||||
cp.execFileSync(mksnapshot, [wrappedInputFilepath, `--startup_blob`, startupBlobFilepath]);
|
||||
}
|
||||
})(snaps || (snaps = {}));
|
||||
|
||||
@@ -30,6 +30,10 @@ namespace snaps {
|
||||
case 'linux':
|
||||
loaderFilepath = `VSCode-${process.platform}-${arch}/resources/app/out/vs/loader.js`;
|
||||
startupBlobFilepath = `VSCode-${process.platform}-${arch}/snapshot_blob.bin`;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unknown platform');
|
||||
}
|
||||
|
||||
loaderFilepath = path.join(__dirname, '../../../', loaderFilepath);
|
||||
|
||||
307
build/lib/standalone.js
Normal file
307
build/lib/standalone.js
Normal file
@@ -0,0 +1,307 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const ts = require("typescript");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const tss = require("./treeshaking");
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
const SRC_DIR = path.join(REPO_ROOT, 'src');
|
||||
let dirCache = {};
|
||||
function writeFile(filePath, contents) {
|
||||
function ensureDirs(dirPath) {
|
||||
if (dirCache[dirPath]) {
|
||||
return;
|
||||
}
|
||||
dirCache[dirPath] = true;
|
||||
ensureDirs(path.dirname(dirPath));
|
||||
if (fs.existsSync(dirPath)) {
|
||||
return;
|
||||
}
|
||||
fs.mkdirSync(dirPath);
|
||||
}
|
||||
ensureDirs(path.dirname(filePath));
|
||||
fs.writeFileSync(filePath, contents);
|
||||
}
|
||||
function extractEditor(options) {
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||
let compilerOptions;
|
||||
if (tsConfig.extends) {
|
||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||
}
|
||||
else {
|
||||
compilerOptions = tsConfig.compilerOptions;
|
||||
}
|
||||
tsConfig.compilerOptions = compilerOptions;
|
||||
compilerOptions.noEmit = false;
|
||||
compilerOptions.noUnusedLocals = false;
|
||||
compilerOptions.preserveConstEnums = false;
|
||||
compilerOptions.declaration = false;
|
||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||
options.compilerOptions = compilerOptions;
|
||||
let result = tss.shake(options);
|
||||
for (let fileName in result) {
|
||||
if (result.hasOwnProperty(fileName)) {
|
||||
writeFile(path.join(options.destRoot, fileName), result[fileName]);
|
||||
}
|
||||
}
|
||||
let copied = {};
|
||||
const copyFile = (fileName) => {
|
||||
if (copied[fileName]) {
|
||||
return;
|
||||
}
|
||||
copied[fileName] = true;
|
||||
const srcPath = path.join(options.sourcesRoot, fileName);
|
||||
const dstPath = path.join(options.destRoot, fileName);
|
||||
writeFile(dstPath, fs.readFileSync(srcPath));
|
||||
};
|
||||
const writeOutputFile = (fileName, contents) => {
|
||||
writeFile(path.join(options.destRoot, fileName), contents);
|
||||
};
|
||||
for (let fileName in result) {
|
||||
if (result.hasOwnProperty(fileName)) {
|
||||
const fileContents = result[fileName];
|
||||
const info = ts.preProcessFile(fileContents);
|
||||
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
||||
const importedFileName = info.importedFiles[i].fileName;
|
||||
let importedFilePath;
|
||||
if (/^vs\/css!/.test(importedFileName)) {
|
||||
importedFilePath = importedFileName.substr('vs/css!'.length) + '.css';
|
||||
}
|
||||
else {
|
||||
importedFilePath = importedFileName;
|
||||
}
|
||||
if (/(^\.\/)|(^\.\.\/)/.test(importedFilePath)) {
|
||||
importedFilePath = path.join(path.dirname(fileName), importedFilePath);
|
||||
}
|
||||
if (/\.css$/.test(importedFilePath)) {
|
||||
transportCSS(importedFilePath, copyFile, writeOutputFile);
|
||||
}
|
||||
else {
|
||||
if (fs.existsSync(path.join(options.sourcesRoot, importedFilePath + '.js'))) {
|
||||
copyFile(importedFilePath + '.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delete tsConfig.compilerOptions.moduleResolution;
|
||||
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
||||
[
|
||||
'vs/css.build.js',
|
||||
'vs/css.d.ts',
|
||||
'vs/css.js',
|
||||
'vs/loader.js',
|
||||
'vs/nls.build.js',
|
||||
'vs/nls.d.ts',
|
||||
'vs/nls.js',
|
||||
'vs/nls.mock.ts',
|
||||
].forEach(copyFile);
|
||||
}
|
||||
exports.extractEditor = extractEditor;
|
||||
function createESMSourcesAndResources2(options) {
|
||||
const SRC_FOLDER = path.join(REPO_ROOT, options.srcFolder);
|
||||
const OUT_FOLDER = path.join(REPO_ROOT, options.outFolder);
|
||||
const OUT_RESOURCES_FOLDER = path.join(REPO_ROOT, options.outResourcesFolder);
|
||||
const getDestAbsoluteFilePath = (file) => {
|
||||
let dest = options.renames[file.replace(/\\/g, '/')] || file;
|
||||
if (dest === 'tsconfig.json') {
|
||||
return path.join(OUT_FOLDER, `tsconfig.json`);
|
||||
}
|
||||
if (/\.ts$/.test(dest)) {
|
||||
return path.join(OUT_FOLDER, dest);
|
||||
}
|
||||
return path.join(OUT_RESOURCES_FOLDER, dest);
|
||||
};
|
||||
const allFiles = walkDirRecursive(SRC_FOLDER);
|
||||
for (const file of allFiles) {
|
||||
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
||||
continue;
|
||||
}
|
||||
if (file === 'tsconfig.json') {
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(SRC_FOLDER, file)).toString());
|
||||
tsConfig.compilerOptions.module = 'es6';
|
||||
tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs').replace(/\\/g, '/');
|
||||
write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t'));
|
||||
continue;
|
||||
}
|
||||
if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file)) {
|
||||
// Transport the files directly
|
||||
write(getDestAbsoluteFilePath(file), fs.readFileSync(path.join(SRC_FOLDER, file)));
|
||||
continue;
|
||||
}
|
||||
if (/\.ts$/.test(file)) {
|
||||
// Transform the .ts file
|
||||
let fileContents = fs.readFileSync(path.join(SRC_FOLDER, file)).toString();
|
||||
const info = ts.preProcessFile(fileContents);
|
||||
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
||||
const importedFilename = info.importedFiles[i].fileName;
|
||||
const pos = info.importedFiles[i].pos;
|
||||
const end = info.importedFiles[i].end;
|
||||
let importedFilepath;
|
||||
if (/^vs\/css!/.test(importedFilename)) {
|
||||
importedFilepath = importedFilename.substr('vs/css!'.length) + '.css';
|
||||
}
|
||||
else {
|
||||
importedFilepath = importedFilename;
|
||||
}
|
||||
if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) {
|
||||
importedFilepath = path.join(path.dirname(file), importedFilepath);
|
||||
}
|
||||
let relativePath;
|
||||
if (importedFilepath === path.dirname(file).replace(/\\/g, '/')) {
|
||||
relativePath = '../' + path.basename(path.dirname(file));
|
||||
}
|
||||
else if (importedFilepath === path.dirname(path.dirname(file)).replace(/\\/g, '/')) {
|
||||
relativePath = '../../' + path.basename(path.dirname(path.dirname(file)));
|
||||
}
|
||||
else {
|
||||
relativePath = path.relative(path.dirname(file), importedFilepath);
|
||||
}
|
||||
relativePath = relativePath.replace(/\\/g, '/');
|
||||
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
||||
relativePath = './' + relativePath;
|
||||
}
|
||||
fileContents = (fileContents.substring(0, pos + 1)
|
||||
+ relativePath
|
||||
+ fileContents.substring(end + 1));
|
||||
}
|
||||
fileContents = fileContents.replace(/import ([a-zA-z0-9]+) = require\(('[^']+')\);/g, function (_, m1, m2) {
|
||||
return `import * as ${m1} from ${m2};`;
|
||||
});
|
||||
write(getDestAbsoluteFilePath(file), fileContents);
|
||||
continue;
|
||||
}
|
||||
console.log(`UNKNOWN FILE: ${file}`);
|
||||
}
|
||||
function walkDirRecursive(dir) {
|
||||
if (dir.charAt(dir.length - 1) !== '/' || dir.charAt(dir.length - 1) !== '\\') {
|
||||
dir += '/';
|
||||
}
|
||||
let result = [];
|
||||
_walkDirRecursive(dir, result, dir.length);
|
||||
return result;
|
||||
}
|
||||
function _walkDirRecursive(dir, result, trimPos) {
|
||||
const files = fs.readdirSync(dir);
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = path.join(dir, files[i]);
|
||||
if (fs.statSync(file).isDirectory()) {
|
||||
_walkDirRecursive(file, result, trimPos);
|
||||
}
|
||||
else {
|
||||
result.push(file.substr(trimPos));
|
||||
}
|
||||
}
|
||||
}
|
||||
function write(absoluteFilePath, contents) {
|
||||
if (/(\.ts$)|(\.js$)/.test(absoluteFilePath)) {
|
||||
contents = toggleComments(contents.toString());
|
||||
}
|
||||
writeFile(absoluteFilePath, contents);
|
||||
function toggleComments(fileContents) {
|
||||
let lines = fileContents.split(/\r\n|\r|\n/);
|
||||
let mode = 0;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (mode === 0) {
|
||||
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||
mode = 1;
|
||||
continue;
|
||||
}
|
||||
if (/\/\/ ESM-uncomment-begin/.test(line)) {
|
||||
mode = 2;
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (mode === 1) {
|
||||
if (/\/\/ ESM-comment-end/.test(line)) {
|
||||
mode = 0;
|
||||
continue;
|
||||
}
|
||||
lines[i] = '// ' + line;
|
||||
continue;
|
||||
}
|
||||
if (mode === 2) {
|
||||
if (/\/\/ ESM-uncomment-end/.test(line)) {
|
||||
mode = 0;
|
||||
continue;
|
||||
}
|
||||
lines[i] = line.replace(/^(\s*)\/\/ ?/, function (_, indent) {
|
||||
return indent;
|
||||
});
|
||||
}
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.createESMSourcesAndResources2 = createESMSourcesAndResources2;
|
||||
function transportCSS(module, enqueue, write) {
|
||||
if (!/\.css/.test(module)) {
|
||||
return false;
|
||||
}
|
||||
const filename = path.join(SRC_DIR, module);
|
||||
const fileContents = fs.readFileSync(filename).toString();
|
||||
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
|
||||
const inlineResourcesLimit = 300000; //3000; // see https://github.com/Microsoft/monaco-editor/issues/336
|
||||
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64', inlineResourcesLimit);
|
||||
write(module, newContents);
|
||||
return true;
|
||||
function _rewriteOrInlineUrls(contents, forceBase64, inlineByteLimit) {
|
||||
return _replaceURL(contents, (url) => {
|
||||
let imagePath = path.join(path.dirname(module), url);
|
||||
let fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
|
||||
if (fileContents.length < inlineByteLimit) {
|
||||
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
|
||||
let DATA = ';base64,' + fileContents.toString('base64');
|
||||
if (!forceBase64 && /\.svg$/.test(url)) {
|
||||
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
|
||||
let newText = fileContents.toString()
|
||||
.replace(/"/g, '\'')
|
||||
.replace(/</g, '%3C')
|
||||
.replace(/>/g, '%3E')
|
||||
.replace(/&/g, '%26')
|
||||
.replace(/#/g, '%23')
|
||||
.replace(/\s+/g, ' ');
|
||||
let encodedData = ',' + newText;
|
||||
if (encodedData.length < DATA.length) {
|
||||
DATA = encodedData;
|
||||
}
|
||||
}
|
||||
return '"data:' + MIME + DATA + '"';
|
||||
}
|
||||
enqueue(imagePath);
|
||||
return url;
|
||||
});
|
||||
}
|
||||
function _replaceURL(contents, replacer) {
|
||||
// Use ")" as the terminator as quotes are oftentimes not used at all
|
||||
return contents.replace(/url\(\s*([^\)]+)\s*\)?/g, (_, ...matches) => {
|
||||
let url = matches[0];
|
||||
// Eliminate starting quotes (the initial whitespace is not captured)
|
||||
if (url.charAt(0) === '"' || url.charAt(0) === '\'') {
|
||||
url = url.substring(1);
|
||||
}
|
||||
// The ending whitespace is captured
|
||||
while (url.length > 0 && (url.charAt(url.length - 1) === ' ' || url.charAt(url.length - 1) === '\t')) {
|
||||
url = url.substring(0, url.length - 1);
|
||||
}
|
||||
// Eliminate ending quotes
|
||||
if (url.charAt(url.length - 1) === '"' || url.charAt(url.length - 1) === '\'') {
|
||||
url = url.substring(0, url.length - 1);
|
||||
}
|
||||
if (!_startsWith(url, 'data:') && !_startsWith(url, 'http://') && !_startsWith(url, 'https://')) {
|
||||
url = replacer(url);
|
||||
}
|
||||
return 'url(' + url + ')';
|
||||
});
|
||||
}
|
||||
function _startsWith(haystack, needle) {
|
||||
return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;
|
||||
}
|
||||
}
|
||||
355
build/lib/standalone.ts
Normal file
355
build/lib/standalone.ts
Normal file
@@ -0,0 +1,355 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as ts from 'typescript';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as tss from './treeshaking';
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
const SRC_DIR = path.join(REPO_ROOT, 'src');
|
||||
|
||||
let dirCache: { [dir: string]: boolean; } = {};
|
||||
|
||||
function writeFile(filePath: string, contents: Buffer | string): void {
|
||||
function ensureDirs(dirPath: string): void {
|
||||
if (dirCache[dirPath]) {
|
||||
return;
|
||||
}
|
||||
dirCache[dirPath] = true;
|
||||
|
||||
ensureDirs(path.dirname(dirPath));
|
||||
if (fs.existsSync(dirPath)) {
|
||||
return;
|
||||
}
|
||||
fs.mkdirSync(dirPath);
|
||||
}
|
||||
ensureDirs(path.dirname(filePath));
|
||||
fs.writeFileSync(filePath, contents);
|
||||
}
|
||||
|
||||
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||
let compilerOptions: { [key: string]: any };
|
||||
if (tsConfig.extends) {
|
||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||
} else {
|
||||
compilerOptions = tsConfig.compilerOptions;
|
||||
}
|
||||
tsConfig.compilerOptions = compilerOptions;
|
||||
|
||||
compilerOptions.noEmit = false;
|
||||
compilerOptions.noUnusedLocals = false;
|
||||
compilerOptions.preserveConstEnums = false;
|
||||
compilerOptions.declaration = false;
|
||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||
|
||||
|
||||
options.compilerOptions = compilerOptions;
|
||||
|
||||
let result = tss.shake(options);
|
||||
for (let fileName in result) {
|
||||
if (result.hasOwnProperty(fileName)) {
|
||||
writeFile(path.join(options.destRoot, fileName), result[fileName]);
|
||||
}
|
||||
}
|
||||
let copied: { [fileName: string]: boolean; } = {};
|
||||
const copyFile = (fileName: string) => {
|
||||
if (copied[fileName]) {
|
||||
return;
|
||||
}
|
||||
copied[fileName] = true;
|
||||
const srcPath = path.join(options.sourcesRoot, fileName);
|
||||
const dstPath = path.join(options.destRoot, fileName);
|
||||
writeFile(dstPath, fs.readFileSync(srcPath));
|
||||
};
|
||||
const writeOutputFile = (fileName: string, contents: string | Buffer) => {
|
||||
writeFile(path.join(options.destRoot, fileName), contents);
|
||||
};
|
||||
for (let fileName in result) {
|
||||
if (result.hasOwnProperty(fileName)) {
|
||||
const fileContents = result[fileName];
|
||||
const info = ts.preProcessFile(fileContents);
|
||||
|
||||
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
||||
const importedFileName = info.importedFiles[i].fileName;
|
||||
|
||||
let importedFilePath: string;
|
||||
if (/^vs\/css!/.test(importedFileName)) {
|
||||
importedFilePath = importedFileName.substr('vs/css!'.length) + '.css';
|
||||
} else {
|
||||
importedFilePath = importedFileName;
|
||||
}
|
||||
if (/(^\.\/)|(^\.\.\/)/.test(importedFilePath)) {
|
||||
importedFilePath = path.join(path.dirname(fileName), importedFilePath);
|
||||
}
|
||||
|
||||
if (/\.css$/.test(importedFilePath)) {
|
||||
transportCSS(importedFilePath, copyFile, writeOutputFile);
|
||||
} else {
|
||||
if (fs.existsSync(path.join(options.sourcesRoot, importedFilePath + '.js'))) {
|
||||
copyFile(importedFilePath + '.js');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete tsConfig.compilerOptions.moduleResolution;
|
||||
writeOutputFile('tsconfig.json', JSON.stringify(tsConfig, null, '\t'));
|
||||
|
||||
[
|
||||
'vs/css.build.js',
|
||||
'vs/css.d.ts',
|
||||
'vs/css.js',
|
||||
'vs/loader.js',
|
||||
'vs/nls.build.js',
|
||||
'vs/nls.d.ts',
|
||||
'vs/nls.js',
|
||||
'vs/nls.mock.ts',
|
||||
].forEach(copyFile);
|
||||
}
|
||||
|
||||
export interface IOptions2 {
|
||||
srcFolder: string;
|
||||
outFolder: string;
|
||||
outResourcesFolder: string;
|
||||
ignores: string[];
|
||||
renames: { [filename: string]: string; };
|
||||
}
|
||||
|
||||
export function createESMSourcesAndResources2(options: IOptions2): void {
|
||||
const SRC_FOLDER = path.join(REPO_ROOT, options.srcFolder);
|
||||
const OUT_FOLDER = path.join(REPO_ROOT, options.outFolder);
|
||||
const OUT_RESOURCES_FOLDER = path.join(REPO_ROOT, options.outResourcesFolder);
|
||||
|
||||
const getDestAbsoluteFilePath = (file: string): string => {
|
||||
let dest = options.renames[file.replace(/\\/g, '/')] || file;
|
||||
if (dest === 'tsconfig.json') {
|
||||
return path.join(OUT_FOLDER, `tsconfig.json`);
|
||||
}
|
||||
if (/\.ts$/.test(dest)) {
|
||||
return path.join(OUT_FOLDER, dest);
|
||||
}
|
||||
return path.join(OUT_RESOURCES_FOLDER, dest);
|
||||
};
|
||||
|
||||
const allFiles = walkDirRecursive(SRC_FOLDER);
|
||||
for (const file of allFiles) {
|
||||
|
||||
if (options.ignores.indexOf(file.replace(/\\/g, '/')) >= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file === 'tsconfig.json') {
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(SRC_FOLDER, file)).toString());
|
||||
tsConfig.compilerOptions.module = 'es6';
|
||||
tsConfig.compilerOptions.outDir = path.join(path.relative(OUT_FOLDER, OUT_RESOURCES_FOLDER), 'vs').replace(/\\/g, '/');
|
||||
write(getDestAbsoluteFilePath(file), JSON.stringify(tsConfig, null, '\t'));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (/\.d\.ts$/.test(file) || /\.css$/.test(file) || /\.js$/.test(file)) {
|
||||
// Transport the files directly
|
||||
write(getDestAbsoluteFilePath(file), fs.readFileSync(path.join(SRC_FOLDER, file)));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (/\.ts$/.test(file)) {
|
||||
// Transform the .ts file
|
||||
let fileContents = fs.readFileSync(path.join(SRC_FOLDER, file)).toString();
|
||||
|
||||
const info = ts.preProcessFile(fileContents);
|
||||
|
||||
for (let i = info.importedFiles.length - 1; i >= 0; i--) {
|
||||
const importedFilename = info.importedFiles[i].fileName;
|
||||
const pos = info.importedFiles[i].pos;
|
||||
const end = info.importedFiles[i].end;
|
||||
|
||||
let importedFilepath: string;
|
||||
if (/^vs\/css!/.test(importedFilename)) {
|
||||
importedFilepath = importedFilename.substr('vs/css!'.length) + '.css';
|
||||
} else {
|
||||
importedFilepath = importedFilename;
|
||||
}
|
||||
if (/(^\.\/)|(^\.\.\/)/.test(importedFilepath)) {
|
||||
importedFilepath = path.join(path.dirname(file), importedFilepath);
|
||||
}
|
||||
|
||||
let relativePath: string;
|
||||
if (importedFilepath === path.dirname(file).replace(/\\/g, '/')) {
|
||||
relativePath = '../' + path.basename(path.dirname(file));
|
||||
} else if (importedFilepath === path.dirname(path.dirname(file)).replace(/\\/g, '/')) {
|
||||
relativePath = '../../' + path.basename(path.dirname(path.dirname(file)));
|
||||
} else {
|
||||
relativePath = path.relative(path.dirname(file), importedFilepath);
|
||||
}
|
||||
relativePath = relativePath.replace(/\\/g, '/');
|
||||
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
|
||||
relativePath = './' + relativePath;
|
||||
}
|
||||
fileContents = (
|
||||
fileContents.substring(0, pos + 1)
|
||||
+ relativePath
|
||||
+ fileContents.substring(end + 1)
|
||||
);
|
||||
}
|
||||
|
||||
fileContents = fileContents.replace(/import ([a-zA-z0-9]+) = require\(('[^']+')\);/g, function (_, m1, m2) {
|
||||
return `import * as ${m1} from ${m2};`;
|
||||
});
|
||||
|
||||
write(getDestAbsoluteFilePath(file), fileContents);
|
||||
continue;
|
||||
}
|
||||
|
||||
console.log(`UNKNOWN FILE: ${file}`);
|
||||
}
|
||||
|
||||
|
||||
function walkDirRecursive(dir: string): string[] {
|
||||
if (dir.charAt(dir.length - 1) !== '/' || dir.charAt(dir.length - 1) !== '\\') {
|
||||
dir += '/';
|
||||
}
|
||||
let result: string[] = [];
|
||||
_walkDirRecursive(dir, result, dir.length);
|
||||
return result;
|
||||
}
|
||||
|
||||
function _walkDirRecursive(dir: string, result: string[], trimPos: number): void {
|
||||
const files = fs.readdirSync(dir);
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = path.join(dir, files[i]);
|
||||
if (fs.statSync(file).isDirectory()) {
|
||||
_walkDirRecursive(file, result, trimPos);
|
||||
} else {
|
||||
result.push(file.substr(trimPos));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function write(absoluteFilePath: string, contents: string | Buffer): void {
|
||||
if (/(\.ts$)|(\.js$)/.test(absoluteFilePath)) {
|
||||
contents = toggleComments(contents.toString());
|
||||
}
|
||||
writeFile(absoluteFilePath, contents);
|
||||
|
||||
function toggleComments(fileContents: string): string {
|
||||
let lines = fileContents.split(/\r\n|\r|\n/);
|
||||
let mode = 0;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (mode === 0) {
|
||||
if (/\/\/ ESM-comment-begin/.test(line)) {
|
||||
mode = 1;
|
||||
continue;
|
||||
}
|
||||
if (/\/\/ ESM-uncomment-begin/.test(line)) {
|
||||
mode = 2;
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mode === 1) {
|
||||
if (/\/\/ ESM-comment-end/.test(line)) {
|
||||
mode = 0;
|
||||
continue;
|
||||
}
|
||||
lines[i] = '// ' + line;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mode === 2) {
|
||||
if (/\/\/ ESM-uncomment-end/.test(line)) {
|
||||
mode = 0;
|
||||
continue;
|
||||
}
|
||||
lines[i] = line.replace(/^(\s*)\/\/ ?/, function (_, indent) {
|
||||
return indent;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return lines.join('\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function transportCSS(module: string, enqueue: (module: string) => void, write: (path: string, contents: string | Buffer) => void): boolean {
|
||||
|
||||
if (!/\.css/.test(module)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const filename = path.join(SRC_DIR, module);
|
||||
const fileContents = fs.readFileSync(filename).toString();
|
||||
const inlineResources = 'base64'; // see https://github.com/Microsoft/monaco-editor/issues/148
|
||||
const inlineResourcesLimit = 300000;//3000; // see https://github.com/Microsoft/monaco-editor/issues/336
|
||||
|
||||
const newContents = _rewriteOrInlineUrls(fileContents, inlineResources === 'base64', inlineResourcesLimit);
|
||||
write(module, newContents);
|
||||
return true;
|
||||
|
||||
function _rewriteOrInlineUrls(contents: string, forceBase64: boolean, inlineByteLimit: number): string {
|
||||
return _replaceURL(contents, (url) => {
|
||||
let imagePath = path.join(path.dirname(module), url);
|
||||
let fileContents = fs.readFileSync(path.join(SRC_DIR, imagePath));
|
||||
|
||||
if (fileContents.length < inlineByteLimit) {
|
||||
const MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png';
|
||||
let DATA = ';base64,' + fileContents.toString('base64');
|
||||
|
||||
if (!forceBase64 && /\.svg$/.test(url)) {
|
||||
// .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
|
||||
let newText = fileContents.toString()
|
||||
.replace(/"/g, '\'')
|
||||
.replace(/</g, '%3C')
|
||||
.replace(/>/g, '%3E')
|
||||
.replace(/&/g, '%26')
|
||||
.replace(/#/g, '%23')
|
||||
.replace(/\s+/g, ' ');
|
||||
let encodedData = ',' + newText;
|
||||
if (encodedData.length < DATA.length) {
|
||||
DATA = encodedData;
|
||||
}
|
||||
}
|
||||
return '"data:' + MIME + DATA + '"';
|
||||
}
|
||||
|
||||
enqueue(imagePath);
|
||||
return url;
|
||||
});
|
||||
}
|
||||
|
||||
function _replaceURL(contents: string, replacer: (url: string) => string): string {
|
||||
// Use ")" as the terminator as quotes are oftentimes not used at all
|
||||
return contents.replace(/url\(\s*([^\)]+)\s*\)?/g, (_: string, ...matches: string[]) => {
|
||||
let url = matches[0];
|
||||
// Eliminate starting quotes (the initial whitespace is not captured)
|
||||
if (url.charAt(0) === '"' || url.charAt(0) === '\'') {
|
||||
url = url.substring(1);
|
||||
}
|
||||
// The ending whitespace is captured
|
||||
while (url.length > 0 && (url.charAt(url.length - 1) === ' ' || url.charAt(url.length - 1) === '\t')) {
|
||||
url = url.substring(0, url.length - 1);
|
||||
}
|
||||
// Eliminate ending quotes
|
||||
if (url.charAt(url.length - 1) === '"' || url.charAt(url.length - 1) === '\'') {
|
||||
url = url.substring(0, url.length - 1);
|
||||
}
|
||||
|
||||
if (!_startsWith(url, 'data:') && !_startsWith(url, 'http://') && !_startsWith(url, 'https://')) {
|
||||
url = replacer(url);
|
||||
}
|
||||
|
||||
return 'url(' + url + ')';
|
||||
});
|
||||
}
|
||||
|
||||
function _startsWith(haystack: string, needle: string): boolean {
|
||||
return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;
|
||||
}
|
||||
}
|
||||
136
build/lib/stats.js
Normal file
136
build/lib/stats.js
Normal file
@@ -0,0 +1,136 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const es = require("event-stream");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const appInsights = require("applicationinsights");
|
||||
class Entry {
|
||||
constructor(name, totalCount, totalSize) {
|
||||
this.name = name;
|
||||
this.totalCount = totalCount;
|
||||
this.totalSize = totalSize;
|
||||
}
|
||||
toString(pretty) {
|
||||
if (!pretty) {
|
||||
if (this.totalCount === 1) {
|
||||
return `${this.name}: ${this.totalSize} bytes`;
|
||||
}
|
||||
else {
|
||||
return `${this.name}: ${this.totalCount} files with ${this.totalSize} bytes`;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (this.totalCount === 1) {
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||
}
|
||||
else {
|
||||
const count = this.totalCount < 100
|
||||
? ansiColors.green(this.totalCount.toString())
|
||||
: ansiColors.red(this.totalCount.toString());
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const _entries = new Map();
|
||||
function createStatsStream(group, log) {
|
||||
const entry = new Entry(group, 0, 0);
|
||||
_entries.set(entry.name, entry);
|
||||
return es.through(function (data) {
|
||||
const file = data;
|
||||
if (typeof file.path === 'string') {
|
||||
entry.totalCount += 1;
|
||||
if (Buffer.isBuffer(file.contents)) {
|
||||
entry.totalSize += file.contents.length;
|
||||
}
|
||||
else if (file.stat && typeof file.stat.size === 'number') {
|
||||
entry.totalSize += file.stat.size;
|
||||
}
|
||||
else {
|
||||
// funky file...
|
||||
}
|
||||
}
|
||||
this.emit('data', data);
|
||||
}, function () {
|
||||
if (log) {
|
||||
if (entry.totalCount === 1) {
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
}
|
||||
else {
|
||||
const count = entry.totalCount < 100
|
||||
? ansiColors.green(entry.totalCount.toString())
|
||||
: ansiColors.red(entry.totalCount.toString());
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
}
|
||||
}
|
||||
this.emit('end');
|
||||
});
|
||||
}
|
||||
exports.createStatsStream = createStatsStream;
|
||||
function submitAllStats(productJson, commit) {
|
||||
const sorted = [];
|
||||
// move entries for single files to the front
|
||||
_entries.forEach(value => {
|
||||
if (value.totalCount === 1) {
|
||||
sorted.unshift(value);
|
||||
}
|
||||
else {
|
||||
sorted.push(value);
|
||||
}
|
||||
});
|
||||
// print to console
|
||||
for (const entry of sorted) {
|
||||
console.log(entry.toString(true));
|
||||
}
|
||||
// send data as telementry event when the
|
||||
// product is configured to send telemetry
|
||||
if (!productJson || !productJson.aiConfig || typeof productJson.aiConfig.asimovKey !== 'string') {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
try {
|
||||
const sizes = {};
|
||||
const counts = {};
|
||||
for (const entry of sorted) {
|
||||
sizes[entry.name] = entry.totalSize;
|
||||
counts[entry.name] = entry.totalCount;
|
||||
}
|
||||
appInsights.setup(productJson.aiConfig.asimovKey)
|
||||
.setAutoCollectConsole(false)
|
||||
.setAutoCollectExceptions(false)
|
||||
.setAutoCollectPerformance(false)
|
||||
.setAutoCollectRequests(false)
|
||||
.setAutoCollectDependencies(false)
|
||||
.setAutoDependencyCorrelation(false)
|
||||
.start();
|
||||
appInsights.defaultClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
|
||||
/* __GDPR__
|
||||
"monacoworkbench/packagemetrics" : {
|
||||
"commit" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"size" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"count" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
}
|
||||
*/
|
||||
appInsights.defaultClient.trackEvent({
|
||||
name: 'monacoworkbench/packagemetrics',
|
||||
properties: { commit, size: JSON.stringify(sizes), count: JSON.stringify(counts) }
|
||||
});
|
||||
appInsights.defaultClient.flush({
|
||||
callback: () => {
|
||||
appInsights.dispose();
|
||||
resolve(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
console.error('ERROR sending build stats as telemetry event!');
|
||||
console.error(err);
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.submitAllStats = submitAllStats;
|
||||
148
build/lib/stats.ts
Normal file
148
build/lib/stats.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as es from 'event-stream';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as File from 'vinyl';
|
||||
import * as appInsights from 'applicationinsights';
|
||||
|
||||
class Entry {
|
||||
constructor(readonly name: string, public totalCount: number, public totalSize: number) { }
|
||||
|
||||
toString(pretty?: boolean): string {
|
||||
if (!pretty) {
|
||||
if (this.totalCount === 1) {
|
||||
return `${this.name}: ${this.totalSize} bytes`;
|
||||
} else {
|
||||
return `${this.name}: ${this.totalCount} files with ${this.totalSize} bytes`;
|
||||
}
|
||||
} else {
|
||||
if (this.totalCount === 1) {
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||
|
||||
} else {
|
||||
const count = this.totalCount < 100
|
||||
? ansiColors.green(this.totalCount.toString())
|
||||
: ansiColors.red(this.totalCount.toString());
|
||||
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const _entries = new Map<string, Entry>();
|
||||
|
||||
export function createStatsStream(group: string, log?: boolean): es.ThroughStream {
|
||||
|
||||
const entry = new Entry(group, 0, 0);
|
||||
_entries.set(entry.name, entry);
|
||||
|
||||
return es.through(function (data) {
|
||||
const file = data as File;
|
||||
if (typeof file.path === 'string') {
|
||||
entry.totalCount += 1;
|
||||
if (Buffer.isBuffer(file.contents)) {
|
||||
entry.totalSize += file.contents.length;
|
||||
} else if (file.stat && typeof file.stat.size === 'number') {
|
||||
entry.totalSize += file.stat.size;
|
||||
} else {
|
||||
// funky file...
|
||||
}
|
||||
}
|
||||
this.emit('data', data);
|
||||
}, function () {
|
||||
if (log) {
|
||||
if (entry.totalCount === 1) {
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
|
||||
} else {
|
||||
const count = entry.totalCount < 100
|
||||
? ansiColors.green(entry.totalCount.toString())
|
||||
: ansiColors.red(entry.totalCount.toString());
|
||||
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
}
|
||||
}
|
||||
|
||||
this.emit('end');
|
||||
});
|
||||
}
|
||||
|
||||
export function submitAllStats(productJson: any, commit: string): Promise<boolean> {
|
||||
|
||||
const sorted: Entry[] = [];
|
||||
// move entries for single files to the front
|
||||
_entries.forEach(value => {
|
||||
if (value.totalCount === 1) {
|
||||
sorted.unshift(value);
|
||||
} else {
|
||||
sorted.push(value);
|
||||
}
|
||||
});
|
||||
|
||||
// print to console
|
||||
for (const entry of sorted) {
|
||||
console.log(entry.toString(true));
|
||||
}
|
||||
|
||||
// send data as telementry event when the
|
||||
// product is configured to send telemetry
|
||||
if (!productJson || !productJson.aiConfig || typeof productJson.aiConfig.asimovKey !== 'string') {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
try {
|
||||
|
||||
const sizes: any = {};
|
||||
const counts: any = {};
|
||||
for (const entry of sorted) {
|
||||
sizes[entry.name] = entry.totalSize;
|
||||
counts[entry.name] = entry.totalCount;
|
||||
}
|
||||
|
||||
appInsights.setup(productJson.aiConfig.asimovKey)
|
||||
.setAutoCollectConsole(false)
|
||||
.setAutoCollectExceptions(false)
|
||||
.setAutoCollectPerformance(false)
|
||||
.setAutoCollectRequests(false)
|
||||
.setAutoCollectDependencies(false)
|
||||
.setAutoDependencyCorrelation(false)
|
||||
.start();
|
||||
|
||||
appInsights.defaultClient.config.endpointUrl = 'https://vortex.data.microsoft.com/collect/v1';
|
||||
|
||||
/* __GDPR__
|
||||
"monacoworkbench/packagemetrics" : {
|
||||
"commit" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"size" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
|
||||
"count" : {"classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
}
|
||||
*/
|
||||
appInsights.defaultClient.trackEvent({
|
||||
name: 'monacoworkbench/packagemetrics',
|
||||
properties: { commit, size: JSON.stringify(sizes), count: JSON.stringify(counts) }
|
||||
});
|
||||
|
||||
|
||||
appInsights.defaultClient.flush({
|
||||
callback: () => {
|
||||
appInsights.dispose();
|
||||
resolve(true);
|
||||
}
|
||||
});
|
||||
|
||||
} catch (err) {
|
||||
console.error('ERROR sending build stats as telemetry event!');
|
||||
console.error(err);
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user