mirror of
https://github.com/taigrr/wails.git
synced 2026-04-04 22:22:41 -07:00
Compare commits
761 Commits
v2.0.0-alp
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9e559f069 | ||
|
|
9a4c603001 | ||
|
|
98a95e99a5 | ||
|
|
d19c982eed | ||
|
|
a963836e75 | ||
|
|
00e9eb4b0b | ||
|
|
262b6281e1 | ||
|
|
f66c70f0be | ||
|
|
717d373668 | ||
|
|
d29fa94aa4 | ||
|
|
01dd0cd0b2 | ||
|
|
126cc78d1a | ||
|
|
5703d465fc | ||
|
|
0c2963cf53 | ||
|
|
b61fd16936 | ||
|
|
3a8ba96cb3 | ||
|
|
3b1d74cf84 | ||
|
|
2e0a6f95a0 | ||
|
|
8470bfb26b | ||
|
|
bea0c1446a | ||
|
|
35ebbdfa12 | ||
|
|
bb25b3f42f | ||
|
|
4a11f9bb20 | ||
|
|
c1a20d0509 | ||
|
|
32c3721b1b | ||
|
|
913cc56adf | ||
|
|
38f37e817b | ||
|
|
4e68f92083 | ||
|
|
3edbda313e | ||
|
|
04cde94c96 | ||
|
|
1faa962cf5 | ||
|
|
94a74520be | ||
|
|
27dd40fd29 | ||
|
|
616ecabb41 | ||
|
|
15cd325034 | ||
|
|
450eb2e7ae | ||
|
|
84622b829c | ||
|
|
a1323ce5e9 | ||
|
|
49629f6dc6 | ||
|
|
231848cb9e | ||
|
|
a51d8bb47d | ||
|
|
e0e4c0ae11 | ||
|
|
d47b3734af | ||
|
|
26d248a4b6 | ||
|
|
6413a6fb4d | ||
|
|
5e36f4fc7f | ||
|
|
b47c278c95 | ||
|
|
81a9619fd7 | ||
|
|
ce103af77b | ||
|
|
2649c3d17d | ||
|
|
a35cc035b0 | ||
|
|
a94a720a68 | ||
|
|
995fe38ee4 | ||
|
|
7fd311f7a6 | ||
|
|
356774e3f7 | ||
|
|
5d8653be83 | ||
|
|
8b5bcdfeff | ||
|
|
f6655d019f | ||
|
|
8f31183fa8 | ||
|
|
64528b4f02 | ||
|
|
7945853294 | ||
|
|
b0df3f5c39 | ||
|
|
7caf6af91d | ||
|
|
dd7c6a3d58 | ||
|
|
cfbeb1efd1 | ||
|
|
3022b0bf3f | ||
|
|
3723c41d15 | ||
|
|
2729081f2c | ||
|
|
cad1317fc8 | ||
|
|
1368c20029 | ||
|
|
0acfdd1516 | ||
|
|
212a20626a | ||
|
|
722ecc969b | ||
|
|
078145c030 | ||
|
|
3765c8fb57 | ||
|
|
10ac38c650 | ||
|
|
a16e41f813 | ||
|
|
1bd3deb39f | ||
|
|
be5f7ceb0e | ||
|
|
6943b657c9 | ||
|
|
a148c67df0 | ||
|
|
69297667c1 | ||
|
|
1ae9469e90 | ||
|
|
d597d8e1c9 | ||
|
|
d32152ed84 | ||
|
|
d28a7e8987 | ||
|
|
ef362a746a | ||
|
|
c16c95673e | ||
|
|
d426fc46b5 | ||
|
|
0efeed4d7f | ||
|
|
a11a75fa12 | ||
|
|
2d551cd019 | ||
|
|
37259b8adb | ||
|
|
d5cfcc80f7 | ||
|
|
25564b7211 | ||
|
|
661b24cfa2 | ||
|
|
75f703465a | ||
|
|
9949420639 | ||
|
|
9e347bf71f | ||
|
|
829fd8616b | ||
|
|
ae980d48fd | ||
|
|
ba9e64f53a | ||
|
|
b15d98b555 | ||
|
|
bdda454f69 | ||
|
|
a59d01ddb9 | ||
|
|
27f8df2b31 | ||
|
|
1b28f69236 | ||
|
|
7572b64bec | ||
|
|
f6b83b0933 | ||
|
|
a51ab25e2c | ||
|
|
aeaaccb942 | ||
|
|
4bf3eb303b | ||
|
|
b5437ed1b5 | ||
|
|
e2e752dd06 | ||
|
|
9dc2caecf0 | ||
|
|
b0da974a7d | ||
|
|
b4dc8c252a | ||
|
|
afb1d12c3b | ||
|
|
7a0cb428f2 | ||
|
|
e6a89790e3 | ||
|
|
daede02c16 | ||
|
|
417895f40b | ||
|
|
6bc26aa669 | ||
|
|
a641deb388 | ||
|
|
e013ce14a1 | ||
|
|
9930ee10da | ||
|
|
de6c57771e | ||
|
|
c8359b0743 | ||
|
|
12b7cf09e6 | ||
|
|
28af34f978 | ||
|
|
49b1acc147 | ||
|
|
0ee3015c7d | ||
|
|
4aa1464b48 | ||
|
|
7b52995c86 | ||
|
|
23c1ebfac9 | ||
|
|
3de31613a1 | ||
|
|
9a54f289c4 | ||
|
|
4a740e6186 | ||
|
|
34e622455f | ||
|
|
b13d8ef9fa | ||
|
|
4898bfdf9c | ||
|
|
28ff364faa | ||
|
|
f254cb086a | ||
|
|
15615eb450 | ||
|
|
37987b3827 | ||
|
|
48cf60ac7c | ||
|
|
368195e5bd | ||
|
|
97765c77e5 | ||
|
|
962ad1ea81 | ||
|
|
eba822da0b | ||
|
|
7b052e7a2d | ||
|
|
481eaa5ade | ||
|
|
cf8e2ee195 | ||
|
|
fee570a698 | ||
|
|
33c4865ca7 | ||
|
|
54bdbe0642 | ||
|
|
41ad692256 | ||
|
|
3417455ba6 | ||
|
|
020b098328 | ||
|
|
3781cbe731 | ||
|
|
67fcbfec01 | ||
|
|
b7c28ab1f2 | ||
|
|
1d8f74d6d7 | ||
|
|
7311868636 | ||
|
|
589eb3864f | ||
|
|
828f07ea13 | ||
|
|
8565749b0c | ||
|
|
33112029b8 | ||
|
|
37df1e0e0f | ||
|
|
f7bb8771f1 | ||
|
|
2f2a7a567a | ||
|
|
b5bc0ba181 | ||
|
|
ad25c256f9 | ||
|
|
23d53253f9 | ||
|
|
54a401106b | ||
|
|
fe6dd4d18f | ||
|
|
29a2d5b3d8 | ||
|
|
36647b9370 | ||
|
|
bb50941770 | ||
|
|
981ce4f8ad | ||
|
|
9f235bf78d | ||
|
|
5dfbd5f71b | ||
|
|
92a80c7b69 | ||
|
|
09a73540ea | ||
|
|
731d73d2e1 | ||
|
|
d21fe2a526 | ||
|
|
cac15cf95c | ||
|
|
6aee66c35a | ||
|
|
3ac4982fc5 | ||
|
|
eac8f23341 | ||
|
|
badacdd45b | ||
|
|
ae29a3b1cd | ||
|
|
817952f3d0 | ||
|
|
275412358a | ||
|
|
52554009ce | ||
|
|
9f89a4a58a | ||
|
|
5585d72c1c | ||
|
|
7748cc2497 | ||
|
|
60f9a02143 | ||
|
|
899e522c74 | ||
|
|
be87d73da8 | ||
|
|
00639677f5 | ||
|
|
3c25a73ae8 | ||
|
|
344103739f | ||
|
|
c2b8247fbb | ||
|
|
03cdfad418 | ||
|
|
3fe4c5455a | ||
|
|
a6b95b23c9 | ||
|
|
2616d87922 | ||
|
|
f983649bc6 | ||
|
|
15ed02b78c | ||
|
|
2cb93b4b4b | ||
|
|
7e0ad801b0 | ||
|
|
ccdfa9a8be | ||
|
|
85e04d8094 | ||
|
|
e7d4ec5836 | ||
|
|
511d0da2cb | ||
|
|
7fdbb0372c | ||
|
|
72f6f08f11 | ||
|
|
d16d5bdcd4 | ||
|
|
22d0e4ff8f | ||
|
|
c001a5f3cb | ||
|
|
43ab0e084f | ||
|
|
b3b9a9f5c2 | ||
|
|
954470250e | ||
|
|
5ab5246aa0 | ||
|
|
d548cbe083 | ||
|
|
abbbdda102 | ||
|
|
d270cc2ffa | ||
|
|
d6cdd1df82 | ||
|
|
3c0da9fd15 | ||
|
|
c9f93cd313 | ||
|
|
78c43d23b6 | ||
|
|
322f6b9b64 | ||
|
|
88bbfcb7f1 | ||
|
|
cae9827841 | ||
|
|
414b0149f2 | ||
|
|
33e4ec3e80 | ||
|
|
c46182923c | ||
|
|
5d2242f7a4 | ||
|
|
6204e63c56 | ||
|
|
4468edc939 | ||
|
|
b54a94135d | ||
|
|
e4d70f94b1 | ||
|
|
70418783a8 | ||
|
|
d9aa125a15 | ||
|
|
dacea399ab | ||
|
|
a78b9a5b9b | ||
|
|
36cd6af6df | ||
|
|
1e9807189c | ||
|
|
d54834d501 | ||
|
|
ac06e6728d | ||
|
|
227c316cb0 | ||
|
|
2c2ce66ec4 | ||
|
|
9a99b47f07 | ||
|
|
505bb51a27 | ||
|
|
6ade38e0ff | ||
|
|
3caa0f1438 | ||
|
|
b8ef90cb41 | ||
|
|
6551e1b499 | ||
|
|
9efc648e3d | ||
|
|
20f82cbde4 | ||
|
|
1ee9cf41e2 | ||
|
|
1cd38d12f9 | ||
|
|
0b71d64931 | ||
|
|
4954655ad4 | ||
|
|
8db91df185 | ||
|
|
ac4c17ca09 | ||
|
|
604dc6ace3 | ||
|
|
627aa06786 | ||
|
|
baa96f47d8 | ||
|
|
e718fb8333 | ||
|
|
c5d9fd1a0d | ||
|
|
63117fd519 | ||
|
|
a7c5064a33 | ||
|
|
f20ce7411d | ||
|
|
a7c04ac891 | ||
|
|
01de76a32e | ||
|
|
a861aa36b9 | ||
|
|
af593ef47a | ||
|
|
b98ab1f5b5 | ||
|
|
5ff3a286cf | ||
|
|
58dc917fb7 | ||
|
|
e00d65d468 | ||
|
|
dbcf4058e5 | ||
|
|
b558246d52 | ||
|
|
c3c88f5e27 | ||
|
|
31468aa177 | ||
|
|
6923ea301b | ||
|
|
ec8d8e4587 | ||
|
|
32591465f3 | ||
|
|
1c5c26e04a | ||
|
|
83baf4c6bb | ||
|
|
c383a61036 | ||
|
|
9d9c3d971a | ||
|
|
8acfeba3e1 | ||
|
|
09bae529de | ||
|
|
38c507a605 | ||
|
|
b7cd36921e | ||
|
|
de255729e6 | ||
|
|
3ac1dcc8d9 | ||
|
|
1d6cce7c52 | ||
|
|
c2ac4961ef | ||
|
|
184ce763c1 | ||
|
|
229ee95f91 | ||
|
|
8e84bdfa8d | ||
|
|
ed4b74f01b | ||
|
|
099c30833a | ||
|
|
e46d3bc220 | ||
|
|
7c22d89c37 | ||
|
|
316e4de8e2 | ||
|
|
d83fd1c2b4 | ||
|
|
619d8cc05e | ||
|
|
244b3dc2b4 | ||
|
|
1a69d93d32 | ||
|
|
5ba85f2817 | ||
|
|
3982436de6 | ||
|
|
fdf98ae1c6 | ||
|
|
76f19f0752 | ||
|
|
5c9aadcc82 | ||
|
|
5b10ee4b40 | ||
|
|
72b1e58218 | ||
|
|
7eb0718c9c | ||
|
|
ca8d41dd3b | ||
|
|
179d26b1c4 | ||
|
|
9786053324 | ||
|
|
aee395020f | ||
|
|
f377c94ba3 | ||
|
|
c5f1bd4449 | ||
|
|
e11dc0e080 | ||
|
|
0ea135a546 | ||
|
|
3419be1616 | ||
|
|
ccda8c5760 | ||
|
|
8a5287794e | ||
|
|
97d21564d1 | ||
|
|
3e28bfe717 | ||
|
|
06ebe5f51f | ||
|
|
f02c140709 | ||
|
|
b80a64b0ee | ||
|
|
5d2cc81123 | ||
|
|
b86d2fe8cd | ||
|
|
fee14babbc | ||
|
|
f06ffb62de | ||
|
|
4a1a4d75ad | ||
|
|
b552c16539 | ||
|
|
d574d53fca | ||
|
|
2b69ac8391 | ||
|
|
fa558a4b87 | ||
|
|
e7cb40d5ee | ||
|
|
f409dbdab1 | ||
|
|
1748e8479f | ||
|
|
d91a30f71a | ||
|
|
4f2788a294 | ||
|
|
856b81ab04 | ||
|
|
76aab2271c | ||
|
|
3192026e6d | ||
|
|
90dd05e52e | ||
|
|
e73cf44ddc | ||
|
|
4c2804eac9 | ||
|
|
e1dd77fd3f | ||
|
|
b69f1e6c43 | ||
|
|
7661082d58 | ||
|
|
34da4f056a | ||
|
|
642c1d5ec5 | ||
|
|
1f3351ffa5 | ||
|
|
30e96118b1 | ||
|
|
efd768ac5d | ||
|
|
6dbcd4fc45 | ||
|
|
11cd51c9ca | ||
|
|
3de38003bf | ||
|
|
418438b762 | ||
|
|
0a5c43435e | ||
|
|
d7bb831d7f | ||
|
|
824256db6d | ||
|
|
2f311ee403 | ||
|
|
e04db8775f | ||
|
|
2fbc63b458 | ||
|
|
8ac69d6afd | ||
|
|
6dec097184 | ||
|
|
c2015b1d72 | ||
|
|
9c75e61704 | ||
|
|
bfc343d388 | ||
|
|
b665c9bd38 | ||
|
|
bfe91b7523 | ||
|
|
e5ba1c7ced | ||
|
|
995d485a43 | ||
|
|
9ac4990f89 | ||
|
|
509c70a97c | ||
|
|
333b98d2e6 | ||
|
|
538f7cd150 | ||
|
|
d3c780e16e | ||
|
|
248a651c0c | ||
|
|
d142ce47ed | ||
|
|
695f78861d | ||
|
|
46ad4f4d18 | ||
|
|
2fc2d63e2d | ||
|
|
d137859d12 | ||
|
|
09cf223aa2 | ||
|
|
909da72eb2 | ||
|
|
2a06e2e577 | ||
|
|
7f841ab85b | ||
|
|
a2d95e1b99 | ||
|
|
d06f563bfe | ||
|
|
c53d44b3ec | ||
|
|
5e51f426fa | ||
|
|
193d9e8ed8 | ||
|
|
2d03d355c2 | ||
|
|
185b7fed63 | ||
|
|
ee6ad0bb27 | ||
|
|
3644f4ae1e | ||
|
|
28d87a8e58 | ||
|
|
cf7d31e432 | ||
|
|
fd40faabe8 | ||
|
|
d521f80dcd | ||
|
|
102a8cc5a6 | ||
|
|
e90f5361be | ||
|
|
afe677d39d | ||
|
|
58e6ce10ad | ||
|
|
b0c522a59a | ||
|
|
62fc489001 | ||
|
|
a269fc9e8c | ||
|
|
7cd6d109d4 | ||
|
|
1f8a2bb9b1 | ||
|
|
eb2ac99067 | ||
|
|
79147c612e | ||
|
|
3d75ba174b | ||
|
|
3933c5ab02 | ||
|
|
aa5ff6ed2e | ||
|
|
407269b0d5 | ||
|
|
67a72cc693 | ||
|
|
955fe1d583 | ||
|
|
82bce89086 | ||
|
|
c13257b9e9 | ||
|
|
3f773f80ac | ||
|
|
5b23122b35 | ||
|
|
d5cbfa6749 | ||
|
|
3ad92192a9 | ||
|
|
466676d99f | ||
|
|
a1d5412465 | ||
|
|
9fdd5148ca | ||
|
|
ac957b27cb | ||
|
|
20bc332720 | ||
|
|
d2507660c2 | ||
|
|
64264c6378 | ||
|
|
7a97c71ce8 | ||
|
|
14cc8681bf | ||
|
|
ddadcdc18f | ||
|
|
4738a0e0a8 | ||
|
|
d2e4a0b0d2 | ||
|
|
9f365ed85e | ||
|
|
5e733657c2 | ||
|
|
93d9b61366 | ||
|
|
b5d289bda9 | ||
|
|
319b7a3755 | ||
|
|
d20155a03b | ||
|
|
410d23b4d9 | ||
|
|
003e505c4a | ||
|
|
22f09772d3 | ||
|
|
a300172adc | ||
|
|
1eba408f64 | ||
|
|
be39b293b5 | ||
|
|
d853bdde27 | ||
|
|
31cf04a944 | ||
|
|
f5912d29b6 | ||
|
|
caad3a6b00 | ||
|
|
08f4476087 | ||
|
|
46ea3e6074 | ||
|
|
8be2a39daf | ||
|
|
7591b45ffa | ||
|
|
5302ce57db | ||
|
|
f6d0d383f1 | ||
|
|
6aa8267c49 | ||
|
|
e88100d48a | ||
|
|
f5056e7232 | ||
|
|
3b47bc5818 | ||
|
|
101d344303 | ||
|
|
6ab1a4adb0 | ||
|
|
68bbddeb3e | ||
|
|
5a30425091 | ||
|
|
e9deb248f9 | ||
|
|
7d0ff8b1a2 | ||
|
|
8399cc1e57 | ||
|
|
6b8370daad | ||
|
|
3c4f874db5 | ||
|
|
0966c96ef0 | ||
|
|
6b919808c9 | ||
|
|
590d4fcdbb | ||
|
|
4acb3f83bf | ||
|
|
df32393215 | ||
|
|
ff3e03220e | ||
|
|
5da198de7e | ||
|
|
247df54ef0 | ||
|
|
161eeca62b | ||
|
|
0b8056bcf4 | ||
|
|
62bfe953a1 | ||
|
|
67611d5ae7 | ||
|
|
77b5235c9f | ||
|
|
09755d5bfe | ||
|
|
0224228c46 | ||
|
|
168cd96f56 | ||
|
|
6f6e810432 | ||
|
|
944e1c99ff | ||
|
|
7f54f7bb7e | ||
|
|
2881a5bc0d | ||
|
|
ee05884c9c | ||
|
|
bdf9d6ed2d | ||
|
|
385988989b | ||
|
|
b98c7dd49f | ||
|
|
b3c0cc86d3 | ||
|
|
ad34e55a67 | ||
|
|
1bdbf68ca9 | ||
|
|
84f37c66ba | ||
|
|
f7c65b1705 | ||
|
|
134b41e4be | ||
|
|
df41e8eb3a | ||
|
|
0f668a9038 | ||
|
|
dea6d261ad | ||
|
|
97592fad5c | ||
|
|
bcd8f29334 | ||
|
|
d17255e44f | ||
|
|
7c20be48e7 | ||
|
|
8caf277bf1 | ||
|
|
7926c21692 | ||
|
|
c38de0e6b0 | ||
|
|
4b480bb085 | ||
|
|
c1d63aff34 | ||
|
|
5fc89c4cad | ||
|
|
05ed6af978 | ||
|
|
5e96bb5a32 | ||
|
|
14d72bc548 | ||
|
|
cecbb38c64 | ||
|
|
c5e76c50b0 | ||
|
|
e40226ff7a | ||
|
|
53a3638fa8 | ||
|
|
f34fc9c654 | ||
|
|
1344638c52 | ||
|
|
cd70dc4f16 | ||
|
|
7036a3183e | ||
|
|
3c6182c622 | ||
|
|
87df51feeb | ||
|
|
6fdc87454a | ||
|
|
c36f9501a9 | ||
|
|
163c0d9e67 | ||
|
|
80fc072ad7 | ||
|
|
37de2075ba | ||
|
|
1ed2cbe10b | ||
|
|
0c1dbd75f5 | ||
|
|
d77b5b2d57 | ||
|
|
ab825b3f11 | ||
|
|
c23b43c352 | ||
|
|
a76851463b | ||
|
|
e17b432c8f | ||
|
|
5d444cd6dd | ||
|
|
be43049fc6 | ||
|
|
2e01710412 | ||
|
|
1b0193161c | ||
|
|
1b377fb575 | ||
|
|
ff7b6eacaf | ||
|
|
94bed2a093 | ||
|
|
20b501562e | ||
|
|
ebc503488a | ||
|
|
2cfab3ede0 | ||
|
|
731c8b19e4 | ||
|
|
21ed97f7ad | ||
|
|
5746769e4d | ||
|
|
3f0a7cb43d | ||
|
|
a2f16aba9b | ||
|
|
9c91a207c8 | ||
|
|
79af447109 | ||
|
|
21bdc94941 | ||
|
|
a1bd1013cb | ||
|
|
2b6860b6c3 | ||
|
|
984c5f58f2 | ||
|
|
17b28a26bd | ||
|
|
5088c1647f | ||
|
|
9cb0ded9ed | ||
|
|
1203ae64b8 | ||
|
|
26ed8002b9 | ||
|
|
cf23bffc67 | ||
|
|
d70f6fffe7 | ||
|
|
54c99fc386 | ||
|
|
eea6ee28aa | ||
|
|
5b30db47ac | ||
|
|
d4de8b4af0 | ||
|
|
a706b3f7e5 | ||
|
|
5e89392fce | ||
|
|
97160037ff | ||
|
|
97e6ef7894 | ||
|
|
c4b56e27a5 | ||
|
|
074961d139 | ||
|
|
86c1ea5e6a | ||
|
|
0bbf1fd098 | ||
|
|
5329157240 | ||
|
|
ed2da4c349 | ||
|
|
1a7e762564 | ||
|
|
b394c1914c | ||
|
|
91c2ddf155 | ||
|
|
712ad96d2a | ||
|
|
86b4a4f2f5 | ||
|
|
4b9786abc9 | ||
|
|
fd96ebc050 | ||
|
|
939e0f5975 | ||
|
|
cb16ad1938 | ||
|
|
779095c988 | ||
|
|
6a7a288a0f | ||
|
|
0564d0aa98 | ||
|
|
3a136a73ca | ||
|
|
50c219307f | ||
|
|
de3038b302 | ||
|
|
6eb4b0a419 | ||
|
|
41d2158375 | ||
|
|
5d7f57e80b | ||
|
|
eb7349efbc | ||
|
|
8ddc3e9527 | ||
|
|
0393cb3dec | ||
|
|
872b57eb4c | ||
|
|
17421552fe | ||
|
|
e8f269ca0a | ||
|
|
4ce3e1d1bf | ||
|
|
e5f2746810 | ||
|
|
92ebf506dd | ||
|
|
9ab06152c5 | ||
|
|
bf36b6a59d | ||
|
|
4b9f6c4fb1 | ||
|
|
b1a42c8dea | ||
|
|
1b5ac3d2b6 | ||
|
|
cbd98b5a1a | ||
|
|
c8e0aea69c | ||
|
|
7c0b236eb0 | ||
|
|
16debbd109 | ||
|
|
39bfa5d910 | ||
|
|
6424579a9e | ||
|
|
a962ae6f63 | ||
|
|
c7dee158ba | ||
|
|
237d25089d | ||
|
|
265328d648 | ||
|
|
6f40e85a6e | ||
|
|
96d8509da3 | ||
|
|
598445ab0f | ||
|
|
24788e2fd3 | ||
|
|
bbf4dde43f | ||
|
|
0afd27ab45 | ||
|
|
d498423ec2 | ||
|
|
66ce84973c | ||
|
|
55e6a0f312 | ||
|
|
81e83fdf18 | ||
|
|
f9b79d24f8 | ||
|
|
0599a47bfe | ||
|
|
817c55d318 | ||
|
|
14146c8c0c | ||
|
|
18adac20d4 | ||
|
|
eb4bff89da | ||
|
|
c66dc777f3 | ||
|
|
9003462457 | ||
|
|
e124f0a220 | ||
|
|
c6d3f57712 | ||
|
|
b4c669ff86 | ||
|
|
2d1b2c0947 | ||
|
|
4a0c5aa785 | ||
|
|
f48d7f8f60 | ||
|
|
651f24f641 | ||
|
|
8fd77148ca | ||
|
|
0dc0762fdf | ||
|
|
1a92550709 | ||
|
|
bffc15bc14 | ||
|
|
198d206c46 | ||
|
|
bb8e848ef6 | ||
|
|
bac3e9e5c1 | ||
|
|
c88aedc890 | ||
|
|
bc5eddeb66 | ||
|
|
8e7258d812 | ||
|
|
7118762cec | ||
|
|
6af92cf0a4 | ||
|
|
1bb91634f7 | ||
|
|
f71ce7913f | ||
|
|
53db687a26 | ||
|
|
13939d3d6b | ||
|
|
552c6b8711 | ||
|
|
feee2b3db2 | ||
|
|
9889c2bdbb | ||
|
|
2432fccf71 | ||
|
|
70510fd180 | ||
|
|
17c6201469 | ||
|
|
0f209c8900 | ||
|
|
cbf043585c | ||
|
|
5ae621ceaa | ||
|
|
1231b59443 | ||
|
|
b18d4fbf41 | ||
|
|
9ec5605e63 | ||
|
|
98a4de8878 | ||
|
|
5fe709f558 | ||
|
|
5231a6893b | ||
|
|
74f3ce990f | ||
|
|
998a913853 | ||
|
|
ec7fa44b44 | ||
|
|
4ce5aef237 | ||
|
|
f3c7ce2061 | ||
|
|
964844835c | ||
|
|
4e152bb849 | ||
|
|
51133d098c | ||
|
|
d4191e7d1b | ||
|
|
9c273bc745 | ||
|
|
c6f6ad6beb | ||
|
|
4362a14459 | ||
|
|
0080e9e311 | ||
|
|
83d9297cac | ||
|
|
d8ad250608 | ||
|
|
eac8880f6d | ||
|
|
f47100e71c | ||
|
|
9a81a57d13 | ||
|
|
354429bc28 | ||
|
|
99d4d9490c | ||
|
|
61afe711bd | ||
|
|
6e3cfc157f | ||
|
|
30d762372f | ||
|
|
2dbaabb74c | ||
|
|
f8bae0430f | ||
|
|
21c07497d7 | ||
|
|
9b9bcd657f | ||
|
|
02038aa543 | ||
|
|
9910d1127a | ||
|
|
21a0245985 | ||
|
|
e860f3a00e | ||
|
|
2e480d2c52 | ||
|
|
2c0f93d647 | ||
|
|
41f973c7d5 | ||
|
|
2d1447d558 | ||
|
|
7c22cbcf38 | ||
|
|
e4b03f510b | ||
|
|
8dfd206aa9 | ||
|
|
49a9a93e4e | ||
|
|
36feb41e3f | ||
|
|
9167508302 | ||
|
|
cbd9eca6c3 | ||
|
|
181a34f38d | ||
|
|
15556ad389 | ||
|
|
3fc0f05fab | ||
|
|
7c249e9c6b | ||
|
|
cb03409e3a | ||
|
|
6dabab1d2e | ||
|
|
c3bd8b1a85 | ||
|
|
e1b7332c47 | ||
|
|
5cd08e45f0 | ||
|
|
c2d03f0e6e | ||
|
|
40db3587cb | ||
|
|
6228328278 | ||
|
|
17a9cf4afb | ||
|
|
4a6e9d059c | ||
|
|
76b12b5b80 | ||
|
|
3567ec9865 | ||
|
|
1a3cefd180 | ||
|
|
7b603a2776 | ||
|
|
5ced28cb74 | ||
|
|
7c04a854da | ||
|
|
39d687fa31 | ||
|
|
ee04a9235d | ||
|
|
0c2c56e1dd | ||
|
|
5267968151 | ||
|
|
7b31c8ddd2 | ||
|
|
1e2bc5728a | ||
|
|
e0aab7c27f |
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: [ leaanthony ]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
35
.github/workflows/deploy-website-to-wails.top-mirror.yml
vendored
Normal file
35
.github/workflows/deploy-website-to-wails.top-mirror.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
name: Deploy mirror | 部署镜像
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
# pull_request:
|
||||||
|
# branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
name: Automatic deployment | 自动部署
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.repository == 'misitebao/wails'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout | 切换到部署分支
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: "master"
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Build Site | 构建网站
|
||||||
|
run: |
|
||||||
|
cd website &&
|
||||||
|
npm install && npm run build
|
||||||
|
|
||||||
|
- name: Deploy to Server | 部署到服务器
|
||||||
|
uses: hengkx/ssh-deploy@v1.0.1
|
||||||
|
with:
|
||||||
|
HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
|
USERNAME: ${{ secrets.DEPLOY_HOST_USER }}
|
||||||
|
PASSWORD: ${{ secrets.DEPLOY_HOST_PASSWORD }}
|
||||||
|
SOURCE: "website/build"
|
||||||
|
TARGET: "/www/wwwroot/wails.top"
|
||||||
8
.github/workflows/latest-pre.yml
vendored
8
.github/workflows/latest-pre.yml
vendored
@@ -1,8 +1,10 @@
|
|||||||
name: latest pre-release
|
name: latest pre-release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
tags:
|
tags:
|
||||||
- '**-pre**'
|
- '**-pre**'
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -13,10 +15,10 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.13
|
- name: Set up Go 1.16
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.13
|
go-version: 1.16
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
|
|||||||
6
.github/workflows/pr.yml
vendored
6
.github/workflows/pr.yml
vendored
@@ -13,10 +13,10 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.13
|
- name: Set up Go 1.16
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.13
|
go-version: 1.16
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
@@ -29,4 +29,4 @@ jobs:
|
|||||||
run: go build -v ./cmd/wails
|
run: go build -v ./cmd/wails
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./wails version
|
run: ./wails version
|
||||||
|
|||||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -15,10 +15,10 @@ jobs:
|
|||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Set up Go 1.13
|
- name: Set up Go 1.16
|
||||||
uses: actions/setup-go@v1
|
uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: 1.13
|
go-version: 1.16
|
||||||
id: go
|
id: go
|
||||||
|
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
@@ -31,4 +31,4 @@ jobs:
|
|||||||
run: go build -v ./cmd/wails
|
run: go build -v ./cmd/wails
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./wails version
|
run: ./wails version
|
||||||
|
|||||||
29
.github/workflows/runtime.yml
vendored
Normal file
29
.github/workflows/runtime.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Runtime
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- v2-alpha
|
||||||
|
paths:
|
||||||
|
- 'v2/internal/frontend/runtime/**'
|
||||||
|
jobs:
|
||||||
|
rebuild-runtime:
|
||||||
|
name: Rebuild the runtime
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 14.17.6
|
||||||
|
cache: 'npm'
|
||||||
|
cache-dependency-path: v2/internal/frontend/runtime/package-lock.json
|
||||||
|
- run: npm install
|
||||||
|
working-directory: v2/internal/frontend/runtime
|
||||||
|
- run: npm run build
|
||||||
|
working-directory: v2/internal/frontend/runtime
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
uses: devops-infra/action-commit-push@master
|
||||||
|
with:
|
||||||
|
github_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
commit_prefix: "[AUTO]"
|
||||||
|
commit_message: "The runtime was rebuilt"
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -27,3 +27,7 @@ v2/pkg/parser/testproject/frontend/wails
|
|||||||
v2/test/kitchensink/frontend/public
|
v2/test/kitchensink/frontend/public
|
||||||
v2/test/kitchensink/build/darwin/desktop/kitchensink
|
v2/test/kitchensink/build/darwin/desktop/kitchensink
|
||||||
v2/test/kitchensink/frontend/package.json.md5
|
v2/test/kitchensink/frontend/package.json.md5
|
||||||
|
/v2/internal/ffenestri/windows/test/cmake-build-debug/
|
||||||
|
!v2/internal/ffenestri/windows/x64/webview2.dll
|
||||||
|
!v2/internal/ffenestri/windows/x64/WebView2Loader.dll
|
||||||
|
.idea/
|
||||||
|
|||||||
@@ -31,13 +31,18 @@ Wails is what it is because of the time and effort given by these great people.
|
|||||||
* [Christopher Murphy](https://github.com/Splode)
|
* [Christopher Murphy](https://github.com/Splode)
|
||||||
* [Zámbó, Levente](https://github.com/Lyimmi)
|
* [Zámbó, Levente](https://github.com/Lyimmi)
|
||||||
* [artem](https://github.com/Unix4ever)
|
* [artem](https://github.com/Unix4ever)
|
||||||
* [Tim Kipp](https://github.com/timkippdev)
|
* [Tim Kipp](https://github.com/timkippdev)
|
||||||
* [Dmitry Gomzyakov](https://github.com/kyoto44)
|
* [Dmitry Gomzyakov](https://github.com/kyoto44)
|
||||||
* [Arthur Wiebe](https://github.com/artooro)
|
* [Arthur Wiebe](https://github.com/artooro)
|
||||||
* [Ilgıt Yıldırım](https://github.com/ilgityildirim)
|
* [Ilgıt Yıldırım](https://github.com/ilgityildirim)
|
||||||
* [Altynbek](https://github.com/gelleson)
|
* [Altynbek](https://github.com/gelleson)
|
||||||
* [Kyle](https://github.com/kmuchmore)
|
* [Kyle](https://github.com/kmuchmore)
|
||||||
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
|
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
|
||||||
* [Charaf Rezrazi](https://github.com/Rezrazi)
|
* [Charaf Rezrazi](https://github.com/Rezrazi)
|
||||||
* [misitebao](https://github.com/misitebao)
|
* [misitebao](https://github.com/misitebao)
|
||||||
* [Elie Grenon](https://github.com/DrunkenPoney)
|
* [Elie Grenon](https://github.com/DrunkenPoney)
|
||||||
|
* [SophieAu](https://github.com/SophieAu)
|
||||||
|
* [Alexander Matviychuk](https://github.com/alexmat)
|
||||||
|
* [RH12503](https://github.com/RH12503)
|
||||||
|
* [hi019](https://github.com/hi019)
|
||||||
|
* [Igor Minen](https://github.com/Igogrek)
|
||||||
|
|||||||
275
README.md
275
README.md
@@ -1,8 +1,8 @@
|
|||||||
<p align="center" style="text-align: center">
|
<p align="center" style="text-align: center">
|
||||||
<img src="logo_cropped.png" width="40%"><br/>
|
<img src="logo.png" width="55%"><br/>
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
A framework for building desktop applications using Go & Web Technologies.<br/><br/>
|
Build desktop applications using Go & Web Technologies.<br/><br/>
|
||||||
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
|
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
|
||||||
<a href="https://goreportcard.com/report/github.com/wailsapp/wails"><img src="https://goreportcard.com/badge/github.com/wailsapp/wails"/></a>
|
<a href="https://goreportcard.com/report/github.com/wailsapp/wails"><img src="https://goreportcard.com/badge/github.com/wailsapp/wails"/></a>
|
||||||
<a href="http://godoc.org/github.com/wailsapp/wails"><img src="https://img.shields.io/badge/godoc-reference-blue.svg"/></a>
|
<a href="http://godoc.org/github.com/wailsapp/wails"><img src="https://img.shields.io/badge/godoc-reference-blue.svg"/></a>
|
||||||
@@ -14,13 +14,50 @@
|
|||||||
<a href="https://github.com/wailsapp/wails/workflows/release/badge.svg?branch=master" rel="nofollow"><img src="https://github.com/wailsapp/wails/workflows/release/badge.svg?branch=master" alt="Release Pipelines"></a>
|
<a href="https://github.com/wailsapp/wails/workflows/release/badge.svg?branch=master" rel="nofollow"><img src="https://github.com/wailsapp/wails/workflows/release/badge.svg?branch=master" alt="Release Pipelines"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
|
<span id="nav-1"></span>
|
||||||
|
|
||||||
|
## Internationalization
|
||||||
|
|
||||||
|
English | [简体中文](README.zh-Hans.md)
|
||||||
|
|
||||||
|
The traditional method of providing web interfaces to Go programs is via a built-in web server. Wails offers a different
|
||||||
|
approach: it provides the ability to wrap both Go code and a web frontend into a single binary. Tools are provided to
|
||||||
|
make this easy for you by handling project creation, compilation and bundling. All you have to do is get creative!
|
||||||
|
|
||||||
The official docs can be found at [https://wails.app](https://wails.app).
|
The official docs can be found at [https://wails.app](https://wails.app).
|
||||||
|
|
||||||
|
Click [here](https://wails.io) if you are interested in trying out v2 Beta for Windows.
|
||||||
|
|
||||||
|
<span id="nav-2"></span>
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
- [1. Internationalization](#nav-1)
|
||||||
|
- [2. Contents](#nav-2)
|
||||||
|
- [3. Features](#nav-3)
|
||||||
|
- [4. Sponsors](#nav-4)
|
||||||
|
- [5. Installation](#nav-5)
|
||||||
|
- [5.1 MacOS](#nav-5-1)
|
||||||
|
- [5.2 Linux](#nav-5-2)
|
||||||
|
- [5.2.1 Debian/Ubuntu](#nav-5-2-1)
|
||||||
|
- [5.2.2 Arch Linux / ArchLabs / Ctlos Linux](#nav-5-2-2)
|
||||||
|
- [5.2.3 Centos](#nav-5-2-3)
|
||||||
|
- [5.2.4 Fedora](#nav-5-2-4)
|
||||||
|
- [5.2.5 VoidLinux & VoidLinux-musl](#nav-5-2-5)
|
||||||
|
- [5.2.6 Gentoo](#nav-5-2-6)
|
||||||
|
- [5.3 Windows](#nav-5-3)
|
||||||
|
- [6. Installation](#nav-6)
|
||||||
|
- [7. Next Steps](#nav-7)
|
||||||
|
- [8. FAQ](#nav-8)
|
||||||
|
- [9. Contributors](#nav-9)
|
||||||
|
- [10. Special Mentions](#nav-10)
|
||||||
|
- [11. Special Thanks](#nav-11)
|
||||||
|
|
||||||
|
<span id="nav-3"></span>
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Use standard Go libraries/frameworks for the backend
|
- Use standard Go for the backend
|
||||||
- Use any frontend technology to build your UI
|
- Use any frontend technology to build your UI
|
||||||
- Quickly create Vue, Vuetify or React frontends for your Go programs
|
- Quickly create Vue, Vuetify or React frontends for your Go programs
|
||||||
- Expose Go methods/functions to the frontend via a single bind command
|
- Expose Go methods/functions to the frontend via a single bind command
|
||||||
@@ -30,22 +67,105 @@ The official docs can be found at [https://wails.app](https://wails.app).
|
|||||||
- Powerful cli tool
|
- Powerful cli tool
|
||||||
- Multiplatform
|
- Multiplatform
|
||||||
|
|
||||||
|
<span id="nav-4"></span>
|
||||||
|
|
||||||
|
## Sponsors
|
||||||
|
|
||||||
|
This project is supported by these kind people / companies:
|
||||||
|
|
||||||
|
<a href="https://github.com/sponsors/leaanthony" style="width:100px;">
|
||||||
|
<img src="sponsors/bronze%20sponsor.png" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/snider" style="width:100px;">
|
||||||
|
<img src="https://github.com/snider.png?size=100" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/codydbentley" style="width:100px">
|
||||||
|
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<a href="https://github.com/matryer" style="width:100px">
|
||||||
|
<img src="https://github.com/matryer.png" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://www.jetbrains.com?from=Wails" style="width:100px">
|
||||||
|
<img src="/img/jetbrains-grayscale.png" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/tc-hib" style="width:55px">
|
||||||
|
<img src="https://github.com/tc-hib.png?size=55" width="55"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/picatz" style="width:50px">
|
||||||
|
<img src="https://github.com/picatz.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/tylertravisty" style="width:50px">
|
||||||
|
<img src="https://github.com/tylertravisty.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/akhudek" style="width:50px">
|
||||||
|
<img src="https://github.com/akhudek.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/trea" style="width:50px">
|
||||||
|
<img src="https://github.com/trea.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/LanguageAgnostic" style="width:55px">
|
||||||
|
<img src="https://github.com/LanguageAgnostic.png?size=55" width="55"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/fcjr" style="width:55px">
|
||||||
|
<img src="https://github.com/fcjr.png?size=55" width="55"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/nickarellano" style="width:60px">
|
||||||
|
<img src="https://github.com/nickarellano.png?size=60" width="60"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/bglw" style="width:65px">
|
||||||
|
<img src="https://github.com/bglw.png?size=65" width="65"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/jugglingjsons" style="width:50px">
|
||||||
|
<img src="https://github.com/jugglingjsons.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/marcus-crane" style="width:65px">
|
||||||
|
<img src="https://github.com/marcus-crane.png?size=65" width="65"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/bbergshaven" style="width:45px">
|
||||||
|
<img src="https://github.com/bbergshaven.png?size=45" width="45"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/Gilgames000" style="width:45px">
|
||||||
|
<img src="https://github.com/Gilgames000.png?size=45" width="45"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/ilgityildirim" style="width:50px">
|
||||||
|
<img src="https://github.com/ilgityildirim.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/ondoki" style="width:65px">
|
||||||
|
<img src="https://github.com/ondoki.png?size=65" width="65"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/questrail" style="width:50px">
|
||||||
|
<img src="https://github.com/questrail.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/DonTomato" style="width:45px">
|
||||||
|
<img src="https://github.com/DonTomato.png?size=45" width="45"/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<span id="nav-5"></span>
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are:
|
Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as
|
||||||
|
an installation of Go. The basic requirements are:
|
||||||
|
|
||||||
- Go 1.13
|
- Go 1.16
|
||||||
- npm
|
- npm
|
||||||
|
|
||||||
|
<span id="nav-5-1"></span>
|
||||||
|
|
||||||
### MacOS
|
### MacOS
|
||||||
|
|
||||||
Make sure you have the xcode command line tools installed. This can be done by running:
|
Make sure you have the xcode command line tools installed. This can be done by running:
|
||||||
|
|
||||||
`xcode-select --install`
|
`xcode-select --install`
|
||||||
|
|
||||||
|
<span id="nav-5-2"></span>
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
|
<span id="nav-5-2-1"></span>
|
||||||
|
|
||||||
#### Debian/Ubuntu
|
#### Debian/Ubuntu
|
||||||
|
|
||||||
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
||||||
@@ -54,7 +174,9 @@ _Debian: 8, 9, 10_
|
|||||||
|
|
||||||
_Ubuntu: 16.04, 18.04, 19.04_
|
_Ubuntu: 16.04, 18.04, 19.04_
|
||||||
|
|
||||||
_Also succesfully tested on: Zorin 15, Parrot 4.7, Linuxmint 19, Elementary 5, Kali, Neon_, Pop!_OS
|
_Also succesfully tested on: Zorin 15, Parrot 4.7, Linuxmint 19, Elementary 5, Kali, Neon_, Pop!\_OS
|
||||||
|
|
||||||
|
<span id="nav-5-2-2"></span>
|
||||||
|
|
||||||
#### Arch Linux / ArchLabs / Ctlos Linux
|
#### Arch Linux / ArchLabs / Ctlos Linux
|
||||||
|
|
||||||
@@ -62,29 +184,43 @@ _Also succesfully tested on: Zorin 15, Parrot 4.7, Linuxmint 19, Elementary 5, K
|
|||||||
|
|
||||||
_Also succesfully test on: Manjaro & ArcoLinux_
|
_Also succesfully test on: Manjaro & ArcoLinux_
|
||||||
|
|
||||||
|
<span id="nav-5-2-3"></span>
|
||||||
|
|
||||||
#### Centos
|
#### Centos
|
||||||
|
|
||||||
`sudo yum install webkitgtk3-devel gtk3-devel`
|
`sudo yum install webkitgtk3-devel gtk3-devel`
|
||||||
|
|
||||||
_CentOS 6, 7_
|
_CentOS 6, 7_
|
||||||
|
|
||||||
|
<span id="nav-5-2-4"></span>
|
||||||
|
|
||||||
#### Fedora
|
#### Fedora
|
||||||
|
|
||||||
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
||||||
|
|
||||||
_Fedora 29, 30_
|
_Fedora 29, 30_
|
||||||
|
|
||||||
|
<span id="nav-5-2-5"></span>
|
||||||
|
|
||||||
#### VoidLinux & VoidLinux-musl
|
#### VoidLinux & VoidLinux-musl
|
||||||
|
|
||||||
`xbps-install gtk+3-devel webkit2gtk-devel`
|
`xbps-install gtk+3-devel webkit2gtk-devel`
|
||||||
|
|
||||||
|
<span id="nav-5-2-6"></span>
|
||||||
|
|
||||||
#### Gentoo
|
#### Gentoo
|
||||||
|
|
||||||
`sudo emerge gtk+:3 webkit-gtk`
|
`sudo emerge gtk+:3 webkit-gtk`
|
||||||
|
|
||||||
|
<span id="nav-5-3"></span>
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
Windows requires gcc and related tooling. The recommended download is from [http://tdm-gcc.tdragon.net/download](http://tdm-gcc.tdragon.net/download). Once this is installed, you are good to go.
|
Windows requires gcc and related tooling. The recommended download is
|
||||||
|
from [http://tdm-gcc.tdragon.net/download](http://tdm-gcc.tdragon.net/download). Once this is installed, you are good to
|
||||||
|
go.
|
||||||
|
|
||||||
|
<span id="nav-6"></span>
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -96,61 +232,120 @@ Installation is as simple as running the following command:
|
|||||||
go get -u github.com/wailsapp/wails/cmd/wails
|
go get -u github.com/wailsapp/wails/cmd/wails
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
<span id="nav-7"></span>
|
||||||
|
|
||||||
## Next Steps
|
## Next Steps
|
||||||
|
|
||||||
It is recommended at this stage to read the comprehensive documentation at [https://wails.app](https://wails.app).
|
It is recommended at this stage to read the comprehensive documentation at [https://wails.app](https://wails.app).
|
||||||
|
|
||||||
|
<span id="nav-8"></span>
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
* Is this an alternative to Electron?
|
- Is this an alternative to Electron?
|
||||||
|
|
||||||
Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop applications or add a frontend to their existing applications. Whilst Wails does not currently offer hooks into native elements such as menus, this may change in the future.
|
Depends on your requirements. It's designed to make it easy for Go programmers to make lightweight desktop
|
||||||
|
applications or add a frontend to their existing applications. Whilst Wails does not currently offer hooks into native
|
||||||
|
elements such as menus, this may change in the future.
|
||||||
|
|
||||||
* Who is this project aimed at?
|
- Who is this project aimed at?
|
||||||
|
|
||||||
Go programmers who want to bundle an HTML/JS/CSS frontend with their applications, without resorting to creating a server and opening a browser to view it.
|
Go programmers who want to bundle an HTML/JS/CSS frontend with their applications, without resorting to creating a
|
||||||
|
server and opening a browser to view it.
|
||||||
|
|
||||||
* What's with the name?
|
- What's with the name?
|
||||||
|
|
||||||
When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to Ruby". So initially it was a play on words (Webview on Rails). It just so happened to also be a homophone of the English name for the [Country](https://en.wikipedia.org/wiki/Wales) I am from. So it stuck.
|
When I saw WebView, I thought "What I really want is tooling around building a WebView app, a bit like Rails is to
|
||||||
|
Ruby". So initially it was a play on words (Webview on Rails). It just so happened to also be a homophone of the
|
||||||
|
English name for the [Country](https://en.wikipedia.org/wiki/Wales) I am from. So it stuck.
|
||||||
|
|
||||||
## Shoulders of Giants
|
<span id="nav-9"></span>
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
<a href="https://github.com/qaisjp"><img src="https://github.com/qaisjp.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/alee792"><img src="https://github.com/alee792.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/lanzafame"><img src="https://github.com/lanzafame.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/mattn"><img src="https://github.com/mattn.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/0xflotus"><img src="https://github.com/0xflotus.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/mdhender"><img src="https://github.com/mdhender.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/fishfishfish2104"><img src="https://github.com/fishfishfish2104.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/intelwalk"><img src="https://github.com/intelwalk.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/ocelotsloth"><img src="https://github.com/ocelotsloth.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/bh90210"><img src="https://github.com/bh90210.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/iceleo-com"><img src="https://github.com/iceleo-com.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/fallendusk"><img src="https://github.com/fallendusk.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Chronophylos"><img src="https://github.com/Chronophylos.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Vaelatern"><img src="https://github.com/Vaelatern.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/mewmew"><img src="https://github.com/mewmew.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/kraney"><img src="https://github.com/kraney.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/JackMordaunt"><img src="https://github.com/JackMordaunt.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/MichaelHipp"><img src="https://github.com/MichaelHipp.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/tmclane"><img src="https://github.com/tmclane.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Rested"><img src="https://github.com/Rested.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Jarek-SRT"><img src="https://github.com/Jarek-SRT.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/konez2k"><img src="https://github.com/konez2k.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/sayuthisobri"><img src="https://github.com/sayuthisobri.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/dedo1911"><img src="https://github.com/dedo1911.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/fdidron"><img src="https://github.com/fdidron.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Splode"><img src="https://github.com/Splode.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Lyimmi"><img src="https://github.com/Lyimmi.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Unix4ever"><img src="https://github.com/Unix4ever.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/timkippdev"><img src="https://github.com/timkippdev.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/kyoto44"><img src="https://github.com/kyoto44.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/artooro"><img src="https://github.com/artooro.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/ilgityildirim"><img src="https://github.com/ilgityildirim.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/gelleson"><img src="https://github.com/gelleson.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/kmuchmore"><img src="https://github.com/kmuchmore.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/aayush420"><img src="https://github.com/aayush420.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Rezrazi"><img src="https://github.com/Rezrazi.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/misitebao"><img src="https://github.com/misitebao.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/DrunkenPoney"><img src="https://github.com/DrunkenPoney.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/SophieAu"><img src="https://github.com/SophieAu.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/alexmat"><img src="https://github.com/alexmat.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/RH12503"><img src="https://github.com/RH12503.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/hi019"><img src="https://github.com/hi019.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/Igogrek"><img src="https://github.com/Igogrek.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/aschey"><img src="https://github.com/aschey.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/akhudek"><img src="https://github.com/akhudek.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/s12chung"><img src="https://github.com/s12chung.png?size=40" width="40"/></a></a>
|
||||||
|
|
||||||
|
<span id="nav-10"></span>
|
||||||
|
|
||||||
|
## Special Mentions
|
||||||
|
|
||||||
Without the following people, this project would never have existed:
|
Without the following people, this project would never have existed:
|
||||||
|
|
||||||
* [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been immense. More patience than you can throw a stick at (Not long now Dustin!).
|
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - His support and feedback has been immense. More patience than
|
||||||
* [Serge Zaitsev](https://github.com/zserge) - Creator of [Webview](https://github.com/zserge/webview) which Wails uses for the windowing.
|
you can throw a stick at (Not long now Dustin!).
|
||||||
|
- [Serge Zaitsev](https://github.com/zserge) - Creator of [Webview](https://github.com/zserge/webview) which Wails uses
|
||||||
And without [these people](CONTRIBUTORS.md), it wouldn't be what it is today. A huge thank you to each and every one of you!
|
for the windowing.
|
||||||
|
- [Byron](https://github.com/bh90210) - At times, Byron has single handedly kept this project alive. Without his
|
||||||
Special Mentions:
|
incredible input, we never would have got to v1.
|
||||||
|
|
||||||
* [Byron](https://github.com/bh90210) - At times, Byron has single handedly kept this project alive. Without his incredible input, we never would have got to v1.
|
|
||||||
|
|
||||||
This project was mainly coded to the following albums:
|
This project was mainly coded to the following albums:
|
||||||
|
|
||||||
* [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
|
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
|
||||||
* [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
|
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
|
||||||
* [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
|
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
|
||||||
* [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
|
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
|
||||||
* [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
|
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
|
||||||
* [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
|
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
|
||||||
* [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
|
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
|
||||||
* [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
|
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
|
||||||
* [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
|
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
|
||||||
* [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
|
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
|
||||||
* [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
|
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
|
||||||
* [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
||||||
* [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
||||||
|
|
||||||
## Licensing
|
<span id="nav-11"></span>
|
||||||
|
|
||||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
|
||||||
|
|
||||||
## Special Thanks
|
## Special Thanks
|
||||||
|
|
||||||
<p align="center" style="text-align: center">
|
<p align="center" style="text-align: center">
|
||||||
A *huge* thanks to <a href="https://pace.dev"><img src="pace.jpeg"/> Pace</a> for sponsoring the project and helping the efforts to get Wails ported to Apple Silicon!<br/><br/>
|
<a href="https://pace.dev"><img src="pace.jpeg"/></a><br/>
|
||||||
|
A <i>huge<i/> thanks to <a href="https://pace.dev">Pace</a> for sponsoring the project and helping the efforts to get Wails ported to Apple Silicon!<br/><br/>
|
||||||
If you are looking for a Project Management tool that's powerful but quick and easy to use, check them out!<br/><br/>
|
If you are looking for a Project Management tool that's powerful but quick and easy to use, check them out!<br/><br/>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
352
README.zh-Hans.md
Normal file
352
README.zh-Hans.md
Normal file
@@ -0,0 +1,352 @@
|
|||||||
|
<p align="center" style="text-align: center">
|
||||||
|
<img src="logo.png" width="40%"><br/>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
使用 Go 和 Web 技术构建桌面应用程序。<br/><br/>
|
||||||
|
<a href="https://github.com/wailsapp/wails/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg"></a>
|
||||||
|
<a href="https://goreportcard.com/report/github.com/wailsapp/wails"><img src="https://goreportcard.com/badge/github.com/wailsapp/wails"/></a>
|
||||||
|
<a href="http://godoc.org/github.com/wailsapp/wails"><img src="https://img.shields.io/badge/godoc-reference-blue.svg"/></a>
|
||||||
|
<a href="https://www.codefactor.io/repository/github/wailsapp/wails"><img src="https://www.codefactor.io/repository/github/wailsapp/wails/badge" alt="CodeFactor" /></a>
|
||||||
|
<a href="https://github.com/wailsapp/wails/issues"><img src="https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat" alt="CodeFactor" /></a>
|
||||||
|
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fwailsapp%2Fwails.svg?type=shield"/></a>
|
||||||
|
<a href="https://houndci.com"><img src="https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg"/></a>
|
||||||
|
<a href="https://github.com/avelino/awesome-go" rel="nofollow"><img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome"></a>
|
||||||
|
<a href="https://github.com/wailsapp/wails/workflows/release/badge.svg?branch=master" rel="nofollow"><img src="https://github.com/wailsapp/wails/workflows/release/badge.svg?branch=master" alt="Release Pipelines"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<span id="nav-1"></span>
|
||||||
|
|
||||||
|
## 国际化
|
||||||
|
|
||||||
|
[English](README.md) | 简体中文
|
||||||
|
|
||||||
|
向 Go 程序提供 Web 接口的传统方法是通过内置 Web 服务器。Wails 提供了一种不同的方法:它提供了将 Go 代码和 Web
|
||||||
|
前端都包装成单个二进制文件的能力。通过提供工具,可以很轻松的完成项目的创建、编译和打包。你所要做的就是发挥创意!
|
||||||
|
|
||||||
|
官方文档可以在 [https://wails.app](https://wails.app) 中找到。
|
||||||
|
|
||||||
|
国内镜像站点 [https://wails.top](https://wails.top)。
|
||||||
|
|
||||||
|
<span id="nav-2"></span>
|
||||||
|
|
||||||
|
## 内容目录
|
||||||
|
|
||||||
|
- [1. 国际化](#nav-1)
|
||||||
|
- [2. 内容目录](#nav-2)
|
||||||
|
- [3. 特征](#nav-3)
|
||||||
|
- [4. 赞助商](#nav-4)
|
||||||
|
- [5. 安装](#nav-5)
|
||||||
|
- [5.1 MacOS](#nav-5-1)
|
||||||
|
- [5.2 Linux](#nav-5-2)
|
||||||
|
- [5.2.1 Debian/Ubuntu](#nav-5-2-1)
|
||||||
|
- [5.2.2 Arch Linux / ArchLabs / Ctlos Linux](#nav-5-2-2)
|
||||||
|
- [5.2.3 Centos](#nav-5-2-3)
|
||||||
|
- [5.2.4 Fedora](#nav-5-2-4)
|
||||||
|
- [5.2.5 VoidLinux & VoidLinux-musl](#nav-5-2-5)
|
||||||
|
- [5.2.6 Gentoo](#nav-5-2-6)
|
||||||
|
- [5.3 Windows](#nav-5-3)
|
||||||
|
- [6. 安装](#nav-6)
|
||||||
|
- [7. 下一步](#nav-7)
|
||||||
|
- [8. 常见问题](#nav-8)
|
||||||
|
- [9. 贡献者](#nav-9)
|
||||||
|
- [10. 特别提及](#nav-10)
|
||||||
|
- [11. 许可协议](#nav-11)
|
||||||
|
- [12. 特别感谢](#nav-12)
|
||||||
|
|
||||||
|
<span id="nav-3"></span>
|
||||||
|
|
||||||
|
## 特征
|
||||||
|
|
||||||
|
- 后端使用标准 Go
|
||||||
|
- 使用任意前端技术构建 UI 界面
|
||||||
|
- 快速为您的 Go 应用生成 Vue、Vuetify、React 前端代码
|
||||||
|
- 通过简单的绑定命令将 Go 方法暴露到前端
|
||||||
|
- 使用原生渲染引擎 - 无嵌入式浏览器
|
||||||
|
- 共享事件系统
|
||||||
|
- 原生文件系统对话框
|
||||||
|
- 强大的命令行工具
|
||||||
|
- 跨多个平台
|
||||||
|
|
||||||
|
<span id="nav-4"></span>
|
||||||
|
|
||||||
|
## 赞助商
|
||||||
|
|
||||||
|
这个项目由以下这些人或者公司支持:
|
||||||
|
|
||||||
|
|
||||||
|
<a href="https://github.com/sponsors/leaanthony" style="width:100px;">
|
||||||
|
<img src="sponsors/bronze%20sponsor.png" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/snider" style="width:100px;">
|
||||||
|
<img src="https://github.com/snider.png?size=100" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/codydbentley" style="width:100px">
|
||||||
|
<img src="https://github.com/codydbentley.png?size=100" width="100"/>
|
||||||
|
</a>
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<a href="https://github.com/matryer" style="width:100px">
|
||||||
|
<img src="https://github.com/matryer.png" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://www.jetbrains.com?from=Wails" style="width:100px">
|
||||||
|
<img src="/img/jetbrains-grayscale.png" width="100"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/tc-hib" style="width:55px">
|
||||||
|
<img src="https://github.com/tc-hib.png?size=55" width="55"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/picatz" style="width:50px">
|
||||||
|
<img src="https://github.com/picatz.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/tylertravisty" style="width:50px">
|
||||||
|
<img src="https://github.com/tylertravisty.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/akhudek" style="width:50px">
|
||||||
|
<img src="https://github.com/akhudek.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/trea" style="width:50px">
|
||||||
|
<img src="https://github.com/trea.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/LanguageAgnostic" style="width:55px">
|
||||||
|
<img src="https://github.com/LanguageAgnostic.png?size=55" width="55"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/fcjr" style="width:55px">
|
||||||
|
<img src="https://github.com/fcjr.png?size=55" width="55"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/nickarellano" style="width:60px">
|
||||||
|
<img src="https://github.com/nickarellano.png?size=60" width="60"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/bglw" style="width:65px">
|
||||||
|
<img src="https://github.com/bglw.png?size=65" width="65"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/jugglingjsons" style="width:50px">
|
||||||
|
<img src="https://github.com/jugglingjsons.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/marcus-crane" style="width:65px">
|
||||||
|
<img src="https://github.com/marcus-crane.png?size=65" width="65"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/bbergshaven" style="width:45px">
|
||||||
|
<img src="https://github.com/bbergshaven.png?size=45" width="45"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/Gilgames000" style="width:45px">
|
||||||
|
<img src="https://github.com/Gilgames000.png?size=45" width="45"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/ilgityildirim" style="width:50px">
|
||||||
|
<img src="https://github.com/ilgityildirim.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/ondoki" style="width:65px">
|
||||||
|
<img src="https://github.com/ondoki.png?size=65" width="65"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/questrail" style="width:50px">
|
||||||
|
<img src="https://github.com/questrail.png?size=50" width="50"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/DonTomato" style="width:45px">
|
||||||
|
<img src="https://github.com/DonTomato.png?size=45" width="45"/>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<span id="nav-5"></span>
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
Wails 使用 cgo 与原生渲染引擎结合,因此需要依赖一些平台的库以及 Go 的安装。基本要求是:
|
||||||
|
|
||||||
|
- Go 1.16
|
||||||
|
- npm
|
||||||
|
|
||||||
|
<span id="nav-5-1"></span>
|
||||||
|
|
||||||
|
### MacOS
|
||||||
|
|
||||||
|
请确保已安装 xcode 命令行工具。这可以通过运行下面的命令来完成:
|
||||||
|
|
||||||
|
`xcode-select --install`
|
||||||
|
|
||||||
|
<span id="nav-5-2"></span>
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
<span id="nav-5-2-1"></span>
|
||||||
|
|
||||||
|
#### Debian/Ubuntu
|
||||||
|
|
||||||
|
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
||||||
|
|
||||||
|
_Debian: 8, 9, 10_
|
||||||
|
|
||||||
|
_Ubuntu: 16.04, 18.04, 19.04_
|
||||||
|
|
||||||
|
_也成功测试了: Zorin 15, Parrot 4.7, Linuxmint 19, Elementary 5, Kali, Neon_, Pop!\_OS
|
||||||
|
|
||||||
|
<span id="nav-5-2-2"></span>
|
||||||
|
|
||||||
|
#### Arch Linux / ArchLabs / Ctlos Linux
|
||||||
|
|
||||||
|
`sudo pacman -S webkit2gtk gtk3`
|
||||||
|
|
||||||
|
_也成功测试了: Manjaro & ArcoLinux_
|
||||||
|
|
||||||
|
<span id="nav-5-2-3"></span>
|
||||||
|
|
||||||
|
#### Centos
|
||||||
|
|
||||||
|
`sudo yum install webkitgtk3-devel gtk3-devel`
|
||||||
|
|
||||||
|
_CentOS 6, 7_
|
||||||
|
|
||||||
|
<span id="nav-5-2-4"></span>
|
||||||
|
|
||||||
|
#### Fedora
|
||||||
|
|
||||||
|
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
||||||
|
|
||||||
|
_Fedora 29, 30_
|
||||||
|
|
||||||
|
<span id="nav-5-2-5"></span>
|
||||||
|
|
||||||
|
#### VoidLinux & VoidLinux-musl
|
||||||
|
|
||||||
|
`xbps-install gtk+3-devel webkit2gtk-devel`
|
||||||
|
|
||||||
|
<span id="nav-5-2-6"></span>
|
||||||
|
|
||||||
|
#### Gentoo
|
||||||
|
|
||||||
|
`sudo emerge gtk+:3 webkit-gtk`
|
||||||
|
|
||||||
|
<span id="nav-5-3"></span>
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
Windows 需要 GCC 和相关工具。 建议从 [http://tdm-gcc.tdragon.net/download](http://tdm-gcc.tdragon.net/download) 下载, 安装完成,您就可以开始了。
|
||||||
|
|
||||||
|
<span id="nav-6"></span>
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
**确保 Go modules 是开启的:GO111MODULE=on 并且 go/bin 在您的 PATH 变量中。**
|
||||||
|
|
||||||
|
安装很简单,运行以下命令:
|
||||||
|
|
||||||
|
<pre style='color:white'>
|
||||||
|
go get -u github.com/wailsapp/wails/cmd/wails
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<span id="nav-7"></span>
|
||||||
|
|
||||||
|
## 下一步
|
||||||
|
|
||||||
|
建议在此时阅读 [https://wails.app](https://wails.app) 上面的文档.
|
||||||
|
|
||||||
|
<span id="nav-8"></span>
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
- 它是 Electron 的替代品吗?
|
||||||
|
|
||||||
|
取决于您的要求。它旨在使 Go 程序员可以轻松制作轻量级桌面应用程序或在其现有应用程序中添加前端。尽管 Wails 当前不提供对诸如菜单之类的原生元素的钩子,但将来可能会改变。
|
||||||
|
|
||||||
|
- 这个项目针对的是谁?
|
||||||
|
|
||||||
|
希望将 HTML / JS / CSS 前端与其应用程序捆绑在一起的程序员,而不是借助创建服务并打开浏览器进行查看的方式。
|
||||||
|
|
||||||
|
- 名字怎么来的?
|
||||||
|
|
||||||
|
当我看到 WebView 时,我想"我真正想要的是围绕构建 WebView 应用程序工作,有点像 Rails 对于 Ruby"。因此,最初它是一个文字游戏(Webview on
|
||||||
|
Rails)。碰巧也是我来自的 [国家](https://en.wikipedia.org/wiki/Wales) 的英文名字的同音。所以就是他了。
|
||||||
|
|
||||||
|
<span id="nav-9"></span>
|
||||||
|
|
||||||
|
## 贡献者
|
||||||
|
|
||||||
|
<a href="https://github.com/qaisjp"><img src="https://github.com/qaisjp.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/alee792"><img src="https://github.com/alee792.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/lanzafame"><img src="https://github.com/lanzafame.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/mattn"><img src="https://github.com/mattn.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/0xflotus"><img src="https://github.com/0xflotus.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/mdhender"><img src="https://github.com/mdhender.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/fishfishfish2104"><img src="https://github.com/fishfishfish2104.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/intelwalk"><img src="https://github.com/intelwalk.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/ocelotsloth"><img src="https://github.com/ocelotsloth.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/bh90210"><img src="https://github.com/bh90210.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/iceleo-com"><img src="https://github.com/iceleo-com.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/fallendusk"><img src="https://github.com/fallendusk.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Chronophylos"><img src="https://github.com/Chronophylos.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Vaelatern"><img src="https://github.com/Vaelatern.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/mewmew"><img src="https://github.com/mewmew.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/kraney"><img src="https://github.com/kraney.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/JackMordaunt"><img src="https://github.com/JackMordaunt.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/MichaelHipp"><img src="https://github.com/MichaelHipp.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/tmclane"><img src="https://github.com/tmclane.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Rested"><img src="https://github.com/Rested.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Jarek-SRT"><img src="https://github.com/Jarek-SRT.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/konez2k"><img src="https://github.com/konez2k.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/sayuthisobri"><img src="https://github.com/sayuthisobri.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/dedo1911"><img src="https://github.com/dedo1911.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/fdidron"><img src="https://github.com/fdidron.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Splode"><img src="https://github.com/Splode.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Lyimmi"><img src="https://github.com/Lyimmi.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Unix4ever"><img src="https://github.com/Unix4ever.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/timkippdev"><img src="https://github.com/timkippdev.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/kyoto44"><img src="https://github.com/kyoto44.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/artooro"><img src="https://github.com/artooro.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/ilgityildirim"><img src="https://github.com/ilgityildirim.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/gelleson"><img src="https://github.com/gelleson.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/kmuchmore"><img src="https://github.com/kmuchmore.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/aayush420"><img src="https://github.com/aayush420.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/Rezrazi"><img src="https://github.com/Rezrazi.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/misitebao"><img src="https://github.com/misitebao.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/DrunkenPoney"><img src="https://github.com/DrunkenPoney.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/SophieAu"><img src="https://github.com/SophieAu.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/alexmat"><img src="https://github.com/alexmat.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/RH12503"><img src="https://github.com/RH12503.png?size=40" width="40"/></a>
|
||||||
|
<a href="https://github.com/hi019"><img src="https://github.com/hi019.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/Igogrek"><img src="https://github.com/Igogrek.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/aschey"><img src="https://github.com/aschey.png?size=40" width="40"/></a></a>
|
||||||
|
<a href="https://github.com/akhudek"><img src="https://github.com/akhudek.png?size=40" width="40"/></a></a>
|
||||||
|
|
||||||
|
<span id="nav-10"></span>
|
||||||
|
|
||||||
|
## 特别提及
|
||||||
|
|
||||||
|
如果没有以下人员,此项目或许永远不会存在:
|
||||||
|
|
||||||
|
- [Dustin Krysak](https://wiki.ubuntu.com/bashfulrobot) - 他的支持和反馈是巨大的。
|
||||||
|
- [Serge Zaitsev](https://github.com/zserge) - Wails 窗口所使用的 [Webview](https://github.com/zserge/webview) 的作者。
|
||||||
|
- [Byron](https://github.com/bh90210) - 有时,Byron 单枪匹马地保持这个项目活着。没有他令人难以置信的投入,我们永远不会得到 v1 。
|
||||||
|
|
||||||
|
This project was mainly coded to the following albums:
|
||||||
|
|
||||||
|
- [Manic Street Preachers - Resistance Is Futile](https://open.spotify.com/album/1R2rsEUqXjIvAbzM0yHrxA)
|
||||||
|
- [Manic Street Preachers - This Is My Truth, Tell Me Yours](https://open.spotify.com/album/4VzCL9kjhgGQeKCiojK1YN)
|
||||||
|
- [The Midnight - Endless Summer](https://open.spotify.com/album/4Krg8zvprquh7TVn9OxZn8)
|
||||||
|
- [Gary Newman - Savage (Songs from a Broken World)](https://open.spotify.com/album/3kMfsD07Q32HRWKRrpcexr)
|
||||||
|
- [Steve Vai - Passion & Warfare](https://open.spotify.com/album/0oL0OhrE2rYVns4IGj8h2m)
|
||||||
|
- [Ben Howard - Every Kingdom](https://open.spotify.com/album/1nJsbWm3Yy2DW1KIc1OKle)
|
||||||
|
- [Ben Howard - Noonday Dream](https://open.spotify.com/album/6astw05cTiXEc2OvyByaPs)
|
||||||
|
- [Adwaith - Melyn](https://open.spotify.com/album/2vBE40Rp60tl7rNqIZjaXM)
|
||||||
|
- [Gwidaith Hen Fran - Cedors Hen Wrach](https://open.spotify.com/album/3v2hrfNGINPLuDP0YDTOjm)
|
||||||
|
- [Metallica - Metallica](https://open.spotify.com/album/2Kh43m04B1UkVcpcRa1Zug)
|
||||||
|
- [Bloc Party - Silent Alarm](https://open.spotify.com/album/6SsIdN05HQg2GwYLfXuzLB)
|
||||||
|
- [Maxthor - Another World](https://open.spotify.com/album/3tklE2Fgw1hCIUstIwPBJF)
|
||||||
|
- [Alun Tan Lan - Y Distawrwydd](https://open.spotify.com/album/0c32OywcLpdJCWWMC6vB8v)
|
||||||
|
|
||||||
|
<span id="nav-11"></span>
|
||||||
|
|
||||||
|
## 许可协议
|
||||||
|
|
||||||
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fwailsapp%2Fwails?ref=badge_large)
|
||||||
|
|
||||||
|
<span id="nav-12"></span>
|
||||||
|
|
||||||
|
## 特别感谢
|
||||||
|
|
||||||
|
<p align="center" style="text-align: center">
|
||||||
|
<a href="https://pace.dev"><img src="pace.jpeg"/></a><br/>
|
||||||
|
<i>非常<i/>感谢<a href="https://pace.dev">Pace</a>对项目的赞助,并帮助将 Wails 移植到 Apple Silicon !<br/><br/>
|
||||||
|
如果您正在寻找一个强大并且快速和易于使用的项目管理工具,可以看看他们!<br/><br/>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center" style="text-align: center">
|
||||||
|
特别感谢 JetBrains 向我们捐赠许可!<br/><br/>
|
||||||
|
请点击 logo 让他们知道你的感激之情!<br/><br/>
|
||||||
|
<a href="https://www.jetbrains.com?from=Wails"><img src="jetbrains-grayscale.png" width="30%"></a>
|
||||||
|
</p>
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build linux || darwin || !windows
|
||||||
// +build linux darwin !windows
|
// +build linux darwin !windows
|
||||||
|
|
||||||
package wails
|
package wails
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build windows || !linux || !darwin
|
||||||
// +build windows !linux !darwin
|
// +build windows !linux !darwin
|
||||||
|
|
||||||
package wails
|
package wails
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -24,7 +24,7 @@ func (g *GitHubHelper) GetVersionTags() ([]*SemanticVersion, error) {
|
|||||||
result := []*SemanticVersion{}
|
result := []*SemanticVersion{}
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
resp, err := http.Get("https://api.github.com/repos/wailsapp/wails/tags")
|
resp, err := http.Get("https://api.github.com/repos/wailsapp/wails/releases")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|||||||
139
cmd/helpers.go
139
cmd/helpers.go
@@ -2,7 +2,6 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/user"
|
"os/user"
|
||||||
@@ -12,13 +11,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/leaanthony/mewn"
|
|
||||||
"github.com/leaanthony/mewn/lib"
|
|
||||||
"github.com/leaanthony/slicer"
|
"github.com/leaanthony/slicer"
|
||||||
"github.com/leaanthony/spinner"
|
"github.com/leaanthony/spinner"
|
||||||
|
wailsruntime "github.com/wailsapp/wails/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
const xgoVersion = "1.0.1"
|
const xgoVersion = "1.16.3"
|
||||||
|
|
||||||
var fs = NewFSHelper()
|
var fs = NewFSHelper()
|
||||||
|
|
||||||
@@ -48,7 +46,7 @@ func InstallGoDependencies(verbose bool) error {
|
|||||||
depSpinner.SetSpinSpeed(50)
|
depSpinner.SetSpinSpeed(50)
|
||||||
depSpinner.Start()
|
depSpinner.Start()
|
||||||
}
|
}
|
||||||
err := NewProgramHelper(verbose).RunCommand("go get")
|
err := NewProgramHelper(verbose).RunCommand("go mod tidy")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !verbose {
|
if !verbose {
|
||||||
depSpinner.Error()
|
depSpinner.Error()
|
||||||
@@ -61,30 +59,6 @@ func InstallGoDependencies(verbose bool) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmbedAssets will embed the built frontend assets via mewn.
|
|
||||||
func EmbedAssets() ([]string, error) {
|
|
||||||
mewnFiles := lib.GetMewnFiles([]string{}, false)
|
|
||||||
|
|
||||||
referencedAssets, err := lib.GetReferencedAssets(mewnFiles)
|
|
||||||
if err != nil {
|
|
||||||
return []string{}, err
|
|
||||||
}
|
|
||||||
|
|
||||||
targetFiles := []string{}
|
|
||||||
|
|
||||||
for _, referencedAsset := range referencedAssets {
|
|
||||||
packfileData, err := lib.GeneratePackFileString(referencedAsset, false)
|
|
||||||
if err != nil {
|
|
||||||
return []string{}, err
|
|
||||||
}
|
|
||||||
targetFile := filepath.Join(referencedAsset.BaseDir, referencedAsset.PackageName+"-mewn.go")
|
|
||||||
targetFiles = append(targetFiles, targetFile)
|
|
||||||
ioutil.WriteFile(targetFile, []byte(packfileData), 0644)
|
|
||||||
}
|
|
||||||
|
|
||||||
return targetFiles, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func InitializeCrossCompilation(verbose bool) error {
|
func InitializeCrossCompilation(verbose bool) error {
|
||||||
// Check Docker
|
// Check Docker
|
||||||
if err := CheckIfInstalled("docker"); err != nil {
|
if err := CheckIfInstalled("docker"); err != nil {
|
||||||
@@ -127,13 +101,16 @@ func BuildDocker(binaryName string, buildMode string, projectOptions *ProjectOpt
|
|||||||
// Check build directory
|
// Check build directory
|
||||||
buildDirectory := filepath.Join(fs.Cwd(), "build")
|
buildDirectory := filepath.Join(fs.Cwd(), "build")
|
||||||
if !fs.DirExists(buildDirectory) {
|
if !fs.DirExists(buildDirectory) {
|
||||||
fs.MkDir(buildDirectory)
|
err := fs.MkDir(buildDirectory)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildCommand := slicer.String()
|
buildCommand := slicer.String()
|
||||||
userid := 1000
|
userid := 1000
|
||||||
user, _ := user.Current()
|
currentUser, _ := user.Current()
|
||||||
if i, err := strconv.Atoi(user.Uid); err == nil {
|
if i, err := strconv.Atoi(currentUser.Uid); err == nil {
|
||||||
userid = i
|
userid = i
|
||||||
}
|
}
|
||||||
for _, arg := range []string{
|
for _, arg := range []string{
|
||||||
@@ -198,11 +175,6 @@ func BuildDocker(binaryName string, buildMode string, projectOptions *ProjectOpt
|
|||||||
// BuildNative builds on the target platform itself.
|
// BuildNative builds on the target platform itself.
|
||||||
func BuildNative(binaryName string, forceRebuild bool, buildMode string, projectOptions *ProjectOptions) error {
|
func BuildNative(binaryName string, forceRebuild bool, buildMode string, projectOptions *ProjectOptions) error {
|
||||||
|
|
||||||
// Check Mewn is installed
|
|
||||||
if err := CheckMewn(projectOptions.Verbose); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := CheckWindres(); err != nil {
|
if err := CheckWindres(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -275,12 +247,6 @@ func BuildNative(binaryName string, forceRebuild bool, buildMode string, project
|
|||||||
func BuildApplication(binaryName string, forceRebuild bool, buildMode string, packageApp bool, projectOptions *ProjectOptions) error {
|
func BuildApplication(binaryName string, forceRebuild bool, buildMode string, packageApp bool, projectOptions *ProjectOptions) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
// embed resources
|
|
||||||
targetFiles, err := EmbedAssets()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if projectOptions.CrossCompile {
|
if projectOptions.CrossCompile {
|
||||||
if err := InitializeCrossCompilation(projectOptions.Verbose); err != nil {
|
if err := InitializeCrossCompilation(projectOptions.Verbose); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -296,20 +262,6 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup temporary embedded assets
|
|
||||||
defer func() {
|
|
||||||
for _, filename := range targetFiles {
|
|
||||||
if err := os.Remove(filename); err != nil {
|
|
||||||
fmt.Println(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Removed by popular demand
|
|
||||||
// TODO: Potentially add a flag to cleanup
|
|
||||||
// if projectOptions.Platform == "windows" {
|
|
||||||
// helper.CleanWindows(projectOptions)
|
|
||||||
// }
|
|
||||||
}()
|
|
||||||
|
|
||||||
if projectOptions.CrossCompile {
|
if projectOptions.CrossCompile {
|
||||||
err = BuildDocker(binaryName, buildMode, projectOptions)
|
err = BuildDocker(binaryName, buildMode, projectOptions)
|
||||||
} else {
|
} else {
|
||||||
@@ -374,30 +326,6 @@ func BuildFrontend(projectOptions *ProjectOptions) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckMewn checks if mewn is installed and if not, attempts to fetch it
|
|
||||||
func CheckMewn(verbose bool) (err error) {
|
|
||||||
programHelper := NewProgramHelper(verbose)
|
|
||||||
if !programHelper.IsInstalled("mewn") {
|
|
||||||
var buildSpinner *spinner.Spinner
|
|
||||||
if !verbose {
|
|
||||||
buildSpinner = spinner.New()
|
|
||||||
buildSpinner.SetSpinSpeed(50)
|
|
||||||
buildSpinner.Start("Installing Mewn asset packer...")
|
|
||||||
}
|
|
||||||
err := programHelper.InstallGoPackage("github.com/leaanthony/mewn/cmd/mewn")
|
|
||||||
if err != nil {
|
|
||||||
if buildSpinner != nil {
|
|
||||||
buildSpinner.Error()
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if buildSpinner != nil {
|
|
||||||
buildSpinner.Success()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// CheckWindres checks if Windres is installed and if not, aborts
|
// CheckWindres checks if Windres is installed and if not, aborts
|
||||||
func CheckWindres() (err error) {
|
func CheckWindres() (err error) {
|
||||||
if runtime.GOOS != "windows" { // FIXME: Handle windows cross-compile for windows!
|
if runtime.GOOS != "windows" { // FIXME: Handle windows cross-compile for windows!
|
||||||
@@ -493,11 +421,18 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update md5sum file
|
// Update md5sum file
|
||||||
ioutil.WriteFile(md5sumFile, []byte(packageJSONMD5), 0644)
|
err := os.WriteFile(md5sumFile, []byte(packageJSONMD5), 0644)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Install the runtime
|
// Install the runtime
|
||||||
err = InstallRuntime(caller, projectDir, projectOptions)
|
if caller == "build" {
|
||||||
|
err = InstallProdRuntime(projectDir, projectOptions)
|
||||||
|
} else {
|
||||||
|
err = InstallBridge(projectDir, projectOptions)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -510,28 +445,17 @@ func InstallFrontendDeps(projectDir string, projectOptions *ProjectOptions, forc
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallRuntime installs the correct runtime for the type of build
|
|
||||||
func InstallRuntime(caller string, projectDir string, projectOptions *ProjectOptions) error {
|
|
||||||
if caller == "build" {
|
|
||||||
return InstallProdRuntime(projectDir, projectOptions)
|
|
||||||
}
|
|
||||||
|
|
||||||
return InstallBridge(projectDir, projectOptions)
|
|
||||||
}
|
|
||||||
|
|
||||||
// InstallBridge installs the relevant bridge javascript library
|
// InstallBridge installs the relevant bridge javascript library
|
||||||
func InstallBridge(projectDir string, projectOptions *ProjectOptions) error {
|
func InstallBridge(projectDir string, projectOptions *ProjectOptions) error {
|
||||||
bridgeFileData := mewn.String("../runtime/assets/bridge.js")
|
|
||||||
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, "node_modules", "@wailsapp", "runtime", "init.js")
|
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, "node_modules", "@wailsapp", "runtime", "init.js")
|
||||||
err := fs.CreateFile(bridgeFileTarget, []byte(bridgeFileData))
|
err := fs.CreateFile(bridgeFileTarget, wailsruntime.BridgeJS)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// InstallProdRuntime installs the production runtime
|
// InstallProdRuntime installs the production runtime
|
||||||
func InstallProdRuntime(projectDir string, projectOptions *ProjectOptions) error {
|
func InstallProdRuntime(projectDir string, projectOptions *ProjectOptions) error {
|
||||||
prodInit := mewn.String("../runtime/js/runtime/init.js")
|
|
||||||
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, "node_modules", "@wailsapp", "runtime", "init.js")
|
bridgeFileTarget := filepath.Join(projectDir, projectOptions.FrontEnd.Dir, "node_modules", "@wailsapp", "runtime", "init.js")
|
||||||
err := fs.CreateFile(bridgeFileTarget, []byte(prodInit))
|
err := fs.CreateFile(bridgeFileTarget, wailsruntime.InitJS)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,7 +475,22 @@ func ServeProject(projectOptions *ProjectOptions, logger *Logger) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.Yellow("Serving Application: " + location)
|
logger.Yellow("Serving Application: " + location)
|
||||||
cmd := exec.Command(location)
|
var args []string
|
||||||
|
if len(os.Args) > 2 {
|
||||||
|
foundArgSep := false
|
||||||
|
for index, arg := range os.Args[2:] {
|
||||||
|
if arg == "--" {
|
||||||
|
foundArgSep = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if foundArgSep {
|
||||||
|
args = os.Args[index:]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.Yellow("Passing arguments: %+v", args)
|
||||||
|
}
|
||||||
|
cmd := exec.Command(location, args...)
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
err = cmd.Run()
|
err = cmd.Run()
|
||||||
@@ -595,3 +534,9 @@ func ldFlags(po *ProjectOptions, buildMode string) string {
|
|||||||
}
|
}
|
||||||
return ldflags
|
return ldflags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getGitConfigValue(key string) (string, error) {
|
||||||
|
output, err := exec.Command("git", "config", "--get", "--null", key).Output()
|
||||||
|
// When using --null git appends a null character (\u0000) to the command output
|
||||||
|
return strings.TrimRight(string(output), "\u0000"), err
|
||||||
|
}
|
||||||
|
|||||||
40
cmd/linux.go
40
cmd/linux.go
@@ -67,6 +67,15 @@ const (
|
|||||||
Ctlos
|
Ctlos
|
||||||
// EndeavourOS linux distribution
|
// EndeavourOS linux distribution
|
||||||
EndeavourOS
|
EndeavourOS
|
||||||
|
// Crux linux distribution
|
||||||
|
Crux
|
||||||
|
// RHEL distribution
|
||||||
|
RHEL
|
||||||
|
// NixOS distribution
|
||||||
|
NixOS
|
||||||
|
// Artix linux distribution
|
||||||
|
ArtixLinux
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroInfo contains all the information relating to a linux distribution
|
// DistroInfo contains all the information relating to a linux distribution
|
||||||
@@ -129,6 +138,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
|||||||
result.Distribution = Fedora
|
result.Distribution = Fedora
|
||||||
case "centos":
|
case "centos":
|
||||||
result.Distribution = CentOS
|
result.Distribution = CentOS
|
||||||
|
case "rhel":
|
||||||
|
result.Distribution = RHEL
|
||||||
case "arch":
|
case "arch":
|
||||||
result.Distribution = Arch
|
result.Distribution = Arch
|
||||||
case "archlabs":
|
case "archlabs":
|
||||||
@@ -175,6 +186,12 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
|||||||
result.Distribution = Solus
|
result.Distribution = Solus
|
||||||
case "endeavouros":
|
case "endeavouros":
|
||||||
result.Distribution = EndeavourOS
|
result.Distribution = EndeavourOS
|
||||||
|
case "crux":
|
||||||
|
result.Distribution = Crux
|
||||||
|
case "nixos":
|
||||||
|
result.Distribution = NixOS
|
||||||
|
case "artix":
|
||||||
|
result.Distribution = ArtixLinux
|
||||||
default:
|
default:
|
||||||
result.Distribution = Unknown
|
result.Distribution = Unknown
|
||||||
}
|
}
|
||||||
@@ -255,6 +272,29 @@ func RpmInstalled(packageName string) (bool, error) {
|
|||||||
return exitCode == 0, nil
|
return exitCode == 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PrtGetInstalled uses prt-get to see if a package is installed
|
||||||
|
func PrtGetInstalled(packageName string) (bool, error) {
|
||||||
|
program := NewProgramHelper()
|
||||||
|
prtget := program.FindProgram("prt-get")
|
||||||
|
if prtget == nil {
|
||||||
|
return false, fmt.Errorf("cannot check dependencies: prt-get not found")
|
||||||
|
}
|
||||||
|
_, _, exitCode, _ := prtget.Run("isinst", packageName)
|
||||||
|
return exitCode == 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NixEnvInstalled uses nix-env to see if a package is installed
|
||||||
|
func NixEnvInstalled(packageName string) (bool, error) {
|
||||||
|
program := NewProgramHelper()
|
||||||
|
nixEnv := program.FindProgram("nix-env")
|
||||||
|
if nixEnv == nil {
|
||||||
|
return false, fmt.Errorf("cannot check dependencies: nix-env not found")
|
||||||
|
}
|
||||||
|
packageName = strings.ReplaceAll(packageName, "+", `\+`)
|
||||||
|
_, _, exitCode, _ := nixEnv.Run("-q", packageName)
|
||||||
|
return exitCode == 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
// RequestSupportForDistribution promts the user to submit a request to support their
|
// RequestSupportForDistribution promts the user to submit a request to support their
|
||||||
// currently unsupported distribution
|
// currently unsupported distribution
|
||||||
func RequestSupportForDistribution(distroInfo *DistroInfo) error {
|
func RequestSupportForDistribution(distroInfo *DistroInfo) error {
|
||||||
|
|||||||
@@ -138,6 +138,25 @@ distributions:
|
|||||||
help: Please install with `sudo yum install gtk3-devel` and try again
|
help: Please install with `sudo yum install gtk3-devel` and try again
|
||||||
- name: webkitgtk3-devel
|
- name: webkitgtk3-devel
|
||||||
help: Please install with `sudo yum install webkitgtk3-devel` and try again
|
help: Please install with `sudo yum install webkitgtk3-devel` and try again
|
||||||
|
rhel:
|
||||||
|
id: rhel
|
||||||
|
releases:
|
||||||
|
default:
|
||||||
|
version: default
|
||||||
|
name: Red Hat Enterprise Linux
|
||||||
|
gccversioncommand: *gccdumpversion
|
||||||
|
programs:
|
||||||
|
- name: gcc
|
||||||
|
help: Please install with `sudo yum install gcc-c++ make` and try again
|
||||||
|
- name: pkg-config
|
||||||
|
help: Please install with `sudo yum install pkgconf-pkg-config` and try again
|
||||||
|
- name: npm
|
||||||
|
help: Please install with `sudo yum install epel-release && sudo yum install nodejs` and try again
|
||||||
|
libraries:
|
||||||
|
- name: gtk3-devel
|
||||||
|
help: Please install with `sudo yum install gtk3-devel` and try again
|
||||||
|
- name: webkitgtk3-devel
|
||||||
|
help: Please install with `sudo yum install webkitgtk3-devel` and try again
|
||||||
fedora:
|
fedora:
|
||||||
id: fedora
|
id: fedora
|
||||||
releases:
|
releases:
|
||||||
@@ -194,6 +213,15 @@ distributions:
|
|||||||
gccversioncommand: *gccdumpversion
|
gccversioncommand: *gccdumpversion
|
||||||
programs: *archdefaultprograms
|
programs: *archdefaultprograms
|
||||||
libraries: *archdefaultlibraries
|
libraries: *archdefaultlibraries
|
||||||
|
artix:
|
||||||
|
id: artix
|
||||||
|
releases:
|
||||||
|
default:
|
||||||
|
version: default
|
||||||
|
name: Artix Linux
|
||||||
|
gccversioncommand: *gccdumpversion
|
||||||
|
programs: *archdefaultprograms
|
||||||
|
libraries: *archdefaultlibraries
|
||||||
ctlos:
|
ctlos:
|
||||||
id: ctlos
|
id: ctlos
|
||||||
releases:
|
releases:
|
||||||
@@ -299,11 +327,49 @@ distributions:
|
|||||||
- name: webkit2gtk3-devel
|
- name: webkit2gtk3-devel
|
||||||
help: Please install with `sudo zypper in webkit2gtk3-devel` and try again
|
help: Please install with `sudo zypper in webkit2gtk3-devel` and try again
|
||||||
opensuse-leap:
|
opensuse-leap:
|
||||||
id: opensuse-leap
|
id: opensuse-leap
|
||||||
releases:
|
releases:
|
||||||
default:
|
default:
|
||||||
version: default
|
version: default
|
||||||
name: openSUSE Leap
|
name: openSUSE Leap
|
||||||
gccversioncommand: *gccdumpfullversion
|
gccversioncommand: *gccdumpfullversion
|
||||||
programs: *opensusedefaultprograms
|
programs: *opensusedefaultprograms
|
||||||
libraries: *opensusedefaultlibraries
|
libraries: *opensusedefaultlibraries
|
||||||
|
crux:
|
||||||
|
id: crux
|
||||||
|
releases:
|
||||||
|
default:
|
||||||
|
version: default
|
||||||
|
name: Crux Linux
|
||||||
|
gccversioncommand: *gccdumpversion
|
||||||
|
programs:
|
||||||
|
- name: gcc
|
||||||
|
help: Please install with `sudo prt-get depinst gcc-c++ make` and try again
|
||||||
|
- name: pkg-config
|
||||||
|
help: Please install with `sudo prt-get depinst pkg-config` and try again
|
||||||
|
- name: npm
|
||||||
|
help: Please install with `sudo prt-get depinst nodejs` and try again
|
||||||
|
libraries:
|
||||||
|
- name: gtk3
|
||||||
|
help: Please install with `sudo prt-get depinst gtk3` and try again
|
||||||
|
- name: webkitgtk
|
||||||
|
help: Please install with `sudo prt-get depinst webkitgtk` and try again
|
||||||
|
nixos:
|
||||||
|
id: nixos
|
||||||
|
releases:
|
||||||
|
default:
|
||||||
|
version: default
|
||||||
|
name: NixOS
|
||||||
|
gccversioncommand: *gccdumpversion
|
||||||
|
programs:
|
||||||
|
- name: gcc
|
||||||
|
help: Please install with `nix-env -iA nixos.gcc`
|
||||||
|
- name: pkg-config
|
||||||
|
help: Please install with `nix-env -iA nixos.pkg-config`
|
||||||
|
- name: npm
|
||||||
|
help: Please install with `nix-env -iA nixos.nodejs`
|
||||||
|
libraries:
|
||||||
|
- name: gtk+3
|
||||||
|
help: Please install with `nix-env -iA nixos.gtk3`
|
||||||
|
- name: webkitgtk
|
||||||
|
help: Please install with `nix-env -iA nixos.nodePackages.webkitgtk`
|
||||||
|
|||||||
@@ -354,7 +354,7 @@ func (b *PackageHelper) PackageWindows(po *ProjectOptions, cleanUp bool) error {
|
|||||||
"docker", "run", "--rm",
|
"docker", "run", "--rm",
|
||||||
"-v", outputDir + ":/build",
|
"-v", outputDir + ":/build",
|
||||||
"--entrypoint", "/bin/sh",
|
"--entrypoint", "/bin/sh",
|
||||||
"wailsapp/xgo:latest",
|
"wailsapp/xgo:1.16.3",
|
||||||
"-c", "/usr/bin/x86_64-w64-mingw32-windres -o /build/" + basename + "-res.syso /build/" + basename + ".rc",
|
"-c", "/usr/bin/x86_64-w64-mingw32-windres -o /build/" + basename + "-res.syso /build/" + basename + ".rc",
|
||||||
}
|
}
|
||||||
if err := NewProgramHelper().RunCommandArray(args); err != nil {
|
if err := NewProgramHelper().RunCommandArray(args); err != nil {
|
||||||
|
|||||||
@@ -99,11 +99,16 @@ func (s *SystemHelper) setup() error {
|
|||||||
|
|
||||||
if config.Name != "" {
|
if config.Name != "" {
|
||||||
systemConfig["name"] = PromptRequired("What is your name", config.Name)
|
systemConfig["name"] = PromptRequired("What is your name", config.Name)
|
||||||
|
} else if n, err := getGitConfigValue("user.name"); err == nil && n != "" {
|
||||||
|
systemConfig["name"] = PromptRequired("What is your name", n)
|
||||||
} else {
|
} else {
|
||||||
systemConfig["name"] = PromptRequired("What is your name")
|
systemConfig["name"] = PromptRequired("What is your name")
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.Email != "" {
|
if config.Email != "" {
|
||||||
systemConfig["email"] = PromptRequired("What is your email address", config.Email)
|
systemConfig["email"] = PromptRequired("What is your email address", config.Email)
|
||||||
|
} else if e, err := getGitConfigValue("user.email"); err == nil && e != "" {
|
||||||
|
systemConfig["email"] = PromptRequired("What is your email address", e)
|
||||||
} else {
|
} else {
|
||||||
systemConfig["email"] = PromptRequired("What is your email address")
|
systemConfig["email"] = PromptRequired("What is your email address")
|
||||||
}
|
}
|
||||||
@@ -180,7 +185,7 @@ func (s *SystemHelper) Initialise() error {
|
|||||||
return s.setup()
|
return s.setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SystemConfig - Defines system wode configuration data
|
// SystemConfig - Defines system wide configuration data
|
||||||
type SystemConfig struct {
|
type SystemConfig struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
@@ -276,9 +281,9 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
switch distroInfo.Distribution {
|
switch distroInfo.Distribution {
|
||||||
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS:
|
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS:
|
||||||
libraryChecker = DpkgInstalled
|
libraryChecker = DpkgInstalled
|
||||||
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM, EndeavourOS:
|
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM, EndeavourOS, ArtixLinux:
|
||||||
libraryChecker = PacmanInstalled
|
libraryChecker = PacmanInstalled
|
||||||
case CentOS, Fedora, Tumbleweed, Leap:
|
case CentOS, Fedora, Tumbleweed, Leap, RHEL:
|
||||||
libraryChecker = RpmInstalled
|
libraryChecker = RpmInstalled
|
||||||
case Gentoo:
|
case Gentoo:
|
||||||
libraryChecker = EqueryInstalled
|
libraryChecker = EqueryInstalled
|
||||||
@@ -286,6 +291,10 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
libraryChecker = XbpsInstalled
|
libraryChecker = XbpsInstalled
|
||||||
case Solus:
|
case Solus:
|
||||||
libraryChecker = EOpkgInstalled
|
libraryChecker = EOpkgInstalled
|
||||||
|
case Crux:
|
||||||
|
libraryChecker = PrtGetInstalled
|
||||||
|
case NixOS:
|
||||||
|
libraryChecker = NixEnvInstalled
|
||||||
default:
|
default:
|
||||||
return false, RequestSupportForDistribution(distroInfo)
|
return false, RequestSupportForDistribution(distroInfo)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "npx ng",
|
"ng": "npx ng",
|
||||||
"start": "npx ng serve --poll=2000 --host=0.0.0.0",
|
"serve": "npx ng serve --poll=2000 --host=0.0.0.0",
|
||||||
"build": "npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false",
|
"build": "npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false",
|
||||||
"test": "npx ng test",
|
"test": "npx ng test",
|
||||||
"lint": "npx ng lint",
|
"lint": "npx ng lint",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,10 +9,13 @@ func basic() string {
|
|||||||
return "World!"
|
return "World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/dist/my-app/main.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/dist/my-app/main.js")
|
//go:embed frontend/dist/my-app/styles.css
|
||||||
css := mewn.String("./frontend/dist/my-app/styles.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"author": "bh90210 <ktc@pm.me>",
|
"author": "bh90210 <ktc@pm.me>",
|
||||||
"created": "2019-06-15 18:23:48.666414555 +0300 EEST m=+223.934866008",
|
"created": "2019-06-15 18:23:48.666414555 +0300 EEST m=+223.934866008",
|
||||||
"frontenddir": "frontend",
|
"frontenddir": "frontend",
|
||||||
"serve": "npx ng serve --poll=2000",
|
"serve": "npm run serve",
|
||||||
"bridge": "src",
|
"bridge": "src",
|
||||||
"wailsdir": ""
|
"wailsdir": ""
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"@wailsapp/runtime": "^1.0.10"
|
"@wailsapp/runtime": "^1.0.10"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"serve": "react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,10 +9,13 @@ func basic() string {
|
|||||||
return "World!"
|
return "World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/build/static/js/main.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/build/static/js/main.js")
|
//go:embed frontend/build/static/css/main.css
|
||||||
css := mewn.String("./frontend/build/static/css/main.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"author": "bh90210 <ktc@pm.me>",
|
"author": "bh90210 <ktc@pm.me>",
|
||||||
"created": "2019-06-07 18:23:48.666414555 +0300 EEST m=+223.934866008",
|
"created": "2019-06-07 18:23:48.666414555 +0300 EEST m=+223.934866008",
|
||||||
"frontenddir": "frontend",
|
"frontenddir": "frontend",
|
||||||
"serve": "npm run start",
|
"serve": "npm run serve",
|
||||||
"bridge": "src",
|
"bridge": "src",
|
||||||
"wailsdir": ""
|
"wailsdir": ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"author": "{{.Author.Name}}<{{.Author.Email}}>",
|
"author": "{{.Author.Name}}<{{.Author.Email}}>",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"dev": "rollup -c -w",
|
"serve": "rollup -c -w",
|
||||||
"start": "sirv public"
|
"start": "sirv public"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import svelte from 'rollup-plugin-svelte';
|
|||||||
import resolve from '@rollup/plugin-node-resolve';
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
import commonjs from '@rollup/plugin-commonjs';
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
import livereload from 'rollup-plugin-livereload';
|
import livereload from 'rollup-plugin-livereload';
|
||||||
import { terser } from 'rollup-plugin-terser';
|
import {terser} from 'rollup-plugin-terser';
|
||||||
import image from '@rollup/plugin-image';
|
import image from '@rollup/plugin-image';
|
||||||
import babel from 'rollup-plugin-babel';
|
import babel from 'rollup-plugin-babel';
|
||||||
import polyfill from 'rollup-plugin-polyfill';
|
import polyfill from 'rollup-plugin-polyfill';
|
||||||
@@ -80,7 +80,6 @@ export default {
|
|||||||
{
|
{
|
||||||
targets: '> 0.25%, not dead, IE 11',
|
targets: '> 0.25%, not dead, IE 11',
|
||||||
modules: false,
|
modules: false,
|
||||||
spec: true,
|
|
||||||
useBuiltIns: 'usage',
|
useBuiltIns: 'usage',
|
||||||
forceAllTransforms: true,
|
forceAllTransforms: true,
|
||||||
corejs: 3,
|
corejs: 3,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,9 +9,13 @@ func basic() string {
|
|||||||
return "World!"
|
return "World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:embed frontend/public/build/bundle.js
|
||||||
|
var js string
|
||||||
|
|
||||||
|
//go:embed frontend/public/build/bundle.css
|
||||||
|
var css string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
js := mewn.String("./frontend/public/build/bundle.js")
|
|
||||||
css := mewn.String("./frontend/public/build/bundle.css")
|
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"author": "Tim Kipp <timkipp.22.developer@gmail.com>",
|
"author": "Tim Kipp <timkipp.22.developer@gmail.com>",
|
||||||
"created": "2020-09-06 13:06:10.469848 -0700 PDT m=+213.578828559",
|
"created": "2020-09-06 13:06:10.469848 -0700 PDT m=+213.578828559",
|
||||||
"frontenddir": "frontend",
|
"frontenddir": "frontend",
|
||||||
"serve": "npm run dev",
|
"serve": "npm run serve",
|
||||||
"bridge": "src",
|
"bridge": "src",
|
||||||
"wailsdir": ""
|
"wailsdir": ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/build/main.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/build/main.js")
|
//go:embed frontend/build/main.css
|
||||||
css := mewn.String("./frontend/build/main.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,10 +9,13 @@ func basic() string {
|
|||||||
return "Hello World!"
|
return "Hello World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/dist/app.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/dist/app.js")
|
//go:embed frontend/dist/app.css
|
||||||
css := mewn.String("./frontend/dist/app.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
23
cmd/templates/vue3-js/frontend/.gitignore
vendored
Normal file
23
cmd/templates/vue3-js/frontend/.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
29
cmd/templates/vue3-js/frontend/README.md
Normal file
29
cmd/templates/vue3-js/frontend/README.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# vue-js
|
||||||
|
|
||||||
|
## Project setup
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and hot-reloads for development
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run serve
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and minifies for production
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lints and fixes files
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
### Customize configuration
|
||||||
|
|
||||||
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||||
5
cmd/templates/vue3-js/frontend/babel.config.js
Normal file
5
cmd/templates/vue3-js/frontend/babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
]
|
||||||
|
}
|
||||||
12312
cmd/templates/vue3-js/frontend/package-lock.json
generated
Normal file
12312
cmd/templates/vue3-js/frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
cmd/templates/vue3-js/frontend/package.json.template
Normal file
49
cmd/templates/vue3-js/frontend/package.json.template
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "{{.NPMProjectName}}",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@wailsapp/runtime": "^1.1.1",
|
||||||
|
"core-js": "^3.6.5",
|
||||||
|
"vue": "^3.0.0",
|
||||||
|
"vue-router": "^4.0.0-0",
|
||||||
|
"vuex": "^4.0.0-0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vue/cli-plugin-babel": "~4.5.0",
|
||||||
|
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||||
|
"@vue/cli-plugin-router": "~4.5.0",
|
||||||
|
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||||
|
"@vue/cli-service": "~4.5.0",
|
||||||
|
"@vue/compiler-sfc": "^3.0.0",
|
||||||
|
"babel-eslint": "^10.1.0",
|
||||||
|
"eslint": "^6.7.2",
|
||||||
|
"eslint-plugin-vue": "^7.0.0",
|
||||||
|
"stylus": "^0.54.7",
|
||||||
|
"stylus-loader": "^3.0.2"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/vue3-essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "babel-eslint"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
cmd/templates/vue3-js/frontend/public/favicon.ico
Normal file
BIN
cmd/templates/vue3-js/frontend/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
18
cmd/templates/vue3-js/frontend/public/index.html
Normal file
18
cmd/templates/vue3-js/frontend/public/index.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta content="IE=edge" http-equiv="X-UA-Compatible">
|
||||||
|
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||||
|
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
|
||||||
|
Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
30
cmd/templates/vue3-js/frontend/src/App.vue
Normal file
30
cmd/templates/vue3-js/frontend/src/App.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<div id="nav">
|
||||||
|
<router-link to="/">Home</router-link> |
|
||||||
|
<router-link to="/about">About</router-link>
|
||||||
|
</div>
|
||||||
|
<router-view />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="stylus">
|
||||||
|
#app {
|
||||||
|
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
text-align: center;
|
||||||
|
color: #2c3e50;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nav {
|
||||||
|
padding: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nav a {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2c3e50;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nav a.router-link-exact-active {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
cmd/templates/vue3-js/frontend/src/assets/appicon.png
Normal file
BIN
cmd/templates/vue3-js/frontend/src/assets/appicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 106 KiB |
BIN
cmd/templates/vue3-js/frontend/src/assets/logo.png
Normal file
BIN
cmd/templates/vue3-js/frontend/src/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
32
cmd/templates/vue3-js/frontend/src/components/HelloWorld.vue
Normal file
32
cmd/templates/vue3-js/frontend/src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<div class="hello">
|
||||||
|
<h1>{{ msg }}</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "HelloWorld",
|
||||||
|
props: {
|
||||||
|
msg: String,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped>
|
||||||
|
h3 {
|
||||||
|
margin: 40px 0 0;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
14
cmd/templates/vue3-js/frontend/src/main.js
Normal file
14
cmd/templates/vue3-js/frontend/src/main.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import {createApp} from 'vue'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router'
|
||||||
|
import store from './store'
|
||||||
|
|
||||||
|
// import wails runtime
|
||||||
|
import * as Wails from '@wailsapp/runtime';
|
||||||
|
|
||||||
|
Wails.Init(() => {
|
||||||
|
createApp(App)
|
||||||
|
.use(store)
|
||||||
|
.use(router)
|
||||||
|
.mount('#app')
|
||||||
|
})
|
||||||
25
cmd/templates/vue3-js/frontend/src/router/index.js
Normal file
25
cmd/templates/vue3-js/frontend/src/router/index.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import {createMemoryHistory, createRouter} from 'vue-router'
|
||||||
|
import Home from '../views/Home.vue'
|
||||||
|
import About from '../views/About.vue'
|
||||||
|
|
||||||
|
|
||||||
|
const routes = [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
name: 'Home',
|
||||||
|
component: Home
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/about',
|
||||||
|
name: 'About',
|
||||||
|
// You can only use pre-loading to add routes, not the on-demand loading method.
|
||||||
|
component: About
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const router = createRouter({
|
||||||
|
history: createMemoryHistory(),
|
||||||
|
routes
|
||||||
|
})
|
||||||
|
|
||||||
|
export default router
|
||||||
8
cmd/templates/vue3-js/frontend/src/store/index.js
Normal file
8
cmd/templates/vue3-js/frontend/src/store/index.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import {createStore} from 'vuex'
|
||||||
|
|
||||||
|
export default createStore({
|
||||||
|
state: {},
|
||||||
|
mutations: {},
|
||||||
|
actions: {},
|
||||||
|
modules: {}
|
||||||
|
})
|
||||||
5
cmd/templates/vue3-js/frontend/src/views/About.vue
Normal file
5
cmd/templates/vue3-js/frontend/src/views/About.vue
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div class="about">
|
||||||
|
<h1>This is an about page</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
42
cmd/templates/vue3-js/frontend/src/views/Home.vue
Normal file
42
cmd/templates/vue3-js/frontend/src/views/Home.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<div class="home">
|
||||||
|
<img
|
||||||
|
@click="getMessage"
|
||||||
|
alt="Vue logo"
|
||||||
|
src="../assets/appicon.png"
|
||||||
|
:style="{ height: '400px' }"
|
||||||
|
/>
|
||||||
|
<HelloWorld :msg="message" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from "vue";
|
||||||
|
import HelloWorld from "@/components/HelloWorld.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Home",
|
||||||
|
components: {
|
||||||
|
HelloWorld,
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const message = ref("Click the Icon");
|
||||||
|
|
||||||
|
const getMessage = () => {
|
||||||
|
window.backend
|
||||||
|
.basic()
|
||||||
|
.then((res) => {
|
||||||
|
message.value = res;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
message: message,
|
||||||
|
getMessage: getMessage,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
42
cmd/templates/vue3-js/frontend/vue.config.js
Normal file
42
cmd/templates/vue3-js/frontend/vue.config.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
let cssConfig = {};
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV == 'production') {
|
||||||
|
cssConfig = {
|
||||||
|
extract: {
|
||||||
|
filename: '[name].css',
|
||||||
|
chunkFilename: '[name].css'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
chainWebpack: config => {
|
||||||
|
let limit = 9999999999999999;
|
||||||
|
config.module
|
||||||
|
.rule('images')
|
||||||
|
.test(/\.(png|gif|jpg)(\?.*)?$/i)
|
||||||
|
.use('url-loader')
|
||||||
|
.loader('url-loader')
|
||||||
|
.tap(options => Object.assign(options, {limit: limit}));
|
||||||
|
config.module
|
||||||
|
.rule('fonts')
|
||||||
|
.test(/\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/i)
|
||||||
|
.use('url-loader')
|
||||||
|
.loader('url-loader')
|
||||||
|
.options({
|
||||||
|
limit: limit
|
||||||
|
});
|
||||||
|
},
|
||||||
|
css: cssConfig,
|
||||||
|
configureWebpack: {
|
||||||
|
output: {
|
||||||
|
filename: '[name].js'
|
||||||
|
},
|
||||||
|
optimization: {
|
||||||
|
splitChunks: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
devServer: {
|
||||||
|
disableHostCheck: true
|
||||||
|
}
|
||||||
|
};
|
||||||
5
cmd/templates/vue3-js/go.mod.template
Normal file
5
cmd/templates/vue3-js/go.mod.template
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module {{.BinaryName}}
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/wailsapp/wails {{.WailsVersion}}
|
||||||
|
)
|
||||||
30
cmd/templates/vue3-js/main.go.template
Normal file
30
cmd/templates/vue3-js/main.go.template
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "embed"
|
||||||
|
"github.com/wailsapp/wails"
|
||||||
|
)
|
||||||
|
|
||||||
|
func basic() string {
|
||||||
|
return "Hello World!"
|
||||||
|
}
|
||||||
|
|
||||||
|
//go:embed frontend/dist/app.js
|
||||||
|
var js string
|
||||||
|
|
||||||
|
//go:embed frontend/dist/app.css
|
||||||
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
|
Width: 1024,
|
||||||
|
Height: 768,
|
||||||
|
Title: "{{.Name}}",
|
||||||
|
JS: js,
|
||||||
|
CSS: css,
|
||||||
|
Colour: "#131313",
|
||||||
|
})
|
||||||
|
app.Bind(basic)
|
||||||
|
app.Run()
|
||||||
|
}
|
||||||
18
cmd/templates/vue3-js/template.json
Normal file
18
cmd/templates/vue3-js/template.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "Vue3 JS",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"shortdescription": "A template based on Vue 3, Vue-router, Vuex, and Webpack5",
|
||||||
|
"description": "A template based on Vue 3, Vue-router, Vuex, and Webpack5",
|
||||||
|
"install": "npm install",
|
||||||
|
"build": "npm run build",
|
||||||
|
"author": "Misitebao <i@misitebao.com>",
|
||||||
|
"created": "2021-05-02 17:25:55",
|
||||||
|
"frontenddir": "frontend",
|
||||||
|
"serve": "npm run serve",
|
||||||
|
"bridge": "src",
|
||||||
|
"wailsdir": "",
|
||||||
|
"platforms": [
|
||||||
|
"linux",
|
||||||
|
"darwin"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,10 +9,13 @@ func basic() string {
|
|||||||
return "Hello World!"
|
return "Hello World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/dist/app.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/dist/app.js")
|
//go:embed frontend/dist/app.css
|
||||||
css := mewn.String("./frontend/dist/app.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,10 +9,13 @@ func basic() string {
|
|||||||
return "Hello World!"
|
return "Hello World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/dist/app.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/dist/app.js")
|
//go:embed frontend/dist/app.css
|
||||||
css := mewn.String("./frontend/dist/app.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/leaanthony/mewn"
|
_ "embed"
|
||||||
"github.com/wailsapp/wails"
|
"github.com/wailsapp/wails"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -9,10 +9,13 @@ func basic() string {
|
|||||||
return "Hello World!"
|
return "Hello World!"
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
//go:embed frontend/dist/app.js
|
||||||
|
var js string
|
||||||
|
|
||||||
js := mewn.String("./frontend/dist/app.js")
|
//go:embed frontend/dist/app.css
|
||||||
css := mewn.String("./frontend/dist/app.css")
|
var css string
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
app := wails.CreateApp(&wails.AppConfig{
|
app := wails.CreateApp(&wails.AppConfig{
|
||||||
Width: 1024,
|
Width: 1024,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
const Version = "v1.11.0"
|
const Version = "v1.16.7"
|
||||||
|
|||||||
@@ -39,12 +39,6 @@ Create your first project by running 'wails init'.`
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check Mewn
|
|
||||||
err = cmd.CheckMewn(false)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
// CheckDependencies() returns !errors
|
// CheckDependencies() returns !errors
|
||||||
// so to get the right message in this
|
// so to get the right message in this
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build dev
|
||||||
// +build dev
|
// +build dev
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build dev
|
||||||
// +build dev
|
// +build dev
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ func init() {
|
|||||||
projectOptions := projectHelper.NewProjectOptions()
|
projectOptions := projectHelper.NewProjectOptions()
|
||||||
commandDescription := `Generates a new Wails project using the given flags.
|
commandDescription := `Generates a new Wails project using the given flags.
|
||||||
Any flags that are required and not given will be prompted for.`
|
Any flags that are required and not given will be prompted for.`
|
||||||
|
build := false
|
||||||
|
|
||||||
initCommand := app.Command("init", "Initialises a new Wails project").
|
initCommand := app.Command("init", "Initialises a new Wails project").
|
||||||
LongDescription(commandDescription).
|
LongDescription(commandDescription).
|
||||||
@@ -23,7 +24,8 @@ Any flags that are required and not given will be prompted for.`
|
|||||||
StringFlag("template", "Template name", &projectOptions.Template).
|
StringFlag("template", "Template name", &projectOptions.Template).
|
||||||
StringFlag("name", "Project name", &projectOptions.Name).
|
StringFlag("name", "Project name", &projectOptions.Name).
|
||||||
StringFlag("description", "Project description", &projectOptions.Description).
|
StringFlag("description", "Project description", &projectOptions.Description).
|
||||||
StringFlag("output", "Output binary name", &projectOptions.BinaryName)
|
StringFlag("output", "Output binary name", &projectOptions.BinaryName).
|
||||||
|
BoolFlag("build", "Build project after generating", &build)
|
||||||
|
|
||||||
initCommand.Action(func() error {
|
initCommand.Action(func() error {
|
||||||
|
|
||||||
@@ -64,6 +66,10 @@ Any flags that are required and not given will be prompted for.`
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
genSpinner.Success()
|
genSpinner.Success()
|
||||||
|
if !build {
|
||||||
|
logger.Yellow("Project '%s' initialised. Run `wails build` to build it.", projectOptions.Name)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Build the project
|
// Build the project
|
||||||
cwd, _ := os.Getwd()
|
cwd, _ := os.Getwd()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -52,7 +53,10 @@ func init() {
|
|||||||
|
|
||||||
var b strings.Builder
|
var b strings.Builder
|
||||||
for _, plat := range getSupportedPlatforms() {
|
for _, plat := range getSupportedPlatforms() {
|
||||||
fmt.Fprintf(&b, " - %s\n", plat)
|
_, err := fmt.Fprintf(&b, " - %s\n", plat)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
initCmd.StringFlag("x",
|
initCmd.StringFlag("x",
|
||||||
fmt.Sprintf("Cross-compile application to specified platform via xgo\n%s", b.String()),
|
fmt.Sprintf("Cross-compile application to specified platform via xgo\n%s", b.String()),
|
||||||
@@ -80,7 +84,7 @@ func init() {
|
|||||||
fs := cmd.NewFSHelper()
|
fs := cmd.NewFSHelper()
|
||||||
err := projectOptions.LoadConfig(fs.Cwd())
|
err := projectOptions.LoadConfig(fs.Cwd())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Unable to find 'project.json'. Please check you are in a Wails project directory")
|
return fmt.Errorf("unable to find 'project.json'. Please check you are in a Wails project directory")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set firebug flag
|
// Set firebug flag
|
||||||
@@ -143,12 +147,6 @@ func init() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that runtime init.js is the production version
|
|
||||||
err = cmd.InstallProdRuntime(projectDir, projectOptions)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move to project directory
|
// Move to project directory
|
||||||
|
|||||||
@@ -27,19 +27,13 @@ func init() {
|
|||||||
logger.PrintSmallBanner(message)
|
logger.PrintSmallBanner(message)
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
||||||
// Check Mewn is installed
|
|
||||||
err := cmd.CheckMewn(verbose)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Project options
|
// Project options
|
||||||
projectOptions := &cmd.ProjectOptions{}
|
projectOptions := &cmd.ProjectOptions{}
|
||||||
|
|
||||||
// Check we are in project directory
|
// Check we are in project directory
|
||||||
// Check project.json loads correctly
|
// Check project.json loads correctly
|
||||||
fs := cmd.NewFSHelper()
|
fs := cmd.NewFSHelper()
|
||||||
err = projectOptions.LoadConfig(fs.Cwd())
|
err := projectOptions.LoadConfig(fs.Cwd())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//go:build windows
|
||||||
// +build windows
|
// +build windows
|
||||||
|
|
||||||
package cmd
|
package cmd
|
||||||
|
|||||||
55
config.go
55
config.go
@@ -31,6 +31,18 @@ type AppConfig struct {
|
|||||||
// Indicates whether your app should be resizable
|
// Indicates whether your app should be resizable
|
||||||
Resizable bool
|
Resizable bool
|
||||||
|
|
||||||
|
// Minimum width of a resizable window. If set, MinHeight should also be set.
|
||||||
|
MinWidth int
|
||||||
|
|
||||||
|
// Minimum height of a resizable window. If set, MinWidth should also be set.
|
||||||
|
MinHeight int
|
||||||
|
|
||||||
|
// Maximum width of a resizable window. If set, MaxHeight should also be set.
|
||||||
|
MaxWidth int
|
||||||
|
|
||||||
|
// Maximum height of a resizable window. If set, MaxWidth should also be set.
|
||||||
|
MaxHeight int
|
||||||
|
|
||||||
// Indicated if the devtools should be disabled
|
// Indicated if the devtools should be disabled
|
||||||
DisableInspector bool
|
DisableInspector bool
|
||||||
}
|
}
|
||||||
@@ -65,6 +77,26 @@ func (a *AppConfig) GetResizable() bool {
|
|||||||
return a.Resizable
|
return a.Resizable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMinWidth returns the minimum width of the window
|
||||||
|
func (a *AppConfig) GetMinWidth() int {
|
||||||
|
return a.MinWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMinHeight returns the minimum height of the window
|
||||||
|
func (a *AppConfig) GetMinHeight() int {
|
||||||
|
return a.MinHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMaxWidth returns the maximum width of the window
|
||||||
|
func (a *AppConfig) GetMaxWidth() int {
|
||||||
|
return a.MaxWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetMaxHeight returns the maximum height of the window
|
||||||
|
func (a *AppConfig) GetMaxHeight() int {
|
||||||
|
return a.MaxHeight
|
||||||
|
}
|
||||||
|
|
||||||
// GetDisableInspector returns true if the inspector should be disabled
|
// GetDisableInspector returns true if the inspector should be disabled
|
||||||
func (a *AppConfig) GetDisableInspector() bool {
|
func (a *AppConfig) GetDisableInspector() bool {
|
||||||
return a.DisableInspector
|
return a.DisableInspector
|
||||||
@@ -115,6 +147,23 @@ func (a *AppConfig) merge(in *AppConfig) error {
|
|||||||
if in.Height != 0 {
|
if in.Height != 0 {
|
||||||
a.Height = in.Height
|
a.Height = in.Height
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if in.MinWidth != 0 {
|
||||||
|
a.MinWidth = in.MinWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
if in.MinHeight != 0 {
|
||||||
|
a.MinHeight = in.MinHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
if in.MaxWidth != 0 {
|
||||||
|
a.MaxWidth = in.MaxWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
if in.MaxHeight != 0 {
|
||||||
|
a.MaxHeight = in.MaxHeight
|
||||||
|
}
|
||||||
|
|
||||||
a.Resizable = in.Resizable
|
a.Resizable = in.Resizable
|
||||||
a.DisableInspector = in.DisableInspector
|
a.DisableInspector = in.DisableInspector
|
||||||
|
|
||||||
@@ -127,8 +176,12 @@ func newConfig(userConfig *AppConfig) (*AppConfig, error) {
|
|||||||
Width: 800,
|
Width: 800,
|
||||||
Height: 600,
|
Height: 600,
|
||||||
Resizable: true,
|
Resizable: true,
|
||||||
|
MinWidth: -1,
|
||||||
|
MinHeight: -1,
|
||||||
|
MaxWidth: -1,
|
||||||
|
MaxHeight: -1,
|
||||||
Title: "My Wails App",
|
Title: "My Wails App",
|
||||||
Colour: "#FFF", // White by default
|
Colour: "",
|
||||||
HTML: defaultHTML,
|
HTML: defaultHTML,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
go.mod
10
go.mod
@@ -5,11 +5,10 @@ require (
|
|||||||
github.com/abadojack/whatlanggo v1.0.1
|
github.com/abadojack/whatlanggo v1.0.1
|
||||||
github.com/fatih/color v1.7.0
|
github.com/fatih/color v1.7.0
|
||||||
github.com/go-playground/colors v1.2.0
|
github.com/go-playground/colors v1.2.0
|
||||||
github.com/gorilla/websocket v1.4.0
|
github.com/gorilla/websocket v1.4.1
|
||||||
github.com/jackmordaunt/icns v1.0.0
|
github.com/jackmordaunt/icns v1.0.0
|
||||||
github.com/kennygrant/sanitize v1.2.4
|
github.com/kennygrant/sanitize v1.2.4
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
||||||
github.com/leaanthony/mewn v0.10.7
|
|
||||||
github.com/leaanthony/slicer v1.4.0
|
github.com/leaanthony/slicer v1.4.0
|
||||||
github.com/leaanthony/spinner v0.5.3
|
github.com/leaanthony/spinner v0.5.3
|
||||||
github.com/mattn/go-colorable v0.1.1 // indirect
|
github.com/mattn/go-colorable v0.1.1 // indirect
|
||||||
@@ -17,15 +16,16 @@ require (
|
|||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
|
||||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
|
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
|
||||||
github.com/pkg/errors v0.8.1 // indirect
|
github.com/pkg/errors v0.8.1 // indirect
|
||||||
github.com/sirupsen/logrus v1.4.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
|
github.com/stretchr/objx v0.1.1 // indirect
|
||||||
github.com/stretchr/testify v1.3.0 // indirect
|
github.com/stretchr/testify v1.3.0 // indirect
|
||||||
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba
|
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba
|
||||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8
|
golang.org/x/image v0.0.0-20200430140353-33d19683fad8
|
||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
|
||||||
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359
|
||||||
golang.org/x/text v0.3.0
|
golang.org/x/text v0.3.0
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
||||||
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
|
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
|
||||||
)
|
)
|
||||||
|
|
||||||
go 1.13
|
go 1.16
|
||||||
|
|||||||
13
go.sum
13
go.sum
@@ -11,8 +11,8 @@ github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
|||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
github.com/go-playground/colors v1.2.0 h1:0EdjTXKrr2g1L/LQTYtIqabeHpZuGZz1U4osS1T8+5M=
|
github.com/go-playground/colors v1.2.0 h1:0EdjTXKrr2g1L/LQTYtIqabeHpZuGZz1U4osS1T8+5M=
|
||||||
github.com/go-playground/colors v1.2.0/go.mod h1:miw1R2JIE19cclPxsXqNdzLZsk4DP4iF+m88bRc7kfM=
|
github.com/go-playground/colors v1.2.0/go.mod h1:miw1R2JIE19cclPxsXqNdzLZsk4DP4iF+m88bRc7kfM=
|
||||||
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
|
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
|
||||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ=
|
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ=
|
||||||
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
|
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
|
||||||
github.com/jackmordaunt/icns v1.0.0 h1:RYSxplerf/l/DUd09AHtITwckkv/mqjVv4DjYdPmAMQ=
|
github.com/jackmordaunt/icns v1.0.0 h1:RYSxplerf/l/DUd09AHtITwckkv/mqjVv4DjYdPmAMQ=
|
||||||
@@ -26,8 +26,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3
|
|||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
|
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/leaanthony/mewn v0.10.7 h1:jCcNJyIUOpwj+I5SuATvCugDjHkoo+j6ubEOxxrxmPA=
|
|
||||||
github.com/leaanthony/mewn v0.10.7/go.mod h1:CRkTx8unLiSSilu/Sd7i1LwrdaAL+3eQ3ses99qGMEQ=
|
|
||||||
github.com/leaanthony/slicer v1.4.0 h1:Q9u4w+UBU4WHjXnEDdz+eRLMKF/rnyosRBiqULnc1J8=
|
github.com/leaanthony/slicer v1.4.0 h1:Q9u4w+UBU4WHjXnEDdz+eRLMKF/rnyosRBiqULnc1J8=
|
||||||
github.com/leaanthony/slicer v1.4.0/go.mod h1:FwrApmf8gOrpzEWM2J/9Lh79tyq8KTX5AzRtwV7m4AY=
|
github.com/leaanthony/slicer v1.4.0/go.mod h1:FwrApmf8gOrpzEWM2J/9Lh79tyq8KTX5AzRtwV7m4AY=
|
||||||
github.com/leaanthony/spinner v0.5.3 h1:IMTvgdQCec5QA4qRy0wil4XsRP+QcG1OwLWVK/LPZ5Y=
|
github.com/leaanthony/spinner v0.5.3 h1:IMTvgdQCec5QA4qRy0wil4XsRP+QcG1OwLWVK/LPZ5Y=
|
||||||
@@ -56,6 +54,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
|||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
|
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
|
||||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||||
|
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||||
|
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
@@ -66,7 +66,6 @@ github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba h1:2DHfQOxcpWdGf5
|
|||||||
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba/go.mod h1:iLnlXG2Pakcii2CU0cbY07DRCSvpWNa7nFxtevhOChk=
|
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba/go.mod h1:iLnlXG2Pakcii2CU0cbY07DRCSvpWNa7nFxtevhOChk=
|
||||||
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
|
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
|
golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
|
||||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
@@ -79,10 +78,12 @@ golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5h
|
|||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
|
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c=
|
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c h1:UIcGWL6/wpCfyGuJnRFJRurA+yj8RrW7Q6x2YMCXt6c=
|
||||||
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200724161237-0e2f3a69832c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 h1:2B5p2L5IfGiD7+b9BOoRMC6DgObAVZV+Fsp050NqXik=
|
||||||
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/lib/logger"
|
"github.com/wailsapp/wails/lib/logger"
|
||||||
)
|
)
|
||||||
@@ -27,6 +28,10 @@ func newBoundFunction(object interface{}) (*boundFunction, error) {
|
|||||||
objectType := reflect.TypeOf(object)
|
objectType := reflect.TypeOf(object)
|
||||||
|
|
||||||
name := runtime.FuncForPC(objectValue.Pointer()).Name()
|
name := runtime.FuncForPC(objectValue.Pointer()).Name()
|
||||||
|
if strings.Contains(name, "/") {
|
||||||
|
parts := strings.Split(name, "/")
|
||||||
|
name = parts[len(parts)-1]
|
||||||
|
}
|
||||||
|
|
||||||
result := &boundFunction{
|
result := &boundFunction{
|
||||||
fullName: name,
|
fullName: name,
|
||||||
|
|||||||
@@ -115,15 +115,15 @@ func (b *Manager) generateTypescriptDefinitions() error {
|
|||||||
|
|
||||||
for structname, methodList := range b.structList {
|
for structname, methodList := range b.structList {
|
||||||
structname = strings.SplitN(structname, ".", 2)[1]
|
structname = strings.SplitN(structname, ".", 2)[1]
|
||||||
output.WriteString(fmt.Sprintf("Interface %s {\n", structname))
|
output.WriteString(fmt.Sprintf("interface %s {\n", structname))
|
||||||
for _, method := range methodList {
|
for _, method := range methodList {
|
||||||
output.WriteString(fmt.Sprintf("\t%s: (...args : any[]) => Promise\n", method))
|
output.WriteString(fmt.Sprintf("\t%s(...args : any[]):Promise<any>\n", method))
|
||||||
}
|
}
|
||||||
output.WriteString("}\n")
|
output.WriteString("}\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
output.WriteString("\n")
|
output.WriteString("\n")
|
||||||
output.WriteString("Interface Backend {\n")
|
output.WriteString("interface Backend {\n")
|
||||||
|
|
||||||
for structname := range b.structList {
|
for structname := range b.structList {
|
||||||
structname = strings.SplitN(structname, ".", 2)[1]
|
structname = strings.SplitN(structname, ".", 2)[1]
|
||||||
@@ -136,7 +136,8 @@ declare global {
|
|||||||
interface Window {
|
interface Window {
|
||||||
backend: Backend;
|
backend: Backend;
|
||||||
}
|
}
|
||||||
}`
|
}
|
||||||
|
export {};`
|
||||||
output.WriteString(globals)
|
output.WriteString(globals)
|
||||||
|
|
||||||
b.log.Info("Written Typescript file: " + typescriptDefinitionFilename)
|
b.log.Info("Written Typescript file: " + typescriptDefinitionFilename)
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ type Manager struct {
|
|||||||
log *logger.CustomLogger
|
log *logger.CustomLogger
|
||||||
renderer interfaces.Renderer // Messages will be dispatched to the frontend
|
renderer interfaces.Renderer // Messages will be dispatched to the frontend
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
|
mu sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewManager creates a new event manager with a 100 event buffer
|
// NewManager creates a new event manager with a 100 event buffer
|
||||||
@@ -42,12 +43,12 @@ func (e *Manager) PushEvent(eventData *messages.EventData) {
|
|||||||
// means it does not expire (default).
|
// means it does not expire (default).
|
||||||
type eventListener struct {
|
type eventListener struct {
|
||||||
callback func(...interface{}) // Function to call with emitted event data
|
callback func(...interface{}) // Function to call with emitted event data
|
||||||
counter int // Expire after counter callbacks. 0 = infinite
|
counter uint // Expire after counter callbacks. 0 = infinite
|
||||||
expired bool // Indicates if the listener has expired
|
expired bool // Indicates if the listener has expired
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creates a new event listener from the given callback function
|
// Creates a new event listener from the given callback function
|
||||||
func (e *Manager) addEventListener(eventName string, callback func(...interface{}), counter int) error {
|
func (e *Manager) addEventListener(eventName string, callback func(...interface{}), counter uint) error {
|
||||||
|
|
||||||
// Sanity check inputs
|
// Sanity check inputs
|
||||||
if callback == nil {
|
if callback == nil {
|
||||||
@@ -75,7 +76,30 @@ func (e *Manager) addEventListener(eventName string, callback func(...interface{
|
|||||||
// On adds a listener for the given event
|
// On adds a listener for the given event
|
||||||
func (e *Manager) On(eventName string, callback func(...interface{})) {
|
func (e *Manager) On(eventName string, callback func(...interface{})) {
|
||||||
// Add a persistent eventListener (counter = 0)
|
// Add a persistent eventListener (counter = 0)
|
||||||
e.addEventListener(eventName, callback, 0)
|
err := e.addEventListener(eventName, callback, 0)
|
||||||
|
if err != nil {
|
||||||
|
e.log.Error(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Once adds a listener for the given event that will auto remove
|
||||||
|
// after one callback
|
||||||
|
func (e *Manager) Once(eventName string, callback func(...interface{})) {
|
||||||
|
// Add a persistent eventListener (counter = 0)
|
||||||
|
err := e.addEventListener(eventName, callback, 1)
|
||||||
|
if err != nil {
|
||||||
|
e.log.Error(err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnMultiple adds a listener for the given event that will trigger
|
||||||
|
// at most <counter> times.
|
||||||
|
func (e *Manager) OnMultiple(eventName string, callback func(...interface{}), counter uint) {
|
||||||
|
// Add a persistent eventListener (counter = 0)
|
||||||
|
err := e.addEventListener(eventName, callback, counter)
|
||||||
|
if err != nil {
|
||||||
|
e.log.Error(err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit broadcasts the given event to the subscribed listeners
|
// Emit broadcasts the given event to the subscribed listeners
|
||||||
@@ -108,20 +132,24 @@ func (e *Manager) Start(renderer interfaces.Renderer) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Notify renderer
|
// Notify renderer
|
||||||
e.renderer.NotifyEvent(event)
|
err := e.renderer.NotifyEvent(event)
|
||||||
|
if err != nil {
|
||||||
|
e.log.Error(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
// Notify Go listeners
|
e.mu.Lock()
|
||||||
var listenersToRemove []*eventListener
|
|
||||||
|
|
||||||
// Iterate listeners
|
// Iterate listeners
|
||||||
for _, listener := range e.listeners[event.Name] {
|
for _, listener := range e.listeners[event.Name] {
|
||||||
|
|
||||||
// Call listener, perhaps with data
|
if !listener.expired {
|
||||||
if event.Data == nil {
|
// Call listener, perhaps with data
|
||||||
go listener.callback()
|
if event.Data == nil {
|
||||||
} else {
|
go listener.callback()
|
||||||
unpacked := event.Data.([]interface{})
|
} else {
|
||||||
go listener.callback(unpacked...)
|
unpacked := event.Data.([]interface{})
|
||||||
|
go listener.callback(unpacked...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update listen counter
|
// Update listen counter
|
||||||
@@ -133,15 +161,8 @@ func (e *Manager) Start(renderer interfaces.Renderer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove expired listeners in place
|
e.mu.Unlock()
|
||||||
if len(listenersToRemove) > 0 {
|
|
||||||
listeners := e.listeners[event.Name][:0]
|
|
||||||
for _, listener := range listeners {
|
|
||||||
if !listener.expired {
|
|
||||||
listeners = append(listeners, listener)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case <-e.quitChannel:
|
case <-e.quitChannel:
|
||||||
e.running = false
|
e.running = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ type AppConfig interface {
|
|||||||
GetWidth() int
|
GetWidth() int
|
||||||
GetHeight() int
|
GetHeight() int
|
||||||
GetTitle() string
|
GetTitle() string
|
||||||
|
GetMinWidth() int
|
||||||
|
GetMinHeight() int
|
||||||
|
GetMaxWidth() int
|
||||||
|
GetMaxHeight() int
|
||||||
GetResizable() bool
|
GetResizable() bool
|
||||||
GetHTML() string
|
GetHTML() string
|
||||||
GetDisableInspector() bool
|
GetDisableInspector() bool
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import "github.com/wailsapp/wails/lib/messages"
|
|||||||
type EventManager interface {
|
type EventManager interface {
|
||||||
PushEvent(*messages.EventData)
|
PushEvent(*messages.EventData)
|
||||||
Emit(eventName string, optionalData ...interface{})
|
Emit(eventName string, optionalData ...interface{})
|
||||||
|
OnMultiple(eventName string, callback func(...interface{}), counter uint)
|
||||||
|
Once(eventName string, callback func(...interface{}))
|
||||||
On(eventName string, callback func(...interface{}))
|
On(eventName string, callback func(...interface{}))
|
||||||
Start(Renderer)
|
Start(Renderer)
|
||||||
Shutdown()
|
Shutdown()
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ type Renderer interface {
|
|||||||
|
|
||||||
// Window Runtime
|
// Window Runtime
|
||||||
SetColour(string) error
|
SetColour(string) error
|
||||||
|
|
||||||
|
SetMinSize(width, height int)
|
||||||
|
SetMaxSize(width, height int)
|
||||||
|
|
||||||
Fullscreen()
|
Fullscreen()
|
||||||
UnFullscreen()
|
UnFullscreen()
|
||||||
SetTitle(title string)
|
SetTitle(title string)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package interfaces
|
package interfaces
|
||||||
|
|
||||||
// Runtime interface
|
// Runtime interface
|
||||||
type Runtime interface {}
|
type Runtime interface{}
|
||||||
|
|||||||
@@ -186,6 +186,18 @@ func (h *Bridge) SetColour(colour string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetMinSize is unsupported for Bridge but required
|
||||||
|
// for the Renderer interface
|
||||||
|
func (h *Bridge) SetMinSize(width, height int) {
|
||||||
|
h.log.Warn("SetMinSize() unsupported in bridge mode")
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetMaxSize is unsupported for Bridge but required
|
||||||
|
// for the Renderer interface
|
||||||
|
func (h *Bridge) SetMaxSize(width, height int) {
|
||||||
|
h.log.Warn("SetMaxSize() unsupported in bridge mode")
|
||||||
|
}
|
||||||
|
|
||||||
// Fullscreen is unsupported for Bridge but required
|
// Fullscreen is unsupported for Bridge but required
|
||||||
// for the Renderer interface
|
// for the Renderer interface
|
||||||
func (h *Bridge) Fullscreen() {
|
func (h *Bridge) Fullscreen() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -3,8 +3,9 @@ package renderer
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/runtime"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/leaanthony/mewn"
|
|
||||||
"github.com/wailsapp/wails/lib/interfaces"
|
"github.com/wailsapp/wails/lib/interfaces"
|
||||||
"github.com/wailsapp/wails/lib/logger"
|
"github.com/wailsapp/wails/lib/logger"
|
||||||
)
|
)
|
||||||
@@ -58,8 +59,7 @@ func (s *session) start(firstSession bool) {
|
|||||||
s.log.Infof("Connected to frontend.")
|
s.log.Infof("Connected to frontend.")
|
||||||
go s.writePump()
|
go s.writePump()
|
||||||
|
|
||||||
wailsRuntime := mewn.String("../../runtime/assets/wails.js")
|
s.evalJS(runtime.WailsJS, wailsRuntimeMessage)
|
||||||
s.evalJS(wailsRuntime, wailsRuntimeMessage)
|
|
||||||
|
|
||||||
// Inject bindings
|
// Inject bindings
|
||||||
for _, binding := range s.bindingCache {
|
for _, binding := range s.bindingCache {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -8,8 +8,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/runtime"
|
||||||
|
|
||||||
"github.com/go-playground/colors"
|
"github.com/go-playground/colors"
|
||||||
"github.com/leaanthony/mewn"
|
|
||||||
"github.com/wailsapp/wails/lib/interfaces"
|
"github.com/wailsapp/wails/lib/interfaces"
|
||||||
"github.com/wailsapp/wails/lib/logger"
|
"github.com/wailsapp/wails/lib/logger"
|
||||||
"github.com/wailsapp/wails/lib/messages"
|
"github.com/wailsapp/wails/lib/messages"
|
||||||
@@ -23,12 +24,13 @@ import (
|
|||||||
var UseFirebug = ""
|
var UseFirebug = ""
|
||||||
|
|
||||||
type WebView struct {
|
type WebView struct {
|
||||||
window wv.WebView // The webview object
|
window wv.WebView // The webview object
|
||||||
ipc interfaces.IPCManager
|
ipc interfaces.IPCManager
|
||||||
log *logger.CustomLogger
|
log *logger.CustomLogger
|
||||||
config interfaces.AppConfig
|
config interfaces.AppConfig
|
||||||
eventManager interfaces.EventManager
|
eventManager interfaces.EventManager
|
||||||
bindingCache []string
|
bindingCache []string
|
||||||
|
maximumSizeSet bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewWebView returns a new WebView struct
|
// NewWebView returns a new WebView struct
|
||||||
@@ -52,10 +54,37 @@ func (w *WebView) Initialise(config interfaces.AppConfig, ipc interfaces.IPCMana
|
|||||||
// Save the config
|
// Save the config
|
||||||
w.config = config
|
w.config = config
|
||||||
|
|
||||||
|
width := config.GetWidth()
|
||||||
|
height := config.GetHeight()
|
||||||
|
|
||||||
|
// Clamp width and height
|
||||||
|
minWidth, minHeight := config.GetMinWidth(), config.GetMinHeight()
|
||||||
|
maxWidth, maxHeight := config.GetMaxWidth(), config.GetMaxHeight()
|
||||||
|
setMinSize := minWidth != -1 && minHeight != -1
|
||||||
|
setMaxSize := maxWidth != -1 && maxHeight != -1
|
||||||
|
|
||||||
|
if setMinSize {
|
||||||
|
if width < minWidth {
|
||||||
|
width = minWidth
|
||||||
|
}
|
||||||
|
if height < minHeight {
|
||||||
|
height = minHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if setMaxSize {
|
||||||
|
if width > maxWidth {
|
||||||
|
width = maxWidth
|
||||||
|
}
|
||||||
|
if height > maxHeight {
|
||||||
|
height = maxHeight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create the WebView instance
|
// Create the WebView instance
|
||||||
w.window = wv.NewWebview(wv.Settings{
|
w.window = wv.NewWebview(wv.Settings{
|
||||||
Width: config.GetWidth(),
|
Width: width,
|
||||||
Height: config.GetHeight(),
|
Height: height,
|
||||||
Title: config.GetTitle(),
|
Title: config.GetTitle(),
|
||||||
Resizable: config.GetResizable(),
|
Resizable: config.GetResizable(),
|
||||||
URL: config.GetHTML(),
|
URL: config.GetHTML(),
|
||||||
@@ -65,12 +94,31 @@ func (w *WebView) Initialise(config interfaces.AppConfig, ipc interfaces.IPCMana
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Set minimum and maximum sizes
|
||||||
|
if setMinSize {
|
||||||
|
w.SetMinSize(minWidth, minHeight)
|
||||||
|
}
|
||||||
|
if setMaxSize {
|
||||||
|
w.SetMaxSize(maxWidth, maxHeight)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set minimum and maximum sizes
|
||||||
|
if setMinSize {
|
||||||
|
w.SetMinSize(minWidth, minHeight)
|
||||||
|
}
|
||||||
|
if setMaxSize {
|
||||||
|
w.SetMaxSize(maxWidth, maxHeight)
|
||||||
|
}
|
||||||
|
|
||||||
// SignalManager.OnExit(w.Exit)
|
// SignalManager.OnExit(w.Exit)
|
||||||
|
|
||||||
// Set colour
|
// Set colour
|
||||||
err := w.SetColour(config.GetColour())
|
color := config.GetColour()
|
||||||
if err != nil {
|
if color != "" {
|
||||||
return err
|
err := w.SetColour(color)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
w.log.Info("Initialised")
|
w.log.Info("Initialised")
|
||||||
@@ -183,8 +231,8 @@ func (w *WebView) Run() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Runtime assets
|
// Runtime assets
|
||||||
wailsRuntime := mewn.String("../../runtime/assets/wails.js")
|
w.log.DebugFields("Injecting wails JS runtime", logger.Fields{"js": runtime.WailsJS})
|
||||||
w.evalJS(wailsRuntime)
|
w.evalJS(runtime.WailsJS)
|
||||||
|
|
||||||
// Ping the wait channel when the wails runtime is loaded
|
// Ping the wait channel when the wails runtime is loaded
|
||||||
w.eventManager.On("wails:loaded", func(...interface{}) {
|
w.eventManager.On("wails:loaded", func(...interface{}) {
|
||||||
@@ -207,10 +255,9 @@ func (w *WebView) Run() error {
|
|||||||
w.injectCSS(w.config.GetCSS())
|
w.injectCSS(w.config.GetCSS())
|
||||||
} else {
|
} else {
|
||||||
// Use default wails css
|
// Use default wails css
|
||||||
w.log.Debug("Injecting Default Wails CSS")
|
|
||||||
defaultCSS := mewn.String("../../runtime/assets/wails.css")
|
|
||||||
|
|
||||||
w.injectCSS(defaultCSS)
|
w.log.Debug("Injecting Default Wails CSS: " + runtime.WailsCSS)
|
||||||
|
w.injectCSS(runtime.WailsCSS)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inject user JS
|
// Inject user JS
|
||||||
@@ -256,6 +303,9 @@ func (w *WebView) SelectFile(title string, filter string) string {
|
|||||||
wg.Done()
|
wg.Done()
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
defer w.focus() // Ensure the main window is put back into focus afterwards
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
@@ -274,6 +324,9 @@ func (w *WebView) SelectDirectory() string {
|
|||||||
wg.Done()
|
wg.Done()
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
defer w.focus() // Ensure the main window is put back into focus afterwards
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
@@ -292,10 +345,20 @@ func (w *WebView) SelectSaveFile(title string, filter string) string {
|
|||||||
wg.Done()
|
wg.Done()
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
defer w.focus() // Ensure the main window is put back into focus afterwards
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// focus puts the main window into focus
|
||||||
|
func (w *WebView) focus() {
|
||||||
|
w.window.Dispatch(func() {
|
||||||
|
w.window.Focus()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// callback sends a callback to the frontend
|
// callback sends a callback to the frontend
|
||||||
func (w *WebView) callback(data string) error {
|
func (w *WebView) callback(data string) error {
|
||||||
callbackCMD := fmt.Sprintf("window.wails._.Callback('%s');", data)
|
callbackCMD := fmt.Sprintf("window.wails._.Callback('%s');", data)
|
||||||
@@ -337,11 +400,37 @@ func (w *WebView) NotifyEvent(event *messages.EventData) error {
|
|||||||
return w.evalJS(message)
|
return w.evalJS(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetMinSize sets the minimum size of a resizable window
|
||||||
|
func (w *WebView) SetMinSize(width, height int) {
|
||||||
|
if w.config.GetResizable() == false {
|
||||||
|
w.log.Warn("Cannot call SetMinSize() - App.Resizable = false")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
w.window.Dispatch(func() {
|
||||||
|
w.window.SetMinSize(width, height)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetMaxSize sets the maximum size of a resizable window
|
||||||
|
func (w *WebView) SetMaxSize(width, height int) {
|
||||||
|
if w.config.GetResizable() == false {
|
||||||
|
w.log.Warn("Cannot call SetMaxSize() - App.Resizable = false")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
w.maximumSizeSet = true
|
||||||
|
w.window.Dispatch(func() {
|
||||||
|
w.window.SetMaxSize(width, height)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Fullscreen makes the main window go fullscreen
|
// Fullscreen makes the main window go fullscreen
|
||||||
func (w *WebView) Fullscreen() {
|
func (w *WebView) Fullscreen() {
|
||||||
if w.config.GetResizable() == false {
|
if w.config.GetResizable() == false {
|
||||||
w.log.Warn("Cannot call Fullscreen() - App.Resizable = false")
|
w.log.Warn("Cannot call Fullscreen() - App.Resizable = false")
|
||||||
return
|
return
|
||||||
|
} else if w.maximumSizeSet {
|
||||||
|
w.log.Warn("Cannot call Fullscreen() - Maximum size of window set")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
w.window.Dispatch(func() {
|
w.window.Dispatch(func() {
|
||||||
w.window.SetFullscreen(true)
|
w.window.SetFullscreen(true)
|
||||||
|
|||||||
@@ -65,6 +65,18 @@ static inline void CgoWebViewSetTitle(void *w, char *title) {
|
|||||||
webview_set_title((struct webview *)w, title);
|
webview_set_title((struct webview *)w, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void CgoWebViewFocus(void *w) {
|
||||||
|
webview_focus((struct webview *)w);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void CgoWebViewMinSize(void *w, int width, int height) {
|
||||||
|
webview_minsize((struct webview *)w, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void CgoWebViewMaxSize(void *w, int width, int height) {
|
||||||
|
webview_maxsize((struct webview *)w, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void CgoWebViewSetFullscreen(void *w, int fullscreen) {
|
static inline void CgoWebViewSetFullscreen(void *w, int fullscreen) {
|
||||||
webview_set_fullscreen((struct webview *)w, fullscreen);
|
webview_set_fullscreen((struct webview *)w, fullscreen);
|
||||||
}
|
}
|
||||||
@@ -170,6 +182,16 @@ type WebView interface {
|
|||||||
// SetTitle() changes window title. This method must be called from the main
|
// SetTitle() changes window title. This method must be called from the main
|
||||||
// thread only. See Dispatch() for more details.
|
// thread only. See Dispatch() for more details.
|
||||||
SetTitle(title string)
|
SetTitle(title string)
|
||||||
|
|
||||||
|
// Focus() puts the main window into focus
|
||||||
|
Focus()
|
||||||
|
|
||||||
|
// SetMinSize() sets the minimum size of the window
|
||||||
|
SetMinSize(width, height int)
|
||||||
|
|
||||||
|
// SetMaxSize() sets the maximum size of the window
|
||||||
|
SetMaxSize(width, height int)
|
||||||
|
|
||||||
// SetFullscreen() controls window full-screen mode. This method must be
|
// SetFullscreen() controls window full-screen mode. This method must be
|
||||||
// called from the main thread only. See Dispatch() for more details.
|
// called from the main thread only. See Dispatch() for more details.
|
||||||
SetFullscreen(fullscreen bool)
|
SetFullscreen(fullscreen bool)
|
||||||
@@ -307,6 +329,18 @@ func (w *webview) SetColor(r, g, b, a uint8) {
|
|||||||
C.CgoWebViewSetColor(w.w, C.uint8_t(r), C.uint8_t(g), C.uint8_t(b), C.uint8_t(a))
|
C.CgoWebViewSetColor(w.w, C.uint8_t(r), C.uint8_t(g), C.uint8_t(b), C.uint8_t(a))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *webview) Focus() {
|
||||||
|
C.CgoWebViewFocus(w.w)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *webview) SetMinSize(width, height int) {
|
||||||
|
C.CgoWebViewMinSize(w.w, C.int(width), C.int(height))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *webview) SetMaxSize(width, height int) {
|
||||||
|
C.CgoWebViewMaxSize(w.w, C.int(width), C.int(height))
|
||||||
|
}
|
||||||
|
|
||||||
func (w *webview) SetFullscreen(fullscreen bool) {
|
func (w *webview) SetFullscreen(fullscreen bool) {
|
||||||
C.CgoWebViewSetFullscreen(w.w, C.int(boolToInt(fullscreen)))
|
C.CgoWebViewSetFullscreen(w.w, C.int(boolToInt(fullscreen)))
|
||||||
}
|
}
|
||||||
@@ -353,7 +387,9 @@ func _webviewDispatchGoCallback(index unsafe.Pointer) {
|
|||||||
f = fns[uintptr(index)]
|
f = fns[uintptr(index)]
|
||||||
delete(fns, uintptr(index))
|
delete(fns, uintptr(index))
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
f()
|
if f != nil {
|
||||||
|
f()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//export _webviewExternalInvokeCallback
|
//export _webviewExternalInvokeCallback
|
||||||
@@ -369,5 +405,7 @@ func _webviewExternalInvokeCallback(w unsafe.Pointer, data unsafe.Pointer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Unlock()
|
m.Unlock()
|
||||||
cb(wv, C.GoString((*C.char)(data)))
|
if cb != nil {
|
||||||
|
cb(wv, C.GoString((*C.char)(data)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ extern "C"
|
|||||||
int ready;
|
int ready;
|
||||||
int js_busy;
|
int js_busy;
|
||||||
int should_exit;
|
int should_exit;
|
||||||
|
|
||||||
|
int min_width;
|
||||||
|
int min_height;
|
||||||
|
int max_width;
|
||||||
|
int max_height;
|
||||||
};
|
};
|
||||||
#elif defined(WEBVIEW_WINAPI)
|
#elif defined(WEBVIEW_WINAPI)
|
||||||
#define CINTERFACE
|
#define CINTERFACE
|
||||||
@@ -75,6 +80,11 @@ struct webview_priv
|
|||||||
DWORD saved_style;
|
DWORD saved_style;
|
||||||
DWORD saved_ex_style;
|
DWORD saved_ex_style;
|
||||||
RECT saved_rect;
|
RECT saved_rect;
|
||||||
|
|
||||||
|
int min_width;
|
||||||
|
int min_height;
|
||||||
|
int max_width;
|
||||||
|
int max_height;
|
||||||
};
|
};
|
||||||
#elif defined(WEBVIEW_COCOA)
|
#elif defined(WEBVIEW_COCOA)
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
@@ -168,6 +178,9 @@ struct webview_priv
|
|||||||
WEBVIEW_API int webview_eval(struct webview *w, const char *js);
|
WEBVIEW_API int webview_eval(struct webview *w, const char *js);
|
||||||
WEBVIEW_API int webview_inject_css(struct webview *w, const char *css);
|
WEBVIEW_API int webview_inject_css(struct webview *w, const char *css);
|
||||||
WEBVIEW_API void webview_set_title(struct webview *w, const char *title);
|
WEBVIEW_API void webview_set_title(struct webview *w, const char *title);
|
||||||
|
WEBVIEW_API void webview_focus(struct webview *w);
|
||||||
|
WEBVIEW_API void webview_minsize(struct webview *w, int width, int height);
|
||||||
|
WEBVIEW_API void webview_maxsize(struct webview *w, int width, int height);
|
||||||
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen);
|
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen);
|
||||||
WEBVIEW_API void webview_set_color(struct webview *w, uint8_t r, uint8_t g,
|
WEBVIEW_API void webview_set_color(struct webview *w, uint8_t r, uint8_t g,
|
||||||
uint8_t b, uint8_t a);
|
uint8_t b, uint8_t a);
|
||||||
@@ -329,6 +342,12 @@ struct webview_priv
|
|||||||
w->priv.should_exit = 0;
|
w->priv.should_exit = 0;
|
||||||
w->priv.queue = g_async_queue_new();
|
w->priv.queue = g_async_queue_new();
|
||||||
w->priv.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
w->priv.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
|
w->priv.min_width = -1;
|
||||||
|
w->priv.min_height = -1;
|
||||||
|
w->priv.max_width = -1;
|
||||||
|
w->priv.max_height = -1;
|
||||||
|
|
||||||
gtk_window_set_title(GTK_WINDOW(w->priv.window), w->title);
|
gtk_window_set_title(GTK_WINDOW(w->priv.window), w->title);
|
||||||
|
|
||||||
if (w->resizable)
|
if (w->resizable)
|
||||||
@@ -396,6 +415,49 @@ struct webview_priv
|
|||||||
gtk_window_set_title(GTK_WINDOW(w->priv.window), title);
|
gtk_window_set_title(GTK_WINDOW(w->priv.window), title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_focus(struct webview *w)
|
||||||
|
{
|
||||||
|
gtk_window_present(GTK_WINDOW(w->priv.window));
|
||||||
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_minsize(struct webview *w, int width, int height) {
|
||||||
|
|
||||||
|
w->priv.min_width = width;
|
||||||
|
w->priv.min_height = height;
|
||||||
|
|
||||||
|
GdkGeometry hints;
|
||||||
|
GdkWindowHints usedHints = (GdkWindowHints) GDK_HINT_MIN_SIZE;
|
||||||
|
|
||||||
|
hints.min_width = w->priv.min_width;
|
||||||
|
hints.min_height = w->priv.min_height;
|
||||||
|
if (w->priv.max_width != -1) {
|
||||||
|
hints.max_width = w->priv.max_width;
|
||||||
|
hints.max_height = w->priv.max_height;
|
||||||
|
usedHints = (GdkWindowHints)(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_window_set_geometry_hints(GTK_WINDOW(w->priv.window), w->priv.window, &hints, usedHints);
|
||||||
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_maxsize(struct webview *w, int width, int height) {
|
||||||
|
|
||||||
|
w->priv.max_width = width;
|
||||||
|
w->priv.max_height = height;
|
||||||
|
|
||||||
|
GdkGeometry hints;
|
||||||
|
GdkWindowHints usedHints = (GdkWindowHints) GDK_HINT_MAX_SIZE;
|
||||||
|
|
||||||
|
if (w->priv.min_width != -1) {
|
||||||
|
hints.min_width = w->priv.min_width;
|
||||||
|
hints.min_height = w->priv.min_height;
|
||||||
|
usedHints = (GdkWindowHints)(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
|
||||||
|
}
|
||||||
|
hints.max_width = w->priv.max_width;
|
||||||
|
hints.max_height = w->priv.max_height;
|
||||||
|
|
||||||
|
gtk_window_set_geometry_hints(GTK_WINDOW(w->priv.window), w->priv.window, &hints, usedHints);
|
||||||
|
}
|
||||||
|
|
||||||
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen)
|
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen)
|
||||||
{
|
{
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
@@ -452,7 +514,6 @@ struct webview_priv
|
|||||||
}
|
}
|
||||||
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dlg), FALSE);
|
gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dlg), FALSE);
|
||||||
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dlg), FALSE);
|
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dlg), FALSE);
|
||||||
gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dlg), TRUE);
|
|
||||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dlg), TRUE);
|
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dlg), TRUE);
|
||||||
gtk_file_chooser_set_create_folders(GTK_FILE_CHOOSER(dlg), TRUE);
|
gtk_file_chooser_set_create_folders(GTK_FILE_CHOOSER(dlg), TRUE);
|
||||||
gint response = gtk_dialog_run(GTK_DIALOG(dlg));
|
gint response = gtk_dialog_run(GTK_DIALOG(dlg));
|
||||||
@@ -1331,7 +1392,39 @@ struct webview_priv
|
|||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
w = (struct webview *)((CREATESTRUCT *)lParam)->lpCreateParams;
|
w = (struct webview *)((CREATESTRUCT *)lParam)->lpCreateParams;
|
||||||
w->priv.hwnd = hwnd;
|
w->priv.hwnd = hwnd;
|
||||||
|
|
||||||
return EmbedBrowserObject(w);
|
return EmbedBrowserObject(w);
|
||||||
|
case WM_GETMINMAXINFO:
|
||||||
|
{
|
||||||
|
if (w != NULL) {
|
||||||
|
// get pixel density
|
||||||
|
HDC hDC = GetDC(NULL);
|
||||||
|
double DPIScaleX = GetDeviceCaps(hDC, 88)/96.0;
|
||||||
|
double DPIScaleY = GetDeviceCaps(hDC, 90)/96.0;
|
||||||
|
ReleaseDC(NULL, hDC);
|
||||||
|
|
||||||
|
RECT rcClient, rcWind;
|
||||||
|
POINT ptDiff;
|
||||||
|
GetClientRect(hwnd, &rcClient);
|
||||||
|
GetWindowRect(hwnd, &rcWind);
|
||||||
|
|
||||||
|
int widthExtra = (rcWind.right - rcWind.left) - rcClient.right;
|
||||||
|
int heightExtra = (rcWind.bottom - rcWind.top) - rcClient.bottom;
|
||||||
|
|
||||||
|
LPMINMAXINFO lpMMI = (LPMINMAXINFO)lParam;
|
||||||
|
|
||||||
|
if (w->priv.min_width != -1) {
|
||||||
|
lpMMI->ptMinTrackSize.x = w->priv.min_width * DPIScaleX + widthExtra;
|
||||||
|
lpMMI->ptMinTrackSize.y = w->priv.min_height * DPIScaleY + heightExtra;
|
||||||
|
}
|
||||||
|
if (w->priv.max_width != -1) {
|
||||||
|
lpMMI->ptMaxTrackSize.x = w->priv.max_width * DPIScaleX + widthExtra;
|
||||||
|
lpMMI->ptMaxTrackSize.y = w->priv.max_height * DPIScaleY + heightExtra;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
UnEmbedBrowserObject(w);
|
UnEmbedBrowserObject(w);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
@@ -1396,6 +1489,9 @@ struct webview_priv
|
|||||||
|
|
||||||
WEBVIEW_API int webview_init(struct webview *w)
|
WEBVIEW_API int webview_init(struct webview *w)
|
||||||
{
|
{
|
||||||
|
w->priv.min_width = -1;
|
||||||
|
w->priv.max_width = -1;
|
||||||
|
|
||||||
WNDCLASSEX wc;
|
WNDCLASSEX wc;
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
DWORD style;
|
DWORD style;
|
||||||
@@ -1641,6 +1737,21 @@ struct webview_priv
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_focus(struct webview *w)
|
||||||
|
{
|
||||||
|
SetFocus(w->priv.hwnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_minsize(struct webview *w, int width, int height) {
|
||||||
|
w->priv.min_width = width;
|
||||||
|
w->priv.min_height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_maxsize(struct webview *w, int width, int height) {
|
||||||
|
w->priv.max_width = width;
|
||||||
|
w->priv.max_height = height;
|
||||||
|
}
|
||||||
|
|
||||||
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen)
|
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen)
|
||||||
{
|
{
|
||||||
if (w->priv.is_fullscreen == !!fullscreen)
|
if (w->priv.is_fullscreen == !!fullscreen)
|
||||||
@@ -2043,6 +2154,10 @@ struct webview_priv
|
|||||||
objc_setAssociatedObject(w->priv.delegate, "webview", (id)(w),
|
objc_setAssociatedObject(w->priv.delegate, "webview", (id)(w),
|
||||||
OBJC_ASSOCIATION_ASSIGN);
|
OBJC_ASSOCIATION_ASSIGN);
|
||||||
|
|
||||||
|
// Disable damn smart quotes
|
||||||
|
// Credit: https://stackoverflow.com/a/31640511
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSAutomaticQuoteSubstitutionEnabled"];
|
||||||
|
|
||||||
NSRect r = NSMakeRect(0, 0, w->width, w->height);
|
NSRect r = NSMakeRect(0, 0, w->width, w->height);
|
||||||
NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
|
NSUInteger style = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable |
|
||||||
NSWindowStyleMaskMiniaturizable;
|
NSWindowStyleMaskMiniaturizable;
|
||||||
@@ -2208,6 +2323,29 @@ struct webview_priv
|
|||||||
[w->priv.window setTitle:nsTitle];
|
[w->priv.window setTitle:nsTitle];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_focus(struct webview *w)
|
||||||
|
{
|
||||||
|
[w->priv.window makeKeyWindow];
|
||||||
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_minsize(struct webview *w, int width, int height) {
|
||||||
|
NSSize size;
|
||||||
|
size.width = width;
|
||||||
|
size.height = height;
|
||||||
|
[w->priv.window setMinSize:size];
|
||||||
|
}
|
||||||
|
|
||||||
|
WEBVIEW_API void webview_maxsize(struct webview *w, int width, int height) {
|
||||||
|
NSSize size;
|
||||||
|
size.width = width;
|
||||||
|
size.height = height;
|
||||||
|
[w->priv.window setMaxSize:size];
|
||||||
|
|
||||||
|
NSButton *button = [w->priv.window standardWindowButton:NSWindowZoomButton];
|
||||||
|
[button performSelectorOnMainThread:@selector(setEnabled:) withObject:NO
|
||||||
|
waitUntilDone:NO];
|
||||||
|
}
|
||||||
|
|
||||||
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen)
|
WEBVIEW_API void webview_set_fullscreen(struct webview *w, int fullscreen)
|
||||||
{
|
{
|
||||||
int b = ((([w->priv.window styleMask] & NSWindowStyleMaskFullScreen) ==
|
int b = ((([w->priv.window styleMask] & NSWindowStyleMaskFullScreen) ==
|
||||||
@@ -2292,6 +2430,8 @@ struct webview_priv
|
|||||||
[panel setAllowedFileTypes:fileTypes];
|
[panel setAllowedFileTypes:fileTypes];
|
||||||
}
|
}
|
||||||
[panel setTreatsFilePackagesAsDirectories:YES];
|
[panel setTreatsFilePackagesAsDirectories:YES];
|
||||||
|
[panel setNameFieldStringValue:@"Temp"]; // Necessary to prevent crash when replacing files
|
||||||
|
[panel setNameFieldStringValue:@"Untitled"];
|
||||||
[panel beginSheetModalForWindow:w->priv.window
|
[panel beginSheetModalForWindow:w->priv.window
|
||||||
completionHandler:^(NSInteger result) {
|
completionHandler:^(NSInteger result) {
|
||||||
[NSApp stopModalWithCode:result];
|
[NSApp stopModalWithCode:result];
|
||||||
|
|||||||
BIN
logo_cropped.png
BIN
logo_cropped.png
Binary file not shown.
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 34 KiB |
3
package-lock.json
generated
Normal file
3
package-lock.json
generated
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"lockfileVersion": 1
|
||||||
|
}
|
||||||
15
runtime/assets.go
Normal file
15
runtime/assets.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package runtime
|
||||||
|
|
||||||
|
import _ "embed"
|
||||||
|
|
||||||
|
//go:embed assets/bridge.js
|
||||||
|
var BridgeJS []byte
|
||||||
|
|
||||||
|
//go:embed assets/wails.js
|
||||||
|
var WailsJS string
|
||||||
|
|
||||||
|
//go:embed assets/wails.css
|
||||||
|
var WailsCSS string
|
||||||
|
|
||||||
|
//go:embed js/runtime/init.js
|
||||||
|
var InitJS []byte
|
||||||
File diff suppressed because one or more lines are too long
@@ -19,6 +19,16 @@ func (r *Events) On(eventName string, callback func(optionalData ...interface{})
|
|||||||
r.eventManager.On(eventName, callback)
|
r.eventManager.On(eventName, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Once pass through
|
||||||
|
func (r *Events) Once(eventName string, callback func(optionalData ...interface{})) {
|
||||||
|
r.eventManager.Once(eventName, callback)
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnMultiple pass through
|
||||||
|
func (r *Events) OnMultiple(eventName string, callback func(optionalData ...interface{}), counter uint) {
|
||||||
|
r.eventManager.OnMultiple(eventName, callback, counter)
|
||||||
|
}
|
||||||
|
|
||||||
// Emit pass through
|
// Emit pass through
|
||||||
func (r *Events) Emit(eventName string, optionalData ...interface{}) {
|
func (r *Events) Emit(eventName string, optionalData ...interface{}) {
|
||||||
r.eventManager.Emit(eventName, optionalData...)
|
r.eventManager.Emit(eventName, optionalData...)
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
"browser": true,
|
"browser": true,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"amd": true,
|
"amd": true,
|
||||||
"node": true,
|
"node": true
|
||||||
},
|
},
|
||||||
"extends": "eslint:recommended",
|
"extends": "eslint:recommended",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2016,
|
"ecmaVersion": 2016,
|
||||||
"sourceType": "module",
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": [
|
"indent": [
|
||||||
|
|||||||
@@ -1,26 +1,40 @@
|
|||||||
/*
|
/*
|
||||||
_ __ _ __
|
_ __ _ __
|
||||||
| | / /___ _(_) /____
|
| | / /___ _(_) /____
|
||||||
| | /| / / __ `/ / / ___/
|
| | /| / / __ `/ / / ___/
|
||||||
| |/ |/ / /_/ / / (__ )
|
| |/ |/ / /_/ / / (__ )
|
||||||
|__/|__/\__,_/_/_/____/
|
|__/|__/\__,_/_/_/____/
|
||||||
The lightweight framework for web-like apps
|
The lightweight framework for web-like apps
|
||||||
(c) Lea Anthony 2019-present
|
(c) Lea Anthony 2019-present
|
||||||
*/
|
*/
|
||||||
/* jshint esversion: 6 */
|
/* jshint esversion: 6 */
|
||||||
import * as Log from './log';
|
import * as Log from './log';
|
||||||
import * as Browser from './browser';
|
import * as Browser from './browser';
|
||||||
import { On, OnMultiple, Emit, Notify, Heartbeat, Acknowledge } from './events';
|
import {Acknowledge, Emit, Heartbeat, Notify, On, OnMultiple} from './events';
|
||||||
import { NewBinding } from './bindings';
|
import {NewBinding} from './bindings';
|
||||||
import { Callback } from './calls';
|
import {Callback} from './calls';
|
||||||
import { AddScript, InjectCSS, InjectFirebug } from './utils';
|
import {AddScript, InjectCSS, InjectFirebug} from './utils';
|
||||||
import { AddIPCListener } from './ipc';
|
import {AddIPCListener} from './ipc';
|
||||||
import * as Store from './store';
|
import * as Store from './store';
|
||||||
|
|
||||||
// Initialise global if not already
|
// Initialise global if not already
|
||||||
window.wails = window.wails || {};
|
window.wails = window.wails || {};
|
||||||
window.backend = {};
|
window.backend = {};
|
||||||
|
|
||||||
|
// On webkit2gtk >= 2.32, the external object is not passed to the window context.
|
||||||
|
// However, IE will throw a strict mode error if window.external is assigned to
|
||||||
|
// so we need to make sure that line of code isn't reached in IE
|
||||||
|
|
||||||
|
// Using !window.external transpiles to `window.external = window.external || ...`
|
||||||
|
// so we have to use an explicit if statement to prevent webpack from optimizing the code.
|
||||||
|
if (window.external == undefined) {
|
||||||
|
window.external = {
|
||||||
|
invoke: function (x) {
|
||||||
|
window.webkit.messageHandlers.external.postMessage(x);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Setup internal calls
|
// Setup internal calls
|
||||||
var internal = {
|
var internal = {
|
||||||
NewBinding,
|
NewBinding,
|
||||||
@@ -61,7 +75,7 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Use firebug?
|
// Use firebug?
|
||||||
if( window.usefirebug ) {
|
if (window.usefirebug) {
|
||||||
InjectFirebug();
|
InjectFirebug();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,4 +85,4 @@ Emit('wails:loaded');
|
|||||||
// Nothing to init in production
|
// Nothing to init in production
|
||||||
export function Init(callback) {
|
export function Init(callback) {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|||||||
44
runtime/js/package-lock.json
generated
44
runtime/js/package-lock.json
generated
@@ -2681,26 +2681,18 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"elliptic": {
|
"elliptic": {
|
||||||
"version": "6.5.3",
|
"version": "6.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
|
||||||
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
"integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"bn.js": "^4.4.0",
|
"bn.js": "^4.11.9",
|
||||||
"brorand": "^1.0.1",
|
"brorand": "^1.1.0",
|
||||||
"hash.js": "^1.0.0",
|
"hash.js": "^1.0.0",
|
||||||
"hmac-drbg": "^1.0.0",
|
"hmac-drbg": "^1.0.1",
|
||||||
"inherits": "^2.0.1",
|
"inherits": "^2.0.4",
|
||||||
"minimalistic-assert": "^1.0.0",
|
"minimalistic-assert": "^1.0.1",
|
||||||
"minimalistic-crypto-utils": "^1.0.0"
|
"minimalistic-crypto-utils": "^1.0.1"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"bn.js": {
|
|
||||||
"version": "4.11.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
|
|
||||||
"integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"emoji-regex": {
|
"emoji-regex": {
|
||||||
@@ -4263,9 +4255,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.20",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"loose-envify": {
|
"loose-envify": {
|
||||||
@@ -5533,9 +5525,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ssri": {
|
"ssri": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz",
|
||||||
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
|
"integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"figgy-pudding": "^3.5.1"
|
"figgy-pudding": "^3.5.1"
|
||||||
@@ -6590,9 +6582,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"y18n": {
|
"y18n": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
|
||||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
bridge.js
|
index.js
|
||||||
18
runtime/js/runtime/package-lock.json
generated
18
runtime/js/runtime/package-lock.json
generated
@@ -124,9 +124,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hosted-git-info": {
|
"hosted-git-info": {
|
||||||
"version": "2.8.8",
|
"version": "2.8.9",
|
||||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
|
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
|
||||||
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==",
|
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
@@ -260,9 +260,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"path-parse": {
|
"path-parse": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"path-type": {
|
"path-type": {
|
||||||
@@ -451,9 +451,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"y18n": {
|
"y18n": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
|
||||||
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
|
"integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"yargs": {
|
"yargs": {
|
||||||
|
|||||||
@@ -67,6 +67,16 @@ func (r *Window) SetColour(colour string) error {
|
|||||||
return r.renderer.SetColour(colour)
|
return r.renderer.SetColour(colour)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetMinSize sets the minimum size of a resizable window
|
||||||
|
func (r *Window) SetMinSize(width, height int) {
|
||||||
|
r.renderer.SetMinSize(width, height)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetMaxSize sets the maximum size of a resizable window
|
||||||
|
func (r *Window) SetMaxSize(width, height int) {
|
||||||
|
r.renderer.SetMaxSize(width, height)
|
||||||
|
}
|
||||||
|
|
||||||
// Fullscreen makes the window fullscreen
|
// Fullscreen makes the window fullscreen
|
||||||
func (r *Window) Fullscreen() {
|
func (r *Window) Fullscreen() {
|
||||||
r.renderer.Fullscreen()
|
r.renderer.Fullscreen()
|
||||||
|
|||||||
@@ -8,38 +8,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Default target to run when none is specified
|
|
||||||
// If not set, running mage will list available targets
|
|
||||||
// var Default = Build
|
|
||||||
|
|
||||||
/*
|
|
||||||
# Build runtime
|
|
||||||
echo "**** Building Runtime ****"
|
|
||||||
cd runtime/js
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
echo "**** Packing Assets ****"
|
|
||||||
cd cmd
|
|
||||||
mewn
|
|
||||||
cd ..
|
|
||||||
cd lib/renderer
|
|
||||||
mewn
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
echo "**** Installing Wails locally ****"
|
|
||||||
cd cmd/wails
|
|
||||||
go install
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
echo "**** Tidying the mods! ****"
|
|
||||||
go mod tidy
|
|
||||||
|
|
||||||
echo "**** WE ARE DONE! ****"
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
func runCommand(command string, args ...string) {
|
func runCommand(command string, args ...string) {
|
||||||
cmd := exec.Command(command, args...)
|
cmd := exec.Command(command, args...)
|
||||||
output, err := cmd.CombinedOutput()
|
output, err := cmd.CombinedOutput()
|
||||||
@@ -48,7 +16,6 @@ func runCommand(command string, args ...string) {
|
|||||||
log.Println(string(output))
|
log.Println(string(output))
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
cmd.Run()
|
|
||||||
fmt.Println(string(output))
|
fmt.Println(string(output))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,26 +27,26 @@ func main() {
|
|||||||
// Build Runtime
|
// Build Runtime
|
||||||
fmt.Println("**** Building Runtime ****")
|
fmt.Println("**** Building Runtime ****")
|
||||||
runtimeDir, _ := filepath.Abs(filepath.Join(dir, "..", "runtime", "js"))
|
runtimeDir, _ := filepath.Abs(filepath.Join(dir, "..", "runtime", "js"))
|
||||||
os.Chdir(runtimeDir)
|
err := os.Chdir(runtimeDir)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
runCommand("npm", "install")
|
runCommand("npm", "install")
|
||||||
runCommand("npm", "run", "build")
|
runCommand("npm", "run", "build")
|
||||||
|
|
||||||
// Pack assets
|
|
||||||
fmt.Println("**** Packing Assets ****")
|
|
||||||
rendererDir, _ := filepath.Abs(filepath.Join(dir, "..", "lib", "renderer"))
|
|
||||||
os.Chdir(rendererDir)
|
|
||||||
runCommand("mewn")
|
|
||||||
cmdDir, _ := filepath.Abs(filepath.Join(dir, "..", "cmd"))
|
|
||||||
os.Chdir(cmdDir)
|
|
||||||
runCommand("mewn")
|
|
||||||
|
|
||||||
// Install Wails
|
// Install Wails
|
||||||
fmt.Println("**** Installing Wails locally ****")
|
fmt.Println("**** Installing Wails locally ****")
|
||||||
execDir, _ := filepath.Abs(filepath.Join(dir, "..", "cmd", "wails"))
|
execDir, _ := filepath.Abs(filepath.Join(dir, "..", "cmd", "wails"))
|
||||||
os.Chdir(execDir)
|
err = os.Chdir(execDir)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
runCommand("go", "install")
|
runCommand("go", "install")
|
||||||
|
|
||||||
baseDir, _ := filepath.Abs(filepath.Join(dir, ".."))
|
baseDir, _ := filepath.Abs(filepath.Join(dir, ".."))
|
||||||
os.Chdir(baseDir)
|
err = os.Chdir(baseDir)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
runCommand("go", "mod", "tidy")
|
runCommand("go", "mod", "tidy")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "**** Checking if Wails passes unit tests ****"
|
echo "**** Checking if Wails passes unit tests ****"
|
||||||
if ! go test ./...
|
if ! go test ./lib/... ./runtime/... ./cmd/...
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
echo "ERROR: Unit tests failed!"
|
echo "ERROR: Unit tests failed!"
|
||||||
@@ -15,15 +15,6 @@ npm install
|
|||||||
npm run build
|
npm run build
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
echo "**** Packing Assets ****"
|
|
||||||
cd cmd
|
|
||||||
mewn
|
|
||||||
cd ..
|
|
||||||
cd lib/renderer
|
|
||||||
mewn
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
|
|
||||||
cd cmd/wails
|
cd cmd/wails
|
||||||
echo "**** Checking if Wails compiles ****"
|
echo "**** Checking if Wails compiles ****"
|
||||||
if ! go build .
|
if ! go build .
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ cd runtime/js
|
|||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
mewn
|
|
||||||
|
|
||||||
git add cmd/version.go
|
git add cmd/version.go
|
||||||
git commit cmd/version.go -m "Bump to ${TAG}"
|
git commit cmd/version.go -m "Bump to ${TAG}"
|
||||||
|
|||||||
BIN
sponsors/bronze sponsor.png
Normal file
BIN
sponsors/bronze sponsor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
13
v2/.vscode/settings.json
vendored
13
v2/.vscode/settings.json
vendored
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"files.associations": {
|
|
||||||
"ios": "c",
|
|
||||||
"typeinfo": "c",
|
|
||||||
"sstream": "c",
|
|
||||||
"__functional_03": "c",
|
|
||||||
"functional": "c",
|
|
||||||
"__locale": "c",
|
|
||||||
"locale": "c",
|
|
||||||
"chrono": "c",
|
|
||||||
"system_error": "c"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,4 +2,5 @@
|
|||||||
|
|
||||||
This branch contains WORK IN PROGRESS! There are no guarantees. Use at your peril!
|
This branch contains WORK IN PROGRESS! There are no guarantees. Use at your peril!
|
||||||
|
|
||||||
This document will be updated as progress is made.
|
This document will be updated as progress is made.
|
||||||
|
|
||||||
|
|||||||
48
v2/cmd/wails/internal/commands/build/README.md
Normal file
48
v2/cmd/wails/internal/commands/build/README.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Build
|
||||||
|
|
||||||
|
The build command processes the Wails project and generates an application binary.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
`wails build <flags>`
|
||||||
|
|
||||||
|
### Flags
|
||||||
|
|
||||||
|
| Flag | Details | Default |
|
||||||
|
| :------------- | :----------- | :------ |
|
||||||
|
| -clean | Clean the bin directory before building | |
|
||||||
|
| -compiler path/to/compiler | Use a different go compiler, eg go1.15beta1 | go |
|
||||||
|
| -ldflags "custom ld flags" | Use given ldflags | |
|
||||||
|
| -o path/to/binary | Compile to given path/filename | |
|
||||||
|
| -k | Keep generated assets | |
|
||||||
|
| -package | Create a platform specific package | |
|
||||||
|
| -production | Compile in production mode: -ldflags="-w -s" + "-h windows" on Windows | |
|
||||||
|
| -tags | Build tags to pass to Go compiler (quoted and space separated) | |
|
||||||
|
| -upx | Compress final binary with UPX (if installed) | |
|
||||||
|
| -upxflags "custom flags" | Flags to pass to upx | |
|
||||||
|
| -v int | Verbosity level (0 - silent, 1 - default, 2 - verbose) | 1 |
|
||||||
|
| -delve | If true, runs delve on the compiled binary | false |
|
||||||
|
|
||||||
|
## The Build Process
|
||||||
|
|
||||||
|
The build process is as follows:
|
||||||
|
|
||||||
|
- The flags are processed, and an Options struct built containing the build context.
|
||||||
|
- The type of target is determined, and a custom build process is followed for target.
|
||||||
|
|
||||||
|
### Desktop Target
|
||||||
|
|
||||||
|
- The frontend dependencies are installed. The command is read from the project file `wails.json` under the key `frontend:install` and executed in the `frontend` directory. If this is not defined, it is ignored.
|
||||||
|
- The frontend is then built. This command is read from the project file `wails.json` under the key `frontend:install` and executed in the `frontend` directory. If this is not defined, it is ignored.
|
||||||
|
- The project directory is checked to see if the `build` directory exists. If not, it is created and default project assets are copied to it.
|
||||||
|
- An asset bundle is then created by reading the `html` key from `wails.json` and loading the referenced file. This is then parsed, looking for local Javascript and CSS references. Those files are in turn loaded into memory, converted to C data and saved into the asset bundle located at `build/assets.h`, which also includes the original HTML.
|
||||||
|
- The application icon is then processed: if there is no `build/appicon.png`, a default icon is copied. On Windows, an `app.ico` file is generated from this png. On Mac, `icons.icns` is generated.
|
||||||
|
- If there are icons in the `build/tray` directory, these are processed, converted to C data and saved as `build/trayicons.h`, ready for the compilation step.
|
||||||
|
- If there are icons in the `build/dialog` directory, these are processed, converted to C data and saved as `build/userdialogicons.h`, ready for the compilation step.
|
||||||
|
- If the `-package` flag is given for a Windows target, the Windows assets in the `build/windows` directory are processed: manifest + icons compiled to a `.syso` file (deleted after compilation).
|
||||||
|
- If we are building a universal binary for Mac, the application is compiled for both `arm64` and `amd64`. The `lipo` tool is then executed to create the universal binary.
|
||||||
|
- If we are not building a universal binary for Mac, the application is built using `go build`, using build tags to indicate type of application and build mode (debug/production).
|
||||||
|
- If the `-upx` flag was provided, `upx` is invoked to compress the binary. Custom flags may be provided using the `-upxflags` flag.
|
||||||
|
- If the `package` flag is given for a non Windows target, the application is bundled for the platform. On Mac, this creates a `.app` with the processed icons, the `Info.plist` in `build/darwin` and the compiled binary.
|
||||||
|
|
||||||
|
|
||||||
@@ -3,10 +3,15 @@ package build
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
"text/tabwriter"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v2/internal/system"
|
||||||
|
|
||||||
"github.com/leaanthony/clir"
|
"github.com/leaanthony/clir"
|
||||||
"github.com/leaanthony/slicer"
|
"github.com/leaanthony/slicer"
|
||||||
"github.com/wailsapp/wails/v2/pkg/clilogger"
|
"github.com/wailsapp/wails/v2/pkg/clilogger"
|
||||||
@@ -22,43 +27,55 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
|||||||
|
|
||||||
command := app.NewSubCommand("build", "Builds the application")
|
command := app.NewSubCommand("build", "Builds the application")
|
||||||
|
|
||||||
// Setup target type flag
|
// Setup noPackage flag
|
||||||
description := "Type of application to build. Valid types: " + validTargetTypes.Join(",")
|
noPackage := false
|
||||||
command.StringFlag("t", description, &outputType)
|
command.BoolFlag("noPackage", "Skips platform specific packaging", &noPackage)
|
||||||
|
|
||||||
// Setup production flag
|
|
||||||
production := false
|
|
||||||
command.BoolFlag("production", "Build in production mode", &production)
|
|
||||||
|
|
||||||
// Setup pack flag
|
|
||||||
pack := false
|
|
||||||
command.BoolFlag("package", "Create a platform specific package", &pack)
|
|
||||||
|
|
||||||
compilerCommand := "go"
|
compilerCommand := "go"
|
||||||
command.StringFlag("compiler", "Use a different go compiler to build, eg go1.15beta1", &compilerCommand)
|
command.StringFlag("compiler", "Use a different go compiler to build, eg go1.15beta1", &compilerCommand)
|
||||||
|
|
||||||
|
compress := false
|
||||||
|
command.BoolFlag("upx", "Compress final binary with UPX (if installed)", &compress)
|
||||||
|
|
||||||
|
compressFlags := ""
|
||||||
|
command.StringFlag("upxflags", "Flags to pass to upx", &compressFlags)
|
||||||
|
|
||||||
// Setup Platform flag
|
// Setup Platform flag
|
||||||
platform := runtime.GOOS
|
platform := runtime.GOOS
|
||||||
command.StringFlag("platform", "Platform to target", &platform)
|
//command.StringFlag("platform", "Platform to target", &platform)
|
||||||
|
|
||||||
// Quiet Build
|
// Verbosity
|
||||||
quiet := false
|
verbosity := 1
|
||||||
command.BoolFlag("q", "Suppress output to console", &quiet)
|
command.IntFlag("v", "Verbosity level (0 - silent, 1 - default, 2 - verbose)", &verbosity)
|
||||||
|
|
||||||
// ldflags to pass to `go`
|
// ldflags to pass to `go`
|
||||||
ldflags := ""
|
ldflags := ""
|
||||||
command.StringFlag("ldflags", "optional ldflags", &ldflags)
|
command.StringFlag("ldflags", "optional ldflags", &ldflags)
|
||||||
|
|
||||||
// Log to file
|
// tags to pass to `go`
|
||||||
logFile := ""
|
tags := ""
|
||||||
command.StringFlag("l", "Log to file", &logFile)
|
command.StringFlag("tags", "tags to pass to Go compiler (quoted and space separated)", &tags)
|
||||||
|
|
||||||
// Retain assets
|
outputFilename := ""
|
||||||
keepAssets := false
|
command.StringFlag("o", "Output filename", &outputFilename)
|
||||||
command.BoolFlag("k", "Keep generated assets", &keepAssets)
|
|
||||||
|
// Clean build directory
|
||||||
|
cleanBuildDirectory := false
|
||||||
|
command.BoolFlag("clean", "Clean the build directory before building", &cleanBuildDirectory)
|
||||||
|
|
||||||
|
webview2 := "download"
|
||||||
|
command.StringFlag("webview2", "WebView2 installer strategy: download,embed,browser,error.", &webview2)
|
||||||
|
|
||||||
|
skipFrontend := false
|
||||||
|
command.BoolFlag("s", "Skips building the frontend", &skipFrontend)
|
||||||
|
|
||||||
|
forceBuild := false
|
||||||
|
command.BoolFlag("f", "Force build application", &forceBuild)
|
||||||
|
|
||||||
command.Action(func() error {
|
command.Action(func() error {
|
||||||
|
|
||||||
|
quiet := verbosity == 0
|
||||||
|
|
||||||
// Create logger
|
// Create logger
|
||||||
logger := clilogger.New(w)
|
logger := clilogger.New(w)
|
||||||
logger.Mute(quiet)
|
logger.Mute(quiet)
|
||||||
@@ -72,28 +89,122 @@ func AddBuildSubcommand(app *clir.Cli, w io.Writer) {
|
|||||||
app.PrintBanner()
|
app.PrintBanner()
|
||||||
}
|
}
|
||||||
|
|
||||||
task := fmt.Sprintf("Building %s Application", strings.Title(outputType))
|
// Check platform
|
||||||
logger.Println(task)
|
validPlatformArch := slicer.String([]string{
|
||||||
logger.Println(strings.Repeat("-", len(task)))
|
"darwin",
|
||||||
|
"darwin/amd64",
|
||||||
|
"darwin/arm64",
|
||||||
|
"darwin/universal",
|
||||||
|
"linux",
|
||||||
|
//"linux/amd64",
|
||||||
|
//"linux/arm-7",
|
||||||
|
"windows",
|
||||||
|
"windows/amd64",
|
||||||
|
})
|
||||||
|
if !validPlatformArch.Contains(platform) {
|
||||||
|
return fmt.Errorf("platform %s is not supported", platform)
|
||||||
|
}
|
||||||
|
|
||||||
// Setup mode
|
if compress && platform == "darwin/universal" {
|
||||||
mode := build.Debug
|
logger.Println("Warning: compress flag unsupported for universal binaries. Ignoring.")
|
||||||
if production {
|
compress = false
|
||||||
mode = build.Production
|
}
|
||||||
|
|
||||||
|
// Lookup compiler path
|
||||||
|
compilerPath, err := exec.LookPath(compilerCommand)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to find compiler: %s", compilerCommand)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tags
|
||||||
|
experimental := false
|
||||||
|
userTags := []string{}
|
||||||
|
for _, tag := range strings.Split(tags, " ") {
|
||||||
|
thisTag := strings.TrimSpace(tag)
|
||||||
|
if thisTag != "" {
|
||||||
|
userTags = append(userTags, thisTag)
|
||||||
|
}
|
||||||
|
if thisTag == "exp" {
|
||||||
|
experimental = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if runtime.GOOS == "darwin" && !experimental {
|
||||||
|
return fmt.Errorf("MacOS version coming soon!")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Webview2 installer strategy (download by default)
|
||||||
|
wv2rtstrategy := ""
|
||||||
|
webview2 = strings.ToLower(webview2)
|
||||||
|
if webview2 != "" {
|
||||||
|
validWV2Runtime := slicer.String([]string{"download", "embed", "browser", "error"})
|
||||||
|
if !validWV2Runtime.Contains(webview2) {
|
||||||
|
return fmt.Errorf("invalid option for flag 'webview2': %s", webview2)
|
||||||
|
}
|
||||||
|
// These are the build tags associated with the strategies
|
||||||
|
switch webview2 {
|
||||||
|
case "embed":
|
||||||
|
wv2rtstrategy = "wv2runtime.embed"
|
||||||
|
case "error":
|
||||||
|
wv2rtstrategy = "wv2runtime.error"
|
||||||
|
case "browser":
|
||||||
|
wv2rtstrategy = "wv2runtime.browser"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create BuildOptions
|
// Create BuildOptions
|
||||||
buildOptions := &build.Options{
|
buildOptions := &build.Options{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
OutputType: outputType,
|
OutputType: outputType,
|
||||||
Mode: mode,
|
OutputFile: outputFilename,
|
||||||
Pack: pack,
|
CleanBuildDirectory: cleanBuildDirectory,
|
||||||
Platform: platform,
|
Mode: build.Production,
|
||||||
LDFlags: ldflags,
|
Pack: !noPackage,
|
||||||
Compiler: compilerCommand,
|
LDFlags: ldflags,
|
||||||
KeepAssets: keepAssets,
|
Compiler: compilerCommand,
|
||||||
|
Verbosity: verbosity,
|
||||||
|
ForceBuild: forceBuild,
|
||||||
|
IgnoreFrontend: skipFrontend,
|
||||||
|
Compress: compress,
|
||||||
|
CompressFlags: compressFlags,
|
||||||
|
UserTags: userTags,
|
||||||
|
WebView2Strategy: wv2rtstrategy,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate platform and arch
|
||||||
|
platformSplit := strings.Split(platform, "/")
|
||||||
|
buildOptions.Platform = platformSplit[0]
|
||||||
|
if system.IsAppleSilicon {
|
||||||
|
buildOptions.Arch = "arm64"
|
||||||
|
} else {
|
||||||
|
buildOptions.Arch = runtime.GOARCH
|
||||||
|
}
|
||||||
|
if len(platformSplit) == 2 {
|
||||||
|
buildOptions.Arch = platformSplit[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start a new tabwriter
|
||||||
|
w := new(tabwriter.Writer)
|
||||||
|
w.Init(os.Stdout, 8, 8, 0, '\t', 0)
|
||||||
|
|
||||||
|
// Write out the system information
|
||||||
|
fmt.Fprintf(w, "\n")
|
||||||
|
fmt.Fprintf(w, "App Type: \t%s\n", buildOptions.OutputType)
|
||||||
|
fmt.Fprintf(w, "Platform: \t%s\n", buildOptions.Platform)
|
||||||
|
fmt.Fprintf(w, "Arch: \t%s\n", buildOptions.Arch)
|
||||||
|
fmt.Fprintf(w, "Compiler: \t%s\n", compilerPath)
|
||||||
|
fmt.Fprintf(w, "Skip Frontend: \t%t\n", skipFrontend)
|
||||||
|
fmt.Fprintf(w, "Compress: \t%t\n", buildOptions.Compress)
|
||||||
|
fmt.Fprintf(w, "Package: \t%t\n", buildOptions.Pack)
|
||||||
|
fmt.Fprintf(w, "Clean Build Dir: \t%t\n", buildOptions.CleanBuildDirectory)
|
||||||
|
fmt.Fprintf(w, "LDFlags: \t\"%s\"\n", buildOptions.LDFlags)
|
||||||
|
fmt.Fprintf(w, "Tags: \t[%s]\n", strings.Join(buildOptions.UserTags, ","))
|
||||||
|
if len(buildOptions.OutputFile) > 0 {
|
||||||
|
fmt.Fprintf(w, "Output File: \t%s\n", buildOptions.OutputFile)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(w, "\n")
|
||||||
|
w.Flush()
|
||||||
|
|
||||||
return doBuild(buildOptions)
|
return doBuild(buildOptions)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
package debug
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"github.com/wailsapp/wails/v2/internal/shell"
|
|
||||||
"io"
|
|
||||||
"os"
|
|
||||||
"runtime"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/leaanthony/clir"
|
|
||||||
"github.com/leaanthony/slicer"
|
|
||||||
"github.com/wailsapp/wails/v2/pkg/clilogger"
|
|
||||||
"github.com/wailsapp/wails/v2/pkg/commands/build"
|
|
||||||
)
|
|
||||||
|
|
||||||
// AddSubcommand adds the `debug` command for the Wails application
|
|
||||||
func AddSubcommand(app *clir.Cli, w io.Writer) error {
|
|
||||||
|
|
||||||
outputType := "desktop"
|
|
||||||
|
|
||||||
validTargetTypes := slicer.String([]string{"desktop", "hybrid", "server"})
|
|
||||||
|
|
||||||
command := app.NewSubCommand("debug", "Builds the application then runs delve on the binary")
|
|
||||||
|
|
||||||
// Setup target type flag
|
|
||||||
description := "Type of application to build. Valid types: " + validTargetTypes.Join(",")
|
|
||||||
command.StringFlag("t", description, &outputType)
|
|
||||||
|
|
||||||
compilerCommand := "go"
|
|
||||||
command.StringFlag("compiler", "Use a different go compiler to build, eg go1.15beta1", &compilerCommand)
|
|
||||||
|
|
||||||
quiet := false
|
|
||||||
command.BoolFlag("q", "Suppress output to console", &quiet)
|
|
||||||
|
|
||||||
// ldflags to pass to `go`
|
|
||||||
ldflags := ""
|
|
||||||
command.StringFlag("ldflags", "optional ldflags", &ldflags)
|
|
||||||
|
|
||||||
// Log to file
|
|
||||||
logFile := ""
|
|
||||||
command.StringFlag("l", "Log to file", &logFile)
|
|
||||||
|
|
||||||
command.Action(func() error {
|
|
||||||
|
|
||||||
// Create logger
|
|
||||||
logger := clilogger.New(w)
|
|
||||||
logger.Mute(quiet)
|
|
||||||
|
|
||||||
// Validate output type
|
|
||||||
if !validTargetTypes.Contains(outputType) {
|
|
||||||
return fmt.Errorf("output type '%s' is not valid", outputType)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !quiet {
|
|
||||||
app.PrintBanner()
|
|
||||||
}
|
|
||||||
|
|
||||||
task := fmt.Sprintf("Building %s Application", strings.Title(outputType))
|
|
||||||
logger.Println(task)
|
|
||||||
logger.Println(strings.Repeat("-", len(task)))
|
|
||||||
|
|
||||||
// Setup mode
|
|
||||||
mode := build.Debug
|
|
||||||
|
|
||||||
// Create BuildOptions
|
|
||||||
buildOptions := &build.Options{
|
|
||||||
Logger: logger,
|
|
||||||
OutputType: outputType,
|
|
||||||
Mode: mode,
|
|
||||||
Pack: false,
|
|
||||||
Platform: runtime.GOOS,
|
|
||||||
LDFlags: ldflags,
|
|
||||||
Compiler: compilerCommand,
|
|
||||||
KeepAssets: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
outputFilename, err := doDebugBuild(buildOptions)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check delve exists
|
|
||||||
delveExists := shell.CommandExists("dlv")
|
|
||||||
if !delveExists {
|
|
||||||
return fmt.Errorf("cannot launch delve (Is it installed?)")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get cwd
|
|
||||||
cwd, err := os.Getwd()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Launch delve
|
|
||||||
println("Launching Delve on port 2345...")
|
|
||||||
command := shell.CreateCommand(cwd, "dlv", "--listen=:2345", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", outputFilename)
|
|
||||||
return command.Run()
|
|
||||||
})
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// doDebugBuild is our main build command
|
|
||||||
func doDebugBuild(buildOptions *build.Options) (string, error) {
|
|
||||||
|
|
||||||
// Start Time
|
|
||||||
start := time.Now()
|
|
||||||
|
|
||||||
outputFilename, err := build.Build(buildOptions)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Output stats
|
|
||||||
elapsed := time.Since(start)
|
|
||||||
buildOptions.Logger.Println("")
|
|
||||||
buildOptions.Logger.Println(fmt.Sprintf("Built '%s' in %s.", outputFilename, elapsed.Round(time.Millisecond).String()))
|
|
||||||
buildOptions.Logger.Println("")
|
|
||||||
|
|
||||||
return outputFilename, nil
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user