Compare commits
932 Commits
pierremtb/
...
nested_dir
Author | SHA1 | Date | |
---|---|---|---|
083103144a | |||
1dafbf105e | |||
773f013115 | |||
c5cd460595 | |||
845352046b | |||
597f1087f9 | |||
511334683a | |||
223a4ad45d | |||
edf31ec1d3 | |||
1539557005 | |||
1d3ba4e3ac | |||
4110aa00db | |||
7eb52cda36 | |||
7872fb9cbd | |||
651181e62c | |||
38a245f2fc | |||
1b4289f93f | |||
d0697c24fd | |||
8c24e29081 | |||
2b9d26e2ff | |||
ab148a7654 | |||
553e650fbe | |||
9690a24c68 | |||
978d5d44a2 | |||
9df476543a | |||
cf303ebe97 | |||
b1d1d89ca5 | |||
3a599d0a0a | |||
8340f6b906 | |||
ddb034b14d | |||
bfa2f67393 | |||
447069a97b | |||
49b78d726a | |||
5b4cddd0b0 | |||
8878c148ed | |||
c3c2ded795 | |||
fb35fdcc38 | |||
e76ba9921c | |||
b19acd550d | |||
f3e9d110c0 | |||
658497da1d | |||
bd01059a92 | |||
57a977e6be | |||
94b0cc1f3e | |||
5734cc7fc3 | |||
3168c22de7 | |||
3c94fe9047 | |||
cdd6b56d42 | |||
75ac3bc61b | |||
29d511d085 | |||
b0a41939e8 | |||
7d2c1061ba | |||
d768073d17 | |||
dc8496c62e | |||
416de9a9fb | |||
da65426ddc | |||
585b485852 | |||
e85f16ff9c | |||
e7d2289a14 | |||
d35531758d | |||
729e0a7949 | |||
620b7401aa | |||
e3e67b00d5 | |||
49d4f8e5c3 | |||
47b159c605 | |||
c7b086fa69 | |||
203db79204 | |||
48a4fd8373 | |||
17eb84325f | |||
ebf048478d | |||
28a8cd2421 | |||
1506de92f5 | |||
8a03413643 | |||
f59b806a88 | |||
23a0085c78 | |||
a280a8c3f0 | |||
11620dfa6b | |||
f6e26e0bab | |||
f6b3a55cbf | |||
74939e5cd6 | |||
9906c9947a | |||
48d6a21f0a | |||
dd6a980915 | |||
2516df3a39 | |||
52125f0566 | |||
e489222b6a | |||
d93a57d7bf | |||
d34aea345b | |||
0b6102b0ac | |||
9e0873ed84 | |||
8587eb5fea | |||
b898c27e74 | |||
3026866a16 | |||
92fc294eae | |||
21e967ea7f | |||
3f00e7186c | |||
d3a4fd8b55 | |||
2be7107cca | |||
94f194a984 | |||
4fe880a970 | |||
8f5fbfc273 | |||
e660f52bb0 | |||
d74fdd9369 | |||
334145f0be | |||
c24073b6ae | |||
078b7f3bf7 | |||
3d65676ccb | |||
ce566fb6e5 | |||
b23fc9f623 | |||
5c2dfb8e40 | |||
0e341d7863 | |||
6a03ff9596 | |||
d7bd0c937d | |||
d3b2483f4f | |||
7838b7c9fd | |||
130ecf1f88 | |||
550d8b3753 | |||
696222a070 | |||
edb424988d | |||
1e487ef3bd | |||
811ef3e72d | |||
980e3c4bc2 | |||
78b6854c6b | |||
068b9129cf | |||
05fba3c50c | |||
7944a4ce41 | |||
4640f1a3ad | |||
cd79059d97 | |||
2d95e19048 | |||
d047587bc1 | |||
128e1093fb | |||
afdc305e3e | |||
4bc5439996 | |||
be14022f97 | |||
eda78ef5ae | |||
0cc833e687 | |||
33e83747f3 | |||
c3a8fc6d93 | |||
8ff84e269c | |||
99cb6a6179 | |||
13dbfdfaa4 | |||
8603f5c53a | |||
d5cc9e8386 | |||
533e17466b | |||
01c7b69f50 | |||
47feae3bd9 | |||
e7ecd655c4 | |||
d9e538c6ea | |||
e297f8286f | |||
b3bc90bbe4 | |||
95a02cbcd7 | |||
a049768f1c | |||
818d9a0d77 | |||
1a8f80a7dc | |||
566c9eaf10 | |||
e6485c2da1 | |||
0479edd36a | |||
87c1e92134 | |||
8f950ac1b0 | |||
78e4f43708 | |||
270436f404 | |||
57e61632a9 | |||
884191b8bb | |||
21b92f5f13 | |||
5599a75dbd | |||
3a06ae6e34 | |||
22857d77e9 | |||
1a325d0b29 | |||
1240b23080 | |||
8445080d7a | |||
bbe89f56a7 | |||
86e8bcfe0b | |||
21ccf129d6 | |||
dfc4b7d0c5 | |||
17b1120a27 | |||
2b509a515b | |||
97594b9a9e | |||
c65190a158 | |||
0621e1a53e | |||
f36b69f4f0 | |||
92f7a62af2 | |||
f73831ac27 | |||
09f39499e9 | |||
7ac4a9507b | |||
3956958452 | |||
0fe866ad8b | |||
cca498be04 | |||
039cb38d56 | |||
4fb7065ddf | |||
39f512d32d | |||
85469f2d7d | |||
3e24e2c9e8 | |||
2d9f6c7b2a | |||
7d6427ab64 | |||
4abbe0d57a | |||
a631ff689f | |||
e1d401adfe | |||
6f49c88382 | |||
374d07b995 | |||
3481252082 | |||
035f3b6aed | |||
923feadfa5 | |||
1ea66d6f23 | |||
3b7b4f85a1 | |||
9853353512 | |||
7b8585f3c3 | |||
fc3ce4cda8 | |||
a7f5c56ba1 | |||
c8747bd55a | |||
e2fd3948f5 | |||
e960d4d8a4 | |||
1ccf8d4dd4 | |||
b65ea8e0a9 | |||
90cb26c6d9 | |||
3562076b83 | |||
6230747b51 | |||
479179dd9b | |||
67f9dba77b | |||
89c345649d | |||
0550eef701 | |||
1c21198499 | |||
8ac232414d | |||
91e306f447 | |||
f01957edc7 | |||
e9f6ebb6d1 | |||
2fee3a424c | |||
43d5a72514 | |||
f938364d54 | |||
998dbdc6ff | |||
2b3dfaf023 | |||
f8a33a63ac | |||
af50422544 | |||
6e21c486e8 | |||
c6ee10cd50 | |||
6170319428 | |||
e373d285fe | |||
17c326e654 | |||
b0b1198d2e | |||
134ec63610 | |||
cc904d258b | |||
d187a29e55 | |||
996517f5c4 | |||
8fb1563f2d | |||
7b0ea5078c | |||
a04f7e9923 | |||
e356cd34e3 | |||
941eacd559 | |||
e06a09ed42 | |||
9fcc792b7e | |||
1841e63021 | |||
1e056cfd8a | |||
32db31e6c3 | |||
9c246d6621 | |||
9c52f5b19a | |||
0464de33b1 | |||
1ed6bb8a7c | |||
8f72920764 | |||
574d6dae7f | |||
cf2e9d4b91 | |||
7ab879a94f | |||
21da3c6482 | |||
5f836358c0 | |||
f407762259 | |||
dea20861a0 | |||
bc818f10c3 | |||
19f5031ef7 | |||
b71eb4fb89 | |||
c327c73087 | |||
4fe8741ea7 | |||
75916d4300 | |||
e65a6b6a38 | |||
86a83cadd3 | |||
00553c34ab | |||
ace9a59a45 | |||
09ebb517d9 | |||
1c697d30ee | |||
c2dd4d1d2e | |||
6866c9d418 | |||
819ee23565 | |||
02a37e207f | |||
7356af556a | |||
88288c3979 | |||
763b05e2e6 | |||
39351aed58 | |||
e8e7c22b95 | |||
ad975152c1 | |||
ed406734a7 | |||
89bae66257 | |||
16f5d9c284 | |||
00148d84d8 | |||
390cedf79f | |||
b686c79b49 | |||
2d77aa0d36 | |||
012102fe86 | |||
1a6b147107 | |||
2978b34b7b | |||
dee77e814a | |||
820082d7f2 | |||
525f213f1d | |||
58a81da039 | |||
0002295cdf | |||
c050739f41 | |||
ccd5b0272d | |||
f1fdf48834 | |||
bae875382c | |||
14ce66bcc1 | |||
644c561815 | |||
5f31f3a6b3 | |||
a0afe9dd0e | |||
9c29756a38 | |||
bf63b21d74 | |||
0ea0d1703e | |||
29b8a442c2 | |||
844f229b5a | |||
fa51b4bbbc | |||
1fa6e1eccc | |||
44b810ee0a | |||
a9998be176 | |||
5e200aebcc | |||
e0cd3efc64 | |||
77e3efde9a | |||
a173a82d59 | |||
4d2bc18c2f | |||
aca5fdb521 | |||
8867258e47 | |||
f6cb725268 | |||
1bd570ceb9 | |||
1c87298b44 | |||
3a23ec1bee | |||
d96a4d3337 | |||
94452cce88 | |||
2e754f2a11 | |||
719136937e | |||
e207552255 | |||
1835e49191 | |||
145c28bbd5 | |||
a58a3361b6 | |||
efba773635 | |||
4439229ad2 | |||
0dcb8baf64 | |||
921adcb3eb | |||
24465cf463 | |||
d0b0365f75 | |||
0f88598dc0 | |||
d7e80b3cc7 | |||
25bb95a66e | |||
6e115c19d5 | |||
5a18f551aa | |||
0426967bf7 | |||
9d893d8f0b | |||
8de648f0db | |||
50f8131d83 | |||
5a4f8bd522 | |||
f8e53d941d | |||
717a2039cb | |||
6e7c44fca7 | |||
ffbe20b586 | |||
9547e95e9d | |||
a1f31f4348 | |||
604e244395 | |||
fe22a67cf6 | |||
885d2afaa3 | |||
be4a32a59e | |||
c501d3bfbf | |||
0ef1483e11 | |||
bbaaf86e4d | |||
6a0e10f8ab | |||
5c0ca52291 | |||
bff13f6bfe | |||
6001b71f06 | |||
bd1e68a4c8 | |||
8589f8fc5f | |||
6641e1178b | |||
6e0f1e71b2 | |||
0e945b6457 | |||
19155a9132 | |||
305d613d40 | |||
95f2caacab | |||
8f61ee1d2f | |||
b02dbd4fe6 | |||
668f6671a9 | |||
f6387eb7e9 | |||
83a87b046f | |||
20c2ce3bac | |||
2956f9ed55 | |||
510d74f2c7 | |||
457ab28f74 | |||
1502f923ee | |||
f03a684eec | |||
45e17c50e7 | |||
6bf74379a7 | |||
01c6fd53fa | |||
f8306c0275 | |||
900ef9e18d | |||
a46186573c | |||
90f6c1bb04 | |||
41d946b339 | |||
b7385d5f25 | |||
3d22f6cd66 | |||
9730e3f5b3 | |||
29d6b22d63 | |||
f99e44e371 | |||
8be36d3d16 | |||
bc1742af48 | |||
e4080cc184 | |||
18de6ccb59 | |||
f00ea4cf5e | |||
c5539be814 | |||
f5d6a12d8c | |||
e4e18dfd4b | |||
30ee547ce4 | |||
f8ca6ad746 | |||
7a90d029e1 | |||
2900858171 | |||
0dee219e46 | |||
790613e708 | |||
0a35722595 | |||
f30fc376ee | |||
8c1a95833d | |||
4f1ba1be01 | |||
90acc00369 | |||
e4fe8a4440 | |||
fbc3251c3f | |||
a0f3f0f50e | |||
dad0d5488f | |||
77773fb052 | |||
1240ca6f21 | |||
ce3a6ad286 | |||
a20f420a55 | |||
03c4121ab7 | |||
8c2c877817 | |||
c77bb92da9 | |||
bd4bad0020 | |||
0b9889e313 | |||
f9fbaa2298 | |||
6f2d127c4f | |||
056a4d4a22 | |||
bab79331cb | |||
16bbc970ae | |||
0f1cff316c | |||
938a2bae13 | |||
3324835b72 | |||
1628ea86b2 | |||
be119248a6 | |||
ac75181f7f | |||
d9fe78171f | |||
5586646a60 | |||
e955e783f4 | |||
9162c4d723 | |||
f345a07bcd | |||
f5e3b4bbe7 | |||
941911ed30 | |||
599bd2d958 | |||
a847c7f608 | |||
d9be308c36 | |||
3cca4a30af | |||
c51db5bd4a | |||
7fce38b212 | |||
d0e9b111af | |||
add1b21503 | |||
39af110ac1 | |||
bf7ec424a7 | |||
6c7e42b541 | |||
542a9a3f13 | |||
264779a9d0 | |||
22dd4a67dd | |||
5c188664bd | |||
f6e23fe619 | |||
160f55ede5 | |||
7d7b153085 | |||
8f487a441b | |||
c8cee6a0dc | |||
167445ef8a | |||
95b72d839b | |||
9365186bed | |||
eea026f8e0 | |||
3cd7a3533e | |||
9e1f1152e3 | |||
60d2be9ff2 | |||
0f59894d66 | |||
74c07fc0eb | |||
67a8bf525d | |||
129b91518f | |||
c0aa763c3b | |||
319c60d4fa | |||
66f95d25f6 | |||
72ab72cea1 | |||
4e1e9f9c6e | |||
8b14d32879 | |||
7c5170dc16 | |||
a07dbc3aac | |||
7d3294ff78 | |||
121c393466 | |||
c6ec54c138 | |||
1f6b90d383 | |||
c45c2e27ba | |||
5832890dbb | |||
6f2e6d14b6 | |||
0d899694b2 | |||
7bd5e7365d | |||
a63e51e2ad | |||
1b8eee86a1 | |||
6d50278d34 | |||
35844842de | |||
843e772094 | |||
9d0518dfeb | |||
d33d399c31 | |||
970cf7f017 | |||
d125efcd60 | |||
4664427832 | |||
d84b9cc875 | |||
0c6b6bf5d5 | |||
d275995dfe | |||
b03ca30379 | |||
e5f23a49b4 | |||
e78100eaac | |||
ae9d8be4e4 | |||
e4f73a6d5c | |||
a31fd608cf | |||
a98d5aa2fb | |||
4c6ef841bb | |||
997f539a8c | |||
83f74faaf7 | |||
0bb5797377 | |||
c3097aa334 | |||
2cd0fcc9a7 | |||
5b653fb558 | |||
6a5b23f848 | |||
a480783ee8 | |||
bc0f5b5787 | |||
962eb0e376 | |||
ababe24b97 | |||
1bf7a2abd4 | |||
0ea4f94e8f | |||
6cc6130b6a | |||
8294903cd0 | |||
7b7379c3dd | |||
9acdf1e42f | |||
5dd95d27de | |||
1016b4c879 | |||
df6f571294 | |||
be05dd7ba1 | |||
bc22d888ee | |||
e6ae89ebf9 | |||
e7b23e1638 | |||
ce7a967f5f | |||
38446b5b2a | |||
48e1a8ed02 | |||
a059166b9c | |||
086a2b851d | |||
8e4c5fb24d | |||
6993893600 | |||
bfdf8babed | |||
4d31fb890d | |||
ef451fd8f7 | |||
656eb0abec | |||
a7896329f7 | |||
b9e11ac201 | |||
1aa27bd91c | |||
118ec28b04 | |||
449b43792b | |||
f1e95156ea | |||
45e5b25cda | |||
bdec611cf3 | |||
fa612d5f28 | |||
d270447777 | |||
1a59fc4f99 | |||
d38dcb9ba2 | |||
c7b348390e | |||
bf6c91932c | |||
716ed3acb3 | |||
65e08bea92 | |||
74859e99e7 | |||
aad583be2e | |||
3e4505e2e3 | |||
1fe1cfb397 | |||
2f721c84ed | |||
9112ff8c0a | |||
96e12b5aba | |||
bec3ba71cd | |||
c6766d2a73 | |||
befac6ad87 | |||
60bc38559b | |||
2a56155587 | |||
87c3673a71 | |||
21889162ff | |||
f1cccc22cd | |||
10c1f3a849 | |||
d168ef94e9 | |||
29f8b05f56 | |||
af482c30bd | |||
4e36e398ee | |||
b5f81b9384 | |||
879b471aed | |||
964d81dc0e | |||
443f7cd5fd | |||
2fc8cb5376 | |||
ee20a09e7e | |||
f4e801351c | |||
7329753211 | |||
7d46e7e271 | |||
0583eb07d5 | |||
73694563cf | |||
bb4ed59191 | |||
566143757f | |||
822f2ffc73 | |||
eb3ceba497 | |||
2c6d0621c9 | |||
d8e84cb5e3 | |||
0b1e79871f | |||
954fddf578 | |||
f94f748339 | |||
e2b7b22ca9 | |||
efc8c82d8b | |||
eac5abba79 | |||
1956c14b8a | |||
017fac7041 | |||
0bdc50c78f | |||
57d78b6094 | |||
db5ce7ba85 | |||
51c16d0048 | |||
6532b23f1c | |||
49304b9ecd | |||
358b34de4c | |||
9973e5fde3 | |||
36875e05fd | |||
42123383bb | |||
ef4c606ed1 | |||
1ebb73b935 | |||
b57d31c0e7 | |||
678ebbc310 | |||
cc2efd316c | |||
d1f811f91d | |||
7ca3afff9f | |||
71b9e40bd9 | |||
4f35197a96 | |||
40b0cf5fd3 | |||
355e6acf0d | |||
4ff38e7f44 | |||
1dcd3b84b7 | |||
2957216bd3 | |||
11160f0b40 | |||
4b2c745db5 | |||
bb983021b1 | |||
d27b8871bc | |||
1753047d87 | |||
fa16fcedff | |||
0677474097 | |||
0c4826cdd5 | |||
b6fe660b84 | |||
c53fa421ad | |||
736533a482 | |||
a15565682d | |||
58861cd24a | |||
c0cdcb1b98 | |||
41f45afb3c | |||
e4edffa569 | |||
c28bad267a | |||
81f92bc7f9 | |||
58dc3382eb | |||
f7f7d9fa2c | |||
8c3408fda3 | |||
7c9f1248d4 | |||
89dd4fb039 | |||
fdeb2b3f49 | |||
65c455ae7c | |||
c3e12e5ff7 | |||
4dce1612c1 | |||
1b98897120 | |||
3b2abe5814 | |||
dddcd5ff46 | |||
cfbb03765e | |||
0d0dd1019b | |||
de2b1b3bea | |||
3464f93a30 | |||
f6936f55d6 | |||
eef1a28ebb | |||
5aed80e930 | |||
5654e9daaa | |||
d443576c7c | |||
e00317f316 | |||
c2f1ff67f2 | |||
869126e436 | |||
e8feb0309b | |||
06b35b76ff | |||
89d1f7f3d3 | |||
66b9b501ac | |||
9248b2e42d | |||
054bb5b500 | |||
12b546ea24 | |||
bc6c40c1e8 | |||
1d550da40b | |||
9da8574103 | |||
2c6404f671 | |||
09c6f51141 | |||
755c7df59c | |||
73b38cd9e2 | |||
227cb70d72 | |||
b36e416ab2 | |||
612d03bf73 | |||
c8ec35cd4a | |||
83ca08b26c | |||
ce98218bf0 | |||
2d43399703 | |||
461a2c3ab2 | |||
79be72c5f0 | |||
9ddb4e629f | |||
25e8e7081b | |||
c5164cbee3 | |||
809b333248 | |||
a933646667 | |||
98a68f5cd9 | |||
33dc254e43 | |||
b54295f2f7 | |||
a7e09a89ef | |||
4b6166dc4f | |||
e7d00f148b | |||
d19a7df7e8 | |||
45fae52afc | |||
270f173aad | |||
ddcff1ba63 | |||
cb1b08d6b6 | |||
533fa749b2 | |||
af492d2cb6 | |||
26fba71abf | |||
859bfc7b28 | |||
3b1d1307c4 | |||
f5a2c84ce2 | |||
cccb71fd30 | |||
44be072d04 | |||
86beb6ebf1 | |||
6d72104faa | |||
f2c5661710 | |||
ecb2359bc5 | |||
6e5058bbdc | |||
988a068d6d | |||
0688ce7fe9 | |||
f9e09893e7 | |||
dd1534a61d | |||
e17c6e272c | |||
cb0470a31d | |||
ff6186f4f0 | |||
4dd669bd46 | |||
09131722e3 | |||
87ab8fe78d | |||
bc928a34ef | |||
dca78acdf2 | |||
40f4450995 | |||
178d943423 | |||
e78788482e | |||
e50e9a00d4 | |||
dc82b4c8ea | |||
a8b0e1a771 | |||
75a975b1e1 | |||
3f02bb2065 | |||
9c986d3aa8 | |||
4741d9592b | |||
e9806b83d7 | |||
0229105158 | |||
9e37e13b6b | |||
58e0c0e916 | |||
dd99c27d56 | |||
3cff26b987 | |||
78ac5b0a11 | |||
24d0b14668 | |||
6fb32eeff2 | |||
ec64daa01f | |||
e8886bb358 | |||
05a6313d97 | |||
80f78e1c61 | |||
c441a3ab1c | |||
e894242768 | |||
d8dff03746 | |||
60aee7ddba | |||
6c09da24a4 | |||
b61cd3123f | |||
865bf8ae7a | |||
f8e53c6577 | |||
f31c2c6f81 | |||
e5c05e1980 | |||
6d0da100e5 | |||
b8a0ad7144 | |||
724e65ac97 | |||
b5028f7aa8 | |||
df6b4f4c37 | |||
41eb64925b | |||
fc076173ff | |||
98822869f7 | |||
df0510c199 | |||
fda65bcbd7 | |||
c37e564b59 | |||
d6ad4b6e66 | |||
546b4ea3b8 | |||
310932dc5a | |||
51459bb413 | |||
e00dae11ba | |||
831c7f764a | |||
ec4ad268f7 | |||
be640ea0bd | |||
f8ceab2233 | |||
aea82e004a | |||
bc3a0e3896 | |||
be69039d40 | |||
2c6d69497c | |||
18db3783af | |||
b536040feb | |||
dd45cd4ef9 | |||
25cc5581be | |||
f7c192b64b | |||
faae169154 | |||
c74b9ba940 | |||
6cce3cda36 | |||
5d25f4a0e5 | |||
79d37d360a | |||
69553fded7 | |||
200a9af61f | |||
2696ddb996 | |||
4e1b0daacb | |||
8aa46099a8 | |||
00ff6371ed | |||
b947dad6e9 | |||
c13bdbb749 | |||
e500fad0e1 | |||
bcac4d3798 | |||
63897bd60e | |||
d429e868ac | |||
faa51ddc18 | |||
c28eb360c0 | |||
69cac17543 | |||
50c7356b6a | |||
37715d9fa8 | |||
e8af61e11f | |||
de85c31e71 | |||
725c56ea6f | |||
1b958ee29f | |||
4b0f67e604 | |||
8ba1a5cd4d | |||
df278c7e6a | |||
6e57a80c13 | |||
efe6565857 | |||
fa0a34585b | |||
dec74f633b | |||
dfcea282ec | |||
191dcf8bb0 | |||
cb1bbe4660 | |||
ff66cb1deb | |||
ab46349d63 | |||
cffad78bf7 | |||
bfb81877d3 | |||
c56398db83 | |||
36e0d35968 | |||
62bf7d8715 | |||
a4db302174 | |||
66f3500ca9 | |||
c3bdc6f106 | |||
0a2bf4b55f | |||
bbae9b6363 | |||
180d52280d | |||
dce1dca7c7 | |||
343f6572a2 | |||
c8e58d49e0 | |||
c18546fb2f | |||
466c23a9d8 | |||
8403025c77 | |||
9ce591a1a1 | |||
f238f3882b | |||
a91208eb1c | |||
b92b0a9afe | |||
964347f43a | |||
3811c88b5c | |||
69a1473197 | |||
1f1e996cfa | |||
58167deda7 | |||
83d22a4f5f | |||
7003b19a70 | |||
687ef1429d | |||
b1b00a9a22 | |||
a0924bcfa3 | |||
5ce22e2de8 | |||
850c5c62d1 | |||
b31786c9ab | |||
936549d60f | |||
0babbcff49 | |||
02c2e80b31 | |||
da236d9a3e | |||
1104d908c0 | |||
2efea3ec06 | |||
775007ef0d | |||
f490e7d6fe | |||
89bc93e4cd | |||
12edb6375d | |||
8d9bba02d6 | |||
56e100fad7 | |||
38f7a4089e | |||
91f5465e2d | |||
58a9c60d0b | |||
725c4d95f8 | |||
615b7feabb | |||
5743b9ced0 | |||
8896d06028 | |||
1f217ef50b | |||
5ef5c6280c | |||
aac95e1e2e | |||
18f4a1303c | |||
ded97eda61 | |||
f6b06520ee | |||
dcfcdc98ce | |||
9ab3325580 | |||
cb5ad3ab27 | |||
1e539cc134 | |||
4297dc43ae | |||
935b4ee7f5 | |||
2523242bb1 | |||
309e4fadf0 | |||
842054de09 | |||
af146284b6 | |||
5ac40e6849 | |||
d3e0625e8a | |||
484da28374 | |||
fa9e6ccea9 | |||
77fbb68419 | |||
253a7910b0 | |||
88c6be810f | |||
2860926571 | |||
fb81c02877 | |||
d78648f0f8 | |||
fe31769be5 | |||
388371b05d | |||
9db69007e5 | |||
f2a6492ab7 | |||
3ddce116e5 | |||
57f7d022ca |
@ -1,3 +1,4 @@
|
||||
[codespell]
|
||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser
|
||||
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,tsconfig.tsbuildinfo
|
||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM
|
||||
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/**/*.md,./e2e/playwright/lib/console-error-whitelist.ts,.package-lock.json,**/package-lock.json,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo,./src/lib/machine-api.d.ts,./test-results,./playwright-report,./kcl-book/book
|
||||
|
||||
|
@ -1,10 +1,19 @@
|
||||
# DO NOT commit secrets, overrides go in the ignored `.env.development.local`
|
||||
|
||||
NODE_ENV=development
|
||||
DEV=true
|
||||
|
||||
VITE_KC_API_WS_MODELING_URL=wss://api.dev.zoo.dev/ws/modeling/commands
|
||||
VITE_KC_API_BASE_URL=https://api.dev.zoo.dev
|
||||
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
||||
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
|
||||
VITE_KC_SKIP_AUTH=false
|
||||
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
||||
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
|
||||
#VITE_KC_DEV_TOKEN="your token from dev.zoo.dev should go in .env.development.local"
|
||||
#VITE_KC_DEV_TOKEN="optional token to skip auth in the app"
|
||||
#token="required token for playwright. TODO: clean up env vars in #3973"
|
||||
|
||||
RUST_BACKTRACE=1
|
||||
PYO3_PYTHON=/usr/local/bin/python3
|
||||
#KITTYCAD_API_TOKEN="required token for engine testing"
|
||||
|
||||
FAIL_ON_CONSOLE_ERRORS=true
|
||||
|
12
.envrc
12
.envrc
@ -1 +1,13 @@
|
||||
# Load optional shared environment variables
|
||||
source_up_if_exists
|
||||
|
||||
# Load default development environment variables
|
||||
dotenv .env.development
|
||||
|
||||
# Load optional environment variables overrides
|
||||
dotenv_if_exists .env.development.local
|
||||
|
||||
# Load optional testing environment variables
|
||||
dotenv_if_exists e2e/playwright/playwright-secrets.env
|
||||
|
||||
use flake .
|
||||
|
@ -1,3 +1,6 @@
|
||||
src/wasm-lib/*
|
||||
rust/**/*.ts
|
||||
!rust/kcl-language-server/client/src/**/*.ts
|
||||
*.typegen.ts
|
||||
packages/codemirror-lsp-client/dist/*
|
||||
e2e/playwright/snapshots/prompt-to-edit/*
|
||||
.vscode-test
|
||||
|
70
.eslintrc
70
.eslintrc
@ -1,70 +0,0 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"css-modules",
|
||||
"jest",
|
||||
"jsx-a11y",
|
||||
"react",
|
||||
"react-hooks",
|
||||
"suggest-no-throw",
|
||||
"testing-library",
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:css-modules/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/no-misused-promises": "error",
|
||||
"jsx-a11y/click-events-have-key-events": "off",
|
||||
"jsx-a11y/no-autofocus": "off",
|
||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||
"no-restricted-globals": [
|
||||
"error",
|
||||
{
|
||||
"name": "isNaN",
|
||||
"message": "Use Number.isNaN() instead."
|
||||
},
|
||||
],
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
"selector": "CallExpression[callee.object.name='Array'][callee.property.name='isArray']",
|
||||
"message": "Use isArray() in lib/utils.ts instead of Array.isArray()."
|
||||
}
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"never"
|
||||
],
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"suggest-no-throw/suggest-no-throw": "warn",
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
||||
"extends": [
|
||||
"plugin:testing-library/react"
|
||||
],
|
||||
"rules": {
|
||||
"suggest-no-throw/suggest-no-throw": "off",
|
||||
"testing-library/prefer-screen-queries": "off",
|
||||
"jest/valid-expect": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/**/*.test.ts"],
|
||||
"extends": [
|
||||
"plugin:testing-library/react"
|
||||
],
|
||||
"rules": {
|
||||
"suggest-no-throw/suggest-no-throw": "off",
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
141
.eslintrc.json
Normal file
141
.eslintrc.json
Normal file
@ -0,0 +1,141 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"plugins": [
|
||||
"react-perf",
|
||||
"css-modules",
|
||||
"jest",
|
||||
"jsx-a11y",
|
||||
"react",
|
||||
"react-hooks",
|
||||
"suggest-no-throw",
|
||||
"testing-library",
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"extends": [
|
||||
"plugin:css-modules/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||
"@typescript-eslint/no-array-constructor": "error",
|
||||
"@typescript-eslint/no-array-delete": "error",
|
||||
"@typescript-eslint/no-duplicate-enum-values": "error",
|
||||
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
||||
"@typescript-eslint/no-empty-object-type": "error",
|
||||
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
||||
"@typescript-eslint/no-floating-promises": "error",
|
||||
"@typescript-eslint/no-for-in-array": "error",
|
||||
"no-implied-eval": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||
"@typescript-eslint/no-implied-eval": "error",
|
||||
"@typescript-eslint/no-misused-new": "error",
|
||||
"@typescript-eslint/no-misused-promises": "error",
|
||||
"@typescript-eslint/no-namespace": "error",
|
||||
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
||||
"@typescript-eslint/no-redundant-type-constituents": "error",
|
||||
"@typescript-eslint/no-this-alias": "warn",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
||||
"no-unused-vars": "off", // This is wrong; use the @typescript-eslint one instead.
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"varsIgnorePattern": "^_",
|
||||
"argsIgnorePattern": "^_",
|
||||
"ignoreRestSiblings": true,
|
||||
"vars": "all",
|
||||
"args": "none"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
||||
"@typescript-eslint/no-wrapper-object-types": "error",
|
||||
"no-throw-literal": "off", // Use @typescript-eslint/only-throw-error instead.
|
||||
"@typescript-eslint/only-throw-error": "error",
|
||||
"@typescript-eslint/prefer-as-const": "warn",
|
||||
"@typescript-eslint/prefer-namespace-keyword": "error",
|
||||
"@typescript-eslint/consistent-type-imports": "error",
|
||||
"@typescript-eslint/restrict-plus-operands": "error",
|
||||
"jsx-a11y/click-events-have-key-events": "off",
|
||||
"jsx-a11y/no-autofocus": "off",
|
||||
"jsx-a11y/no-noninteractive-element-interactions": "off",
|
||||
"react/no-unknown-property": "error",
|
||||
"no-restricted-globals": [
|
||||
"error",
|
||||
{
|
||||
"name": "isNaN",
|
||||
"message": "Use Number.isNaN() instead."
|
||||
}
|
||||
],
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
"selector": "CallExpression[callee.object.name='Array'][callee.property.name='isArray']",
|
||||
"message": "Use isArray() in lib/utils.ts instead of Array.isArray()."
|
||||
},
|
||||
{
|
||||
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='stringify']",
|
||||
"message": "Do not use TOML.stringify directly. Use the wrappers in test-utils instead like settingsToToml."
|
||||
},
|
||||
{
|
||||
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='parse']",
|
||||
"message": "Do not use TOML.parse directly. Use the wrappers in test-utils instead like tomlToSettings."
|
||||
},
|
||||
{
|
||||
"selector": "CallExpression[callee.property.name='split'] > Literal[value='/']",
|
||||
"message": "Avoid using split with '/'."
|
||||
},
|
||||
{
|
||||
"selector": "CallExpression[callee.property.name='join'] > Literal[value='/']",
|
||||
"message": "Avoid using join with '/'."
|
||||
}
|
||||
],
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"patterns": [
|
||||
// Restrict all relative imports except for .css files.
|
||||
{
|
||||
"group": ["./*", "../*", "!./*.css", "!../*.css"],
|
||||
"message": "Use absolute imports instead."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"semi": ["error", "never"],
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"suggest-no-throw/suggest-no-throw": "error"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["e2e/**/*.ts"], // Update the pattern based on your file structure
|
||||
"extends": ["plugin:testing-library/react"],
|
||||
"rules": {
|
||||
"suggest-no-throw/suggest-no-throw": "off",
|
||||
"testing-library/prefer-screen-queries": "off",
|
||||
"jest/valid-expect": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["src/**/*.test.ts"],
|
||||
"extends": ["plugin:testing-library/react"],
|
||||
"rules": {
|
||||
"suggest-no-throw/suggest-no-throw": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["packages/**/*.ts", "rust/**/*.ts"],
|
||||
"extends": [],
|
||||
"rules": {
|
||||
"no-restricted-imports": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,5 +1,5 @@
|
||||
name: Bug Report
|
||||
description: File a bug report for the Zoo Modeling App
|
||||
description: File a bug report for the Zoo Design Studio
|
||||
title: "[BUG]: "
|
||||
labels: ["bug"]
|
||||
assignees: []
|
||||
@ -70,7 +70,7 @@ body:
|
||||
id: version
|
||||
attributes:
|
||||
label: Version
|
||||
description: "The version of the Zoo Modeling App you're using."
|
||||
description: "The version of the Zoo Design Studio you're using."
|
||||
placeholder: "example: v0.15.0. You can find this in the settings."
|
||||
validations:
|
||||
required: true
|
||||
|
8
.github/actions/github-release/Dockerfile
vendored
Normal file
8
.github/actions/github-release/Dockerfile
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
FROM node:slim
|
||||
|
||||
COPY . /action
|
||||
WORKDIR /action
|
||||
|
||||
RUN npm install --production
|
||||
|
||||
ENTRYPOINT ["node", "/action/main.js"]
|
21
.github/actions/github-release/README.md
vendored
Normal file
21
.github/actions/github-release/README.md
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# github-release
|
||||
|
||||
Copy-pasted from
|
||||
https://github.com/bytecodealliance/wasmtime/tree/8acfdbdd8aa550d1b84e0ce1e6222a6605d14e38/.github/actions/github-release
|
||||
|
||||
An action used to publish GitHub releases for `wasmtime`.
|
||||
|
||||
As of the time of this writing there's a few actions floating around which
|
||||
perform github releases but they all tend to have their set of drawbacks.
|
||||
Additionally nothing handles deleting releases which we need for our rolling
|
||||
`dev` release.
|
||||
|
||||
To handle all this, this action rolls its own implementation using the
|
||||
actions/toolkit repository and packages published there. These run in a Docker
|
||||
container and take various inputs to orchestrate the release from the build.
|
||||
|
||||
More comments can be found in `main.js`.
|
||||
|
||||
Testing this is really hard. If you want to try though run `npm install` and
|
||||
then `node main.js`. You'll have to configure a bunch of env vars though to get
|
||||
anything reasonably working.
|
15
.github/actions/github-release/action.yml
vendored
Normal file
15
.github/actions/github-release/action.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
name: "wasmtime github releases"
|
||||
description: "wasmtime github releases"
|
||||
inputs:
|
||||
token:
|
||||
description: ""
|
||||
required: true
|
||||
name:
|
||||
description: ""
|
||||
required: true
|
||||
files:
|
||||
description: ""
|
||||
required: true
|
||||
runs:
|
||||
using: "docker"
|
||||
image: "Dockerfile"
|
143
.github/actions/github-release/main.js
vendored
Normal file
143
.github/actions/github-release/main.js
vendored
Normal file
@ -0,0 +1,143 @@
|
||||
const core = require("@actions/core");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const github = require("@actions/github");
|
||||
const glob = require("glob");
|
||||
|
||||
function sleep(milliseconds) {
|
||||
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
||||
}
|
||||
|
||||
async function runOnce() {
|
||||
// Load all our inputs and env vars. Note that `getInput` reads from `INPUT_*`
|
||||
const files = core.getInput("files");
|
||||
const name = core.getInput("name");
|
||||
const token = core.getInput("token");
|
||||
const slug = process.env.GITHUB_REPOSITORY;
|
||||
const owner = slug.split("/")[0];
|
||||
const repo = slug.split("/")[1];
|
||||
const sha = process.env.HEAD_SHA;
|
||||
|
||||
core.info(`files: ${files}`);
|
||||
core.info(`name: ${name}`);
|
||||
|
||||
const options = {
|
||||
request: {
|
||||
timeout: 30000,
|
||||
},
|
||||
};
|
||||
const octokit = github.getOctokit(token, options);
|
||||
|
||||
// Delete the previous release since we can't overwrite one. This may happen
|
||||
// due to retrying an upload or it may happen because we're doing the dev
|
||||
// release.
|
||||
const releases = await octokit.paginate("GET /repos/:owner/:repo/releases", { owner, repo });
|
||||
for (const release of releases) {
|
||||
if (release.tag_name !== name) {
|
||||
continue;
|
||||
}
|
||||
const release_id = release.id;
|
||||
core.info(`deleting release ${release_id}`);
|
||||
await octokit.rest.repos.deleteRelease({ owner, repo, release_id });
|
||||
}
|
||||
|
||||
// We also need to update the `dev` tag while we're at it on the `dev` branch.
|
||||
if (name == "nightly") {
|
||||
try {
|
||||
core.info(`updating nightly tag`);
|
||||
await octokit.rest.git.updateRef({
|
||||
owner,
|
||||
repo,
|
||||
ref: "tags/nightly",
|
||||
sha,
|
||||
force: true,
|
||||
});
|
||||
} catch (e) {
|
||||
core.error(e);
|
||||
core.info(`creating nightly tag`);
|
||||
await octokit.rest.git.createTag({
|
||||
owner,
|
||||
repo,
|
||||
tag: "nightly",
|
||||
message: "nightly release",
|
||||
object: sha,
|
||||
type: "commit",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Creates an official GitHub release for this `tag`, and if this is `dev`
|
||||
// then we know that from the previous block this should be a fresh release.
|
||||
core.info(`creating a release`);
|
||||
const release = await octokit.rest.repos.createRelease({
|
||||
owner,
|
||||
repo,
|
||||
name,
|
||||
tag_name: name,
|
||||
target_commitish: sha,
|
||||
prerelease: name === "nightly",
|
||||
});
|
||||
const release_id = release.data.id;
|
||||
|
||||
// Upload all the relevant assets for this release as just general blobs.
|
||||
for (const file of glob.sync(files)) {
|
||||
const size = fs.statSync(file).size;
|
||||
const name = path.basename(file);
|
||||
|
||||
await runWithRetry(async function () {
|
||||
// We can't overwrite assets, so remove existing ones from a previous try.
|
||||
let assets = await octokit.rest.repos.listReleaseAssets({
|
||||
owner,
|
||||
repo,
|
||||
release_id,
|
||||
});
|
||||
for (const asset of assets.data) {
|
||||
if (asset.name === name) {
|
||||
core.info(`delete asset ${name}`);
|
||||
const asset_id = asset.id;
|
||||
await octokit.rest.repos.deleteReleaseAsset({ owner, repo, asset_id });
|
||||
}
|
||||
}
|
||||
|
||||
core.info(`upload ${file}`);
|
||||
const headers = { "content-length": size, "content-type": "application/octet-stream" };
|
||||
const data = fs.createReadStream(file);
|
||||
await octokit.rest.repos.uploadReleaseAsset({
|
||||
data,
|
||||
headers,
|
||||
name,
|
||||
url: release.data.upload_url,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function runWithRetry(f) {
|
||||
const retries = 10;
|
||||
const maxDelay = 4000;
|
||||
let delay = 1000;
|
||||
|
||||
for (let i = 0; i < retries; i++) {
|
||||
try {
|
||||
await f();
|
||||
break;
|
||||
} catch (e) {
|
||||
if (i === retries - 1) throw e;
|
||||
|
||||
core.error(e);
|
||||
const currentDelay = Math.round(Math.random() * delay);
|
||||
core.info(`sleeping ${currentDelay} ms`);
|
||||
await sleep(currentDelay);
|
||||
delay = Math.min(delay * 2, maxDelay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
await runWithRetry(runOnce);
|
||||
}
|
||||
|
||||
run().catch((err) => {
|
||||
core.error(err);
|
||||
core.setFailed(err.message);
|
||||
});
|
10
.github/actions/github-release/package.json
vendored
Normal file
10
.github/actions/github-release/package.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "wasmtime-github-release",
|
||||
"version": "0.0.0",
|
||||
"main": "main.js",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6",
|
||||
"@actions/github": "^6.0",
|
||||
"glob": "^11.0.1"
|
||||
}
|
||||
}
|
53
.github/ci-cd-scripts/playwright-electron.sh
vendored
53
.github/ci-cd-scripts/playwright-electron.sh
vendored
@ -4,44 +4,44 @@
|
||||
set -euo pipefail
|
||||
|
||||
if [[ ! -f "test-results/.last-run.json" ]]; then
|
||||
# if no last run artifact, than run plawright normally
|
||||
# If no last run artifact, than run Playwright normally
|
||||
echo "run playwright normally"
|
||||
if [[ "$3" == *ubuntu* ]]; then
|
||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --shard=$1/$2 || true
|
||||
elif [[ "$3" == *windows* ]]; then
|
||||
yarn test:playwright:electron:windows -- --shard=$1/$2 || true
|
||||
elif [[ "$3" == *macos* ]]; then
|
||||
yarn test:playwright:electron:macos -- --shard=$1/$2 || true
|
||||
else
|
||||
echo "Do not run playwright. Unable to detect os runtime."
|
||||
exit 1
|
||||
fi
|
||||
# # send to axiom
|
||||
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
|
||||
if [[ "$3" == *ubuntu* ]]; then
|
||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --shard=$1/$2 || true
|
||||
elif [[ "$3" == *windows* ]]; then
|
||||
npm run test:playwright:electron -- --grep=@windows --shard=$1/$2 || true
|
||||
elif [[ "$3" == *macos* ]]; then
|
||||
npm run test:playwright:electron -- --grep=@macos --shard=$1/$2 || true
|
||||
else
|
||||
echo "Do not run Playwright. Unable to detect os runtime."
|
||||
exit 1
|
||||
fi
|
||||
# Log failures for Axiom to pick up
|
||||
node playwrightProcess.mjs > /tmp/github-actions.log
|
||||
fi
|
||||
|
||||
retry=1
|
||||
max_retrys=5
|
||||
max_retries=1
|
||||
|
||||
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
|
||||
while [[ $retry -le $max_retrys ]]; do
|
||||
# Retry failed tests, doing our own retries because using inbuilt Playwright retries causes connection issues
|
||||
while [[ $retry -le $max_retries ]]; do
|
||||
if [[ -f "test-results/.last-run.json" ]]; then
|
||||
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
|
||||
if [[ $failed_tests -gt 0 ]]; then
|
||||
status=$(jq -r '.status' test-results/.last-run.json)
|
||||
if [[ "$status" == "failed" ]]; then
|
||||
echo "retried=true" >>$GITHUB_OUTPUT
|
||||
echo "run playwright with last failed tests and retry $retry"
|
||||
if [[ "$3" == *ubuntu* ]]; then
|
||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --last-failed || true
|
||||
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --last-failed || true
|
||||
elif [[ "$3" == *windows* ]]; then
|
||||
yarn test:playwright:electron:windows -- --last-failed || true
|
||||
npm run test:playwright:electron -- --grep=@windows --last-failed || true
|
||||
elif [[ "$3" == *macos* ]]; then
|
||||
yarn test:playwright:electron:macos -- --last-failed || true
|
||||
npm run test:playwright:electron -- --grep=@macos --last-failed || true
|
||||
else
|
||||
echo "Do not run playwright. Unable to detect os runtime."
|
||||
exit 1
|
||||
fi
|
||||
# send to axiom
|
||||
node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
|
||||
# Log failures for Axiom to pick up
|
||||
node playwrightProcess.mjs > /tmp/github-actions.log
|
||||
retry=$((retry + 1))
|
||||
else
|
||||
echo "retried=false" >>$GITHUB_OUTPUT
|
||||
@ -56,10 +56,11 @@ done
|
||||
echo "retried=false" >>$GITHUB_OUTPUT
|
||||
|
||||
if [[ -f "test-results/.last-run.json" ]]; then
|
||||
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
|
||||
if [[ $failed_tests -gt 0 ]]; then
|
||||
# if it still fails after 3 retrys, then fail the job
|
||||
status=$(jq -r '.status' test-results/.last-run.json)
|
||||
if [[ "$status" == "failed" ]]; then
|
||||
# If it still fails after retries, then fail the job
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
24
.github/ci-cd-scripts/start-vector-macos.sh
vendored
Executable file
24
.github/ci-cd-scripts/start-vector-macos.sh
vendored
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Install vector
|
||||
brew tap vectordotdev/brew && brew install vector
|
||||
|
||||
# Configure vector
|
||||
mkdir -p /tmp/vector
|
||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
||||
sed -i '' "s#OS_NAME#${OS_NAME}#g" /tmp/vector.toml
|
||||
sed -i '' "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
||||
sed -i '' "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
||||
sed -i '' "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
||||
sed -i '' "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
||||
sed -i '' "s#GH_ACTIONS_AXIOM_TOKEN#${GH_ACTIONS_AXIOM_TOKEN}#g" /tmp/vector.toml
|
||||
|
||||
# Display settings
|
||||
echo
|
||||
echo 'Vector config:'
|
||||
cat /tmp/vector.toml
|
||||
echo
|
||||
|
||||
# Start in the background
|
||||
$(brew --prefix)/opt/vector/bin/vector --config /tmp/vector.toml &
|
24
.github/ci-cd-scripts/start-vector-ubuntu.sh
vendored
Executable file
24
.github/ci-cd-scripts/start-vector-ubuntu.sh
vendored
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Install vector
|
||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev | bash -s -- -y
|
||||
|
||||
# Configure vector
|
||||
mkdir -p /tmp/vector
|
||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
||||
sed -i "s#OS_NAME#${OS_NAME}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${GH_ACTIONS_AXIOM_TOKEN}#g" /tmp/vector.toml
|
||||
|
||||
# Display settings
|
||||
echo
|
||||
echo 'Vector config:'
|
||||
cat /tmp/vector.toml
|
||||
echo
|
||||
|
||||
# Start in background
|
||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
43
.github/ci-cd-scripts/upload-results.sh
vendored
Executable file
43
.github/ci-cd-scripts/upload-results.sh
vendored
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ -z "${TAB_API_URL:-}" ] || [ -z "${TAB_API_KEY:-}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
project="https://github.com/KittyCAD/modeling-app"
|
||||
suite="${CI_SUITE:-unit}"
|
||||
branch="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-}}"
|
||||
commit="${CI_COMMIT_SHA:-${GITHUB_SHA:-}}"
|
||||
|
||||
echo "Uploading batch results"
|
||||
curl --silent --request POST \
|
||||
--header "X-API-Key: ${TAB_API_KEY}" \
|
||||
--form "project=${project}" \
|
||||
--form "suite=${suite}" \
|
||||
--form "branch=${branch}" \
|
||||
--form "commit=${commit}" \
|
||||
--form "tests=@test-results/junit.xml" \
|
||||
--form "CI_COMMIT_SHA=${CI_COMMIT_SHA:-}" \
|
||||
--form "CI_PR_NUMBER=${CI_PR_NUMBER:-}" \
|
||||
--form "GITHUB_BASE_REF=${GITHUB_BASE_REF:-}" \
|
||||
--form "GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME:-}" \
|
||||
--form "GITHUB_HEAD_REF=${GITHUB_HEAD_REF:-}" \
|
||||
--form "GITHUB_REF_NAME=${GITHUB_REF_NAME:-}" \
|
||||
--form "GITHUB_REF=${GITHUB_REF:-}" \
|
||||
--form "GITHUB_SHA=${GITHUB_SHA:-}" \
|
||||
--form "GITHUB_WORKFLOW=${GITHUB_WORKFLOW:-}" \
|
||||
--form "RUNNER_ARCH=${RUNNER_ARCH:-}" \
|
||||
${TAB_API_URL}/api/results/bulk
|
||||
|
||||
echo
|
||||
echo "Sharing updated report"
|
||||
curl --silent --request POST \
|
||||
--header "Content-Type: application/json" \
|
||||
--header "X-API-Key: ${TAB_API_KEY}" \
|
||||
--data "{
|
||||
\"project\": \"${project}\",
|
||||
\"branch\": \"${branch}\",
|
||||
\"commit\": \"${commit}\"
|
||||
}" \
|
||||
${TAB_API_URL}/api/share
|
756
.github/dependabot.yml
vendored
756
.github/dependabot.yml
vendored
@ -1,41 +1,721 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
# DO NOT EDIT THIS FILE. This dependabot file was generated
|
||||
# by https://github.com/KittyCAD/ciso Changes to this file should be addressed in
|
||||
# the ciso repository.
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'npm' # See documentation for possible values
|
||||
directories:
|
||||
- '/'
|
||||
- '/packages/codemirror-lang-kcl/'
|
||||
- '/packages/codemirror-lsp-client/'
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
reviewers:
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- package-ecosystem: 'github-actions' # See documentation for possible values
|
||||
directory: '/' # Location of package manifests
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- jessfraz
|
||||
- package-ecosystem: 'cargo' # See documentation for possible values
|
||||
directory: '/src/wasm-lib/' # Location of package manifests
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- jessfraz
|
||||
groups:
|
||||
serde-dependencies:
|
||||
patterns:
|
||||
- "serde*"
|
||||
wasm-bindgen-deps:
|
||||
patterns:
|
||||
- "wasm-bindgen*"
|
||||
- package-ecosystem: github-actions
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-python-bindings
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-to-core
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-language-server-release
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-wasm-lib
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-derive-docs
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-bumper
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-language-server
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-lib
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-lib/fuzz
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-test-server
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: cargo
|
||||
directory: /rust/kcl-directory-test-macro
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: npm
|
||||
directory: /
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: npm
|
||||
directory: /rust/kcl-language-server
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: npm
|
||||
directory: /packages/codemirror-lang-kcl
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: npm
|
||||
directory: /packages/codemirror-lsp-client
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: npm
|
||||
directory: /.github/actions/github-release
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: pip
|
||||
directory: /rust/kcl-python-bindings
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
- package-ecosystem: docker
|
||||
directory: /.github/actions/github-release
|
||||
schedule:
|
||||
interval: weekly
|
||||
day: monday
|
||||
time: '03:00'
|
||||
timezone: America/Los_Angeles
|
||||
open-pull-requests-limit: 5
|
||||
reviewers:
|
||||
- adamchalmers
|
||||
- franknoirot
|
||||
- irev-dev
|
||||
- jessfraz
|
||||
groups:
|
||||
security:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
security-major:
|
||||
applies-to: security-updates
|
||||
update-types:
|
||||
- major
|
||||
patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- patch
|
||||
major:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- major
|
||||
minor:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- minor
|
||||
- patch
|
||||
|
25
.github/workflows/build-and-store-wasm.yml
vendored
25
.github/workflows/build-and-store-wasm.yml
vendored
@ -13,21 +13,30 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
cache: 'npm'
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache wasm
|
||||
run: npm install
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './src/wasm-lib'
|
||||
workspaces: rust
|
||||
- name: build wasm
|
||||
run: yarn build:wasm
|
||||
run: npm run build:wasm
|
||||
|
||||
|
||||
# Upload the WASM bundle as an artifact
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wasm-bundle
|
||||
path: src/wasm-lib/pkg
|
||||
path: rust/kcl-wasm-lib/pkg
|
||||
|
214
.github/workflows/build-apps.yml
vendored
214
.github/workflows/build-apps.yml
vendored
@ -7,17 +7,13 @@ on:
|
||||
- main
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
schedule:
|
||||
- cron: '0 4 * * *'
|
||||
# Daily at 04:00 AM UTC
|
||||
# Will checkout the last commit from the default branch (main as of 2023-10-04)
|
||||
|
||||
env:
|
||||
IS_RELEASE: ${{ github.ref_type == 'tag' }}
|
||||
IS_NIGHTLY: ${{ github.event_name == 'schedule' }}
|
||||
IS_RELEASE: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
||||
IS_NIGHTLY: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@ -32,30 +28,83 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
cache: 'npm'
|
||||
|
||||
- run: yarn install
|
||||
- run: npm install
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- id: filter
|
||||
name: Check for Rust changes
|
||||
uses: dorny/paths-filter@v3
|
||||
with:
|
||||
workspaces: './src/wasm-lib'
|
||||
filters: |
|
||||
rust:
|
||||
- 'rust/**'
|
||||
|
||||
- name: Download Wasm Cache
|
||||
id: download-wasm
|
||||
if: ${{ github.event_name == 'pull_request' && steps.filter.outputs.rust == 'false' }}
|
||||
uses: dawidd6/action-download-artifact@v7
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
name: wasm-bundle
|
||||
workflow: build-and-store-wasm.yml
|
||||
branch: main
|
||||
path: rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Build WASM condition
|
||||
id: wasm
|
||||
run: |
|
||||
set -euox pipefail
|
||||
# Build wasm if this is a push to main or tag, there are Rust changes, or
|
||||
# downloading from the wasm cache failed.
|
||||
if [[ ${{github.event_name}} == 'push' || ${{steps.filter.outputs.rust}} == 'true' || ${{steps.download-wasm.outcome}} == 'failure' ]]; then
|
||||
echo "should-build-wasm=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should-build-wasm=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
|
||||
- name: Install rust
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Rust Cache
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: rust
|
||||
|
||||
# TODO: see if we can fetch from main instead if no diff at src/wasm-lib
|
||||
- name: Run build:wasm
|
||||
run: "yarn build:wasm"
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
run: "npm run build:wasm"
|
||||
|
||||
- name: Set nightly version, product name, release notes, and icons
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
run: yarn files:flip-to-nightly
|
||||
run: |
|
||||
COMMIT=$(git rev-parse --short HEAD)
|
||||
DATE=$(date +'%-y.%-m.%-d')
|
||||
export VERSION=$DATE-main.$COMMIT
|
||||
npm run files:set-version
|
||||
npm run files:flip-to-nightly
|
||||
|
||||
- name: Set release version
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
run: |
|
||||
export VERSION=${GITHUB_REF_NAME#v}
|
||||
yarn files:set-version
|
||||
npm run files:set-version
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@ -63,7 +112,7 @@ jobs:
|
||||
path: |
|
||||
package.json
|
||||
electron-builder.yml
|
||||
src/wasm-lib/pkg/wasm_lib*
|
||||
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||
release-notes.md
|
||||
assets/icon.ico
|
||||
assets/icon.png
|
||||
@ -74,18 +123,6 @@ jobs:
|
||||
- id: export_notes
|
||||
run: echo "notes=`cat release-notes.md`" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Prepare electron-builder.yml file for updater test
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
run: |
|
||||
yq -i '.publish[0].url = "https://dl.zoo.dev/releases/modeling-app/updater-test"' electron-builder.yml
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
with:
|
||||
name: prepared-files-updater-test
|
||||
path: |
|
||||
electron-builder.yml
|
||||
|
||||
|
||||
build-apps:
|
||||
needs: [prepare-files]
|
||||
@ -113,9 +150,9 @@ jobs:
|
||||
ls -R prepared-files
|
||||
cp prepared-files/package.json package.json
|
||||
cp prepared-files/electron-builder.yml electron-builder.yml
|
||||
cp prepared-files/src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||
mkdir src/wasm-lib/pkg
|
||||
cp prepared-files/src/wasm-lib/pkg/wasm_lib* src/wasm-lib/pkg
|
||||
cp prepared-files/rust/kcl-wasm-lib/pkg/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-files/rust/kcl-wasm-lib/pkg/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
cp prepared-files/release-notes.md release-notes.md
|
||||
cp prepared-files/assets/icon.ico assets/icon.ico
|
||||
cp prepared-files/assets/icon.png assets/icon.png
|
||||
@ -124,15 +161,9 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn' # Set this to npm, yarn or pnpm.
|
||||
cache: 'npm' # Set this to npm, npm or pnpm.
|
||||
|
||||
- name: yarn install
|
||||
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
|
||||
uses: nick-fields/retry@v3.0.0
|
||||
with:
|
||||
timeout_minutes: 2
|
||||
max_attempts: 3
|
||||
command: yarn install
|
||||
- run: npm install
|
||||
|
||||
- name: Prepare certificate and variables (Windows only)
|
||||
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
|
||||
@ -158,13 +189,20 @@ jobs:
|
||||
smctl.exe keypair ls
|
||||
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
|
||||
smksp_cert_sync.exe
|
||||
smctl windows certsync
|
||||
# This last line `smctl windows certsync` was added after windows codesign failures started happening
|
||||
# with nightly-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
|
||||
# but stopped doing it overnight. This extra call that I randomly got from this azure-related doc page
|
||||
# https://docs.digicert.com/en/digicert-keylocker/code-signing/sign-with-third-party-signing-tools/windows-applications/sign-azure-apps-with-signtool-using-ksp-library.html#sync-certificates--windows-only--618365
|
||||
# seems to be doing that extra sync that we need for scripts/sign-win.js to work.
|
||||
# TODO: we still need to make sign-win.js errors fail the workflow, see issue #6276
|
||||
shell: cmd
|
||||
|
||||
- name: Build the app (debug)
|
||||
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
|
||||
# electron-builder doesn't have a concept of release vs debug,
|
||||
# this is just not doing any codesign or release yml generation, and points to dev infra
|
||||
run: yarn tronb:package:dev
|
||||
run: npm run tronb:package:dev
|
||||
|
||||
- name: Build the app (release)
|
||||
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
|
||||
@ -177,13 +215,7 @@ jobs:
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||
DEBUG: "electron-notarize*"
|
||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||
uses: nick-fields/retry@v3.0.0
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
command: yarn tronb:package:prod
|
||||
run: npm run tronb:package:prod
|
||||
|
||||
- name: List artifacts in out/
|
||||
run: ls -R out
|
||||
@ -191,7 +223,7 @@ jobs:
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: out-arm64-${{ matrix.platform }}
|
||||
# first two will pick both Zoo Modeling App-$VERSION-arm64-win.exe and Zoo Modeling App-$VERSION-win.exe
|
||||
# first two will pick both Zoo Design Studio-$VERSION-arm64-win.exe and Zoo Design Studio-$VERSION-win.exe
|
||||
path: |
|
||||
out/*-${{ env.VERSION_NO_V }}-win.*
|
||||
out/*-${{ env.VERSION_NO_V }}-arm64-win.*
|
||||
@ -215,61 +247,13 @@ jobs:
|
||||
|
||||
# TODO: add the 'Build for Mac TestFlight (nightly)' stage back
|
||||
|
||||
# The steps below are for updater-test builds, only on release
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
name: prepared-files-updater-test
|
||||
|
||||
- name: Copy updated electron-builder.yml file for updater test
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
run: |
|
||||
ls -R prepared-files-updater-test
|
||||
cp prepared-files-updater-test/electron-builder.yml electron-builder.yml
|
||||
|
||||
- name: Build the app (updater-test)
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
|
||||
DEBUG: "electron-notarize*"
|
||||
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
|
||||
uses: nick-fields/retry@v3.0.0
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
command: yarn tronb:package:prod
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
with:
|
||||
name: updater-test-arm64-${{ matrix.platform }}
|
||||
path: |
|
||||
out/*-arm64-win.exe
|
||||
out/*-arm64-mac.dmg
|
||||
out/*-arm64-linux.AppImage
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ env.IS_RELEASE == 'true' }}
|
||||
with:
|
||||
name: updater-test-x64-${{ matrix.platform }}
|
||||
path: |
|
||||
out/*-x64-win.exe
|
||||
out/*-x64-mac.dmg
|
||||
out/*-x86_64-linux.AppImage
|
||||
|
||||
|
||||
upload-apps-release:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
contents: write
|
||||
if: ${{ github.ref_type == 'tag' || github.event_name == 'schedule' }}
|
||||
# Equivalent to IS_RELEASE || IS_NIGHTLY (but we can't access those env vars here)
|
||||
if: ${{ (github.ref_type == 'tag' && startsWith(github.ref_name, 'v')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||
env:
|
||||
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
|
||||
VERSION: ${{ format('v{0}', needs.prepare-files.outputs.version) }}
|
||||
@ -326,8 +310,8 @@ jobs:
|
||||
env:
|
||||
NOTES: ${{ needs.prepare-files.outputs.notes }}
|
||||
PUB_DATE: ${{ github.event.repository.updated_at }}
|
||||
WEBSITE_DIR: ${{ github.event_name == 'schedule' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
||||
URL_CODED_NAME: ${{ github.event_name == 'schedule' && 'Zoo%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
|
||||
WEBSITE_DIR: ${{ env.IS_NIGHTLY == 'true' && 'dl.zoo.dev/releases/modeling-app/nightly' || 'dl.zoo.dev/releases/modeling-app' }}
|
||||
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
|
||||
run: |
|
||||
RELEASE_DIR=https://${WEBSITE_DIR}
|
||||
jq --null-input \
|
||||
@ -375,17 +359,6 @@ jobs:
|
||||
- name: List artifacts
|
||||
run: "ls -R out"
|
||||
|
||||
- name: Set more complete nightly release notes
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
run: |
|
||||
# Note: preferred going this way instead of a full clone in the checkout step,
|
||||
# see https://github.com/actions/checkout/issues/1471
|
||||
git fetch --prune --unshallow --tags
|
||||
export TAG="nightly-${VERSION}"
|
||||
export PREVIOUS_TAG=$(git describe --tags --match="nightly-v[0-9]*" --abbrev=0)
|
||||
export NOTES=$(./scripts/get-nightly-changelog.sh)
|
||||
yarn files:set-notes
|
||||
|
||||
- name: Authenticate to Google Cloud
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
uses: 'google-github-actions/auth@v2.1.8'
|
||||
@ -409,15 +382,4 @@ jobs:
|
||||
|
||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
run: yarn files:invalidate-bucket:nightly
|
||||
|
||||
- name: Tag nightly commit
|
||||
if: ${{ env.IS_NIGHTLY == 'true' }}
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { VERSION } = process.env
|
||||
const { owner, repo } = context.repo
|
||||
const { sha } = context
|
||||
const ref = `refs/tags/nightly-${VERSION}`
|
||||
github.rest.git.createRef({ owner, repo, sha, ref })
|
||||
run: npm run files:invalidate-bucket:nightly
|
||||
|
56
.github/workflows/build-wasm.yml
vendored
Normal file
56
.github/workflows/build-wasm.yml
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
name: Build WASM
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
npm-build-wasm:
|
||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # configured below
|
||||
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Use Rust cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
|
||||
- name: Build Wasm
|
||||
shell: bash
|
||||
run: npm run build:wasm
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-wasm
|
||||
path: |
|
||||
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-ts-rs-bindings
|
||||
path: |
|
||||
rust/kcl-lib/bindings/*
|
57
.github/workflows/cargo-bench.yml
vendored
Normal file
57
.github/workflows/cargo-bench.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**.rs'
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- .github/workflows/cargo-bench.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.rs'
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- .github/workflows/cargo-bench.yml
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
name: cargo bench
|
||||
jobs:
|
||||
cargo-bench:
|
||||
name: cargo bench
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cargo install cargo-criterion
|
||||
cargo install cargo-codspeed
|
||||
cd rust/kcl-lib
|
||||
cargo add --dev codspeed-criterion-compat --rename criterion
|
||||
- name: Build the benchmark target(s)
|
||||
run: |
|
||||
cd rust
|
||||
cargo codspeed build
|
||||
- name: Run the benchmarks
|
||||
uses: CodSpeedHQ/action@v3
|
||||
with:
|
||||
working-directory: rust
|
||||
run: cargo codspeed run
|
||||
token: ${{ secrets.CODSPEED_TOKEN }}
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}
|
19
.github/workflows/cargo-check.yml
vendored
19
.github/workflows/cargo-check.yml
vendored
@ -17,23 +17,20 @@ jobs:
|
||||
cargocheck:
|
||||
name: cargo check
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dir: ['src/wasm-lib']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
cache-workspaces: rust
|
||||
|
||||
- name: Run check
|
||||
run: |
|
||||
cd "${{ matrix.dir }}"
|
||||
cd rust
|
||||
# We specifically want to test the disable-println feature
|
||||
# Since it is not enabled by default, we need to specify it
|
||||
# This is used in kcl-lsp
|
||||
|
21
.github/workflows/cargo-clippy.yml
vendored
21
.github/workflows/cargo-clippy.yml
vendored
@ -23,25 +23,22 @@ jobs:
|
||||
cargoclippy:
|
||||
name: cargo clippy
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dir: ['src/wasm-lib']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: taiki-e/install-action@just
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
cache-workspaces: rust
|
||||
components: clippy
|
||||
|
||||
- name: Run clippy
|
||||
run: |
|
||||
cd "${{ matrix.dir }}"
|
||||
cd rust
|
||||
just lint
|
||||
# If this fails, run "cargo check" to update Cargo.lock,
|
||||
# then add Cargo.lock to the PR.
|
||||
|
21
.github/workflows/cargo-fmt.yml
vendored
21
.github/workflows/cargo-fmt.yml
vendored
@ -26,23 +26,20 @@ jobs:
|
||||
cargofmt:
|
||||
name: cargo fmt
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dir: ['src/wasm-lib']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
cache-workspaces: rust
|
||||
components: rustfmt
|
||||
|
||||
- name: Run cargo fmt
|
||||
run: |
|
||||
cd "${{ matrix.dir }}"
|
||||
cd rust
|
||||
cargo fmt -- --check
|
||||
shell: bash
|
||||
|
303
.github/workflows/cargo-test.yml
vendored
303
.github/workflows/cargo-test.yml
vendored
@ -2,60 +2,281 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
permissions: read-all
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
name: cargo test of wasm-lib
|
||||
name: cargo test
|
||||
jobs:
|
||||
cargotest:
|
||||
name: cargo test
|
||||
runs-on: ubuntu-latest-8-cores
|
||||
strategy:
|
||||
matrix:
|
||||
dir: ['src/wasm-lib']
|
||||
build-test-artifacts:
|
||||
name: Build test artifacts
|
||||
runs-on:
|
||||
- runs-on=${{ github.run_id }}
|
||||
- runner=8cpu-linux-x64
|
||||
- extras=s3-cache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install latest rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: Install vector
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
||||
chmod +x /tmp/vector.sh
|
||||
/tmp/vector.sh -y -no-modify-path
|
||||
mkdir -p /tmp/vector
|
||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
||||
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
|
||||
cat /tmp/vector.toml
|
||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- name: Start Vector
|
||||
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
- uses: taiki-e/install-action@nextest
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@just
|
||||
- name: Install cargo-insta
|
||||
shell: bash
|
||||
run: |
|
||||
cargo install cargo-insta
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2.6.1
|
||||
- name: cargo test
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: rust
|
||||
- name: Fetch the base branch
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
run: git fetch origin ${{ github.base_ref }} --depth=1
|
||||
- name: Check for path changes
|
||||
id: path-changes
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
# Manual runs or push should run all tests.
|
||||
if [[ ${{ github.event_name }} != 'pull_request' ]]; then
|
||||
echo "outside-kcl-samples=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
changed_files=$(git diff --name-only origin/${{ github.base_ref }})
|
||||
echo "$changed_files"
|
||||
if grep -Evq '^public/kcl-samples/|^rust/kcl-lib/tests/kcl_samples/' <<< "$changed_files" ; then
|
||||
echo "outside-kcl-samples=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "outside-kcl-samples=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: cargo test only kcl-samples
|
||||
id: cargo-test-kcl-samples
|
||||
if: steps.path-changes.outputs.outside-kcl-samples == 'false'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd rust
|
||||
cargo nextest run --workspace --features artifact-graph --retries=10 --no-fail-fast --profile ci simulation_tests::kcl_samples 2>&1 | tee /tmp/github-actions.log
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
RUST_BACKTRACE: full
|
||||
RUST_MIN_STACK: 10485760000
|
||||
- name: Commit differences
|
||||
if: steps.path-changes.outputs.outside-kcl-samples == 'false' && steps.cargo-test-kcl-samples.outcome == 'failure'
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
pushd rust
|
||||
just overwrite-sim-test kcl_samples
|
||||
popd
|
||||
git add \
|
||||
rust/kcl-lib/tests \
|
||||
public/kcl-samples
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
if ! git commit -m "Update kcl-samples simulation test output" ; then
|
||||
echo "No changes to commit"
|
||||
# This only runs if tests failed, so we should fail the step.
|
||||
exit 1
|
||||
fi
|
||||
git push origin ${{ github.head_ref }}
|
||||
env:
|
||||
# The default is auto, and insta behaves differently in CI vs. not.
|
||||
INSTA_UPDATE: always
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
# Configure nextest when it's run by insta (via just).
|
||||
NEXTEST_PROFILE: ci
|
||||
RUST_BACKTRACE: full
|
||||
RUST_MIN_STACK: 10485760000
|
||||
- name: Build and archive tests
|
||||
run: |
|
||||
cd rust
|
||||
cargo nextest archive --workspace --features artifact-graph --archive-file nextest-archive.tar.zst
|
||||
- name: Upload archive to workflow
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nextest-archive
|
||||
path: rust/nextest-archive.tar.zst
|
||||
run-test-artifacts:
|
||||
name: cargo test (shard ${{ matrix.partitionIndex}})
|
||||
runs-on:
|
||||
- runs-on=${{ github.run_id }}
|
||||
- runner=32cpu-linux-x64
|
||||
- extras=s3-cache
|
||||
needs: build-test-artifacts
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
partitionIndex: [1, 2, 3, 4, 5, 6]
|
||||
partitionTotal: [6]
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- name: Start Vector
|
||||
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
- uses: taiki-e/install-action@nextest
|
||||
- name: Download archive
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nextest-archive
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |-
|
||||
cd "${{ matrix.dir }}"
|
||||
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --test-threads=1 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
|
||||
cp nextest-archive.tar.zst rust/nextest-archive.tar.zst
|
||||
ls -lah
|
||||
cd rust
|
||||
cargo nextest run \
|
||||
--retries=10 --no-fail-fast --profile=ci --archive-file nextest-archive.tar.zst \
|
||||
--partition count:${{ matrix.partitionIndex}}/${{ matrix.partitionTotal }} \
|
||||
2>&1 | tee /tmp/github-actions.log
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
RUST_MIN_STACK: 10485760000
|
||||
- name: Upload to codecov.io
|
||||
uses: codecov/codecov-action@v5
|
||||
- name: Upload results
|
||||
if: always()
|
||||
run: .github/ci-cd-scripts/upload-results.sh
|
||||
env:
|
||||
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
CI_SUITE: unit:kcl
|
||||
run-internal-kcl-samples:
|
||||
name: cargo test (internal-kcl-samples)
|
||||
runs-on:
|
||||
- runs-on=${{ github.run_id }}
|
||||
- runner=32cpu-linux-x64
|
||||
- extras=s3-cache
|
||||
steps:
|
||||
- uses: runs-on/action@v1
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
token: ${{secrets.CODECOV_TOKEN}}
|
||||
fail_ci_if_error: true
|
||||
flags: wasm-lib
|
||||
verbose: true
|
||||
files: lcov.info
|
||||
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- name: Start Vector
|
||||
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
- uses: taiki-e/install-action@nextest
|
||||
- name: Download internal KCL samples
|
||||
run: git clone --depth=1 https://x-access-token:${{ secrets.GH_PAT_KCL_SAMPLES_INTERNAL }}@github.com/KittyCAD/kcl-samples-internal public/kcl-samples/internal
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |-
|
||||
cd rust/kcl-lib
|
||||
cargo nextest run \
|
||||
--retries=10 --no-fail-fast --features artifact-graph --profile=ci \
|
||||
internal \
|
||||
2>&1 | tee /tmp/github-actions.log
|
||||
env:
|
||||
TWENTY_TWENTY: overwrite
|
||||
INSTA_UPDATE: always
|
||||
EXPECTORATE: overwrite
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
MODELING_APP_INTERNAL_SAMPLES_SECRET: ${{secrets.MODELING_APP_INTERNAL_SAMPLES_SECRET}}
|
||||
RUST_MIN_STACK: 10485760000
|
||||
run-wasm-tests:
|
||||
name: Run wasm tests
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
- name: Rust Cache
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
- name: Build Wasm
|
||||
shell: bash
|
||||
run: |
|
||||
npm install
|
||||
npm run build:wasm
|
||||
- name: Run wasm tests
|
||||
run: |
|
||||
cd rust
|
||||
cd kcl-wasm-lib
|
||||
#wasm-pack test --headless --chrome
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
NODE_ENV: development
|
||||
|
36
.github/workflows/check-exampleKcl.yml
vendored
36
.github/workflows/check-exampleKcl.yml
vendored
@ -1,36 +0,0 @@
|
||||
name: Check Onboarding KCL
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
paths:
|
||||
- 'src/lib/exampleKcl.ts'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Comment on PR
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
|
||||
const issue_number = context.payload.pull_request.number;
|
||||
const owner = context.repo.owner;
|
||||
const repo = context.repo.repo;
|
||||
|
||||
// Post a comment on the PR
|
||||
await github.rest.issues.createComment({
|
||||
owner,
|
||||
repo,
|
||||
issue_number,
|
||||
body: message,
|
||||
});
|
48
.github/workflows/check-kcl-header.yml
vendored
Normal file
48
.github/workflows/check-kcl-header.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
name: Check kcl-samples files for proper header structure
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'public/kcl-samples/**/*.kcl'
|
||||
- .github/workflows/check-kcl-header.yml
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
paths:
|
||||
- 'public/kcl-samples/**/*.kcl'
|
||||
- .github/workflows/check-kcl-header.yml
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check-kcl-header:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check KCL files for header comment block and blank line
|
||||
run: |
|
||||
files=$(find public/kcl-samples -type f -name '*.kcl')
|
||||
failed_files=()
|
||||
|
||||
for file in $files; do
|
||||
if ! awk '
|
||||
NR == 1 && $0 !~ /^\/\// { exit 1 }
|
||||
BEGIN { in_comment = 1 }
|
||||
NF == 0 && in_comment == 1 { in_comment = 0; next }
|
||||
$1 !~ /^\/\// && in_comment == 1 { exit 1 }
|
||||
in_comment == 0 && NF > 0 { exit 0 }
|
||||
END { if (in_comment == 1) exit 1 }
|
||||
' "$file"; then
|
||||
failed_files+=("$file")
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${#failed_files[@]} -ne 0 ]; then
|
||||
echo "One or more KCL files do not begin with a header comment block followed by a blank line:"
|
||||
printf '%s\n' "${failed_files[@]}"
|
||||
exit 1
|
||||
fi
|
13
.github/workflows/codemirror-lang-kcl.yml
vendored
13
.github/workflows/codemirror-lang-kcl.yml
vendored
@ -11,7 +11,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
yarn-unit-test:
|
||||
npm-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@ -19,14 +19,11 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
cache: 'npm'
|
||||
|
||||
- run: yarn install
|
||||
working-directory: packages/codemirror-lang-kcl
|
||||
- run: npm install
|
||||
|
||||
- run: yarn tsc
|
||||
working-directory: packages/codemirror-lang-kcl
|
||||
- run: npm run tsc --workspace=packages/codemirror-lang-kcl
|
||||
|
||||
- name: run unit tests
|
||||
run: yarn test
|
||||
working-directory: packages/codemirror-lang-kcl
|
||||
run: npm run test --workspace=packages/codemirror-lang-kcl
|
||||
|
501
.github/workflows/e2e-tests.yml
vendored
501
.github/workflows/e2e-tests.yml
vendored
@ -1,8 +1,11 @@
|
||||
name: E2E Tests
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: 0 * * * * # hourly
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
@ -13,14 +16,11 @@ permissions:
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
check-rust-changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
rust-changed: ${{ steps.filter.outputs.rust }}
|
||||
|
||||
prepare-wasm:
|
||||
# separate job on Ubuntu to build or fetch the wasm blob once on the fastest runner
|
||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@ -30,200 +30,311 @@ jobs:
|
||||
with:
|
||||
filters: |
|
||||
rust:
|
||||
- 'src/wasm-lib/**'
|
||||
- 'rust/**'
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Download Wasm cache
|
||||
id: download-wasm
|
||||
if: ${{ github.event_name != 'schedule' && steps.filter.outputs.rust == 'false' }}
|
||||
uses: dawidd6/action-download-artifact@v7
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
name: wasm-bundle
|
||||
workflow: build-and-store-wasm.yml
|
||||
branch: main
|
||||
path: rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Build Wasm condition
|
||||
id: wasm
|
||||
run: |
|
||||
set -euox pipefail
|
||||
# Build wasm if this is a scheduled run, there are Rust changes, or
|
||||
# downloading from the wasm cache failed.
|
||||
if [[ ${{github.event_name}} == 'schedule' || ${{steps.filter.outputs.rust}} == 'true' || ${{steps.download-wasm.outcome}} == 'failure' ]]; then
|
||||
echo "should-build-wasm=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should-build-wasm=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Use correct Rust toolchain
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
|
||||
|
||||
- name: Install Rust
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: false # Configured below.
|
||||
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Use Rust cache
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './rust'
|
||||
|
||||
- name: Build Wasm
|
||||
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
|
||||
shell: bash
|
||||
run: npm run build:wasm
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: prepared-wasm
|
||||
path: |
|
||||
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
|
||||
|
||||
snapshots:
|
||||
name: playwright:snapshots:ubuntu
|
||||
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
|
||||
needs: [prepare-wasm]
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
name: prepared-wasm
|
||||
|
||||
- name: Copy prepared Wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
id: deps-install
|
||||
run: npm install
|
||||
|
||||
- name: Cache browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/ms-playwright/
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- name: Install browsers
|
||||
run: npm run playwright install --with-deps
|
||||
|
||||
- name: Test snapshots
|
||||
uses: nick-fields/retry@v3.0.2
|
||||
with:
|
||||
shell: bash
|
||||
command: npm run test:snapshots
|
||||
timeout_minutes: 5
|
||||
max_attempts: 5
|
||||
env:
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
CI_SUITE: snapshots
|
||||
TARGET: web
|
||||
|
||||
- name: Update snapshots
|
||||
if: always()
|
||||
run: npm run test:snapshots -- --last-failed --update-snapshots
|
||||
env:
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
CI_SUITE: snapshots
|
||||
TARGET: web
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
with:
|
||||
name: playwright-report-ubuntu-snapshot-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
- name: Check diff
|
||||
if: ${{ github.ref != 'refs/heads/main' }}
|
||||
shell: bash
|
||||
id: git-check
|
||||
run: |
|
||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||
if git status | grep --quiet "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit changes
|
||||
if: ${{ steps.git-check.outputs.modified == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/snapshots
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
git commit --message "Update snapshots" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
|
||||
electron:
|
||||
needs: [prepare-wasm]
|
||||
timeout-minutes: 60
|
||||
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
|
||||
env:
|
||||
OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}
|
||||
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }} (shard ${{ matrix.shardIndex }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# TODO: enable self-hosted-windows-8-cores once available
|
||||
os: [namespace-profile-ubuntu-8-cores, namespace-profile-macos-8-cores, windows-16-cores]
|
||||
shardIndex: [1, 2, 3, 4]
|
||||
shardTotal: [4]
|
||||
# TODO: enable namespace-profile-windows-latest once available
|
||||
include:
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 1
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 2
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 3
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 4
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 5
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 6
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 7
|
||||
shardTotal: 8
|
||||
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
|
||||
shardIndex: 8
|
||||
shardTotal: 8
|
||||
- os: namespace-profile-macos-8-cores
|
||||
shardIndex: 1
|
||||
shardTotal: 2
|
||||
- os: namespace-profile-macos-8-cores
|
||||
shardIndex: 2
|
||||
shardTotal: 2
|
||||
- os: windows-latest-8-cores
|
||||
shardIndex: 1
|
||||
shardTotal: 2
|
||||
- os: windows-latest-8-cores
|
||||
shardIndex: 2
|
||||
shardTotal: 2
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: check-rust-changes
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
|
||||
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- uses: KittyCAD/action-install-cli@main
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: yarn
|
||||
- name: Cache Playwright Browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/ms-playwright/
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
||||
- name: Install Playwright Browsers
|
||||
shell: bash
|
||||
run: yarn playwright install --with-deps
|
||||
- name: Download Wasm Cache
|
||||
id: download-wasm
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||
uses: dawidd6/action-download-artifact@v7
|
||||
continue-on-error: true
|
||||
with:
|
||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||
name: wasm-bundle
|
||||
workflow: build-and-store-wasm.yml
|
||||
branch: main
|
||||
path: src/wasm-lib/pkg
|
||||
- name: copy wasm blob
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||
shell: bash
|
||||
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||
continue-on-error: true
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache Wasm (because rust diff)
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './src/wasm-lib'
|
||||
- name: OR Cache Wasm (because wasm cache failed)
|
||||
if: steps.download-wasm.outcome == 'failure'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './src/wasm-lib'
|
||||
- name: install good sed
|
||||
if: ${{ startsWith(matrix.os, 'macos') }}
|
||||
shell: bash
|
||||
run: |
|
||||
brew install gnu-sed
|
||||
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
|
||||
- name: Install vector
|
||||
shell: bash
|
||||
# TODO: figure out what to do with this, it's failing
|
||||
if: false
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
|
||||
chmod +x /tmp/vector.sh
|
||||
/tmp/vector.sh -y -no-modify-path
|
||||
mkdir -p /tmp/vector
|
||||
cp .github/workflows/vector.toml /tmp/vector.toml
|
||||
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
|
||||
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
|
||||
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
|
||||
cat /tmp/vector.toml
|
||||
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
|
||||
- name: Build Wasm (because rust diff)
|
||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
||||
shell: bash
|
||||
run: yarn build:wasm
|
||||
- name: OR Build Wasm (because wasm cache failed)
|
||||
if: steps.download-wasm.outcome == 'failure'
|
||||
shell: bash
|
||||
run: yarn build:wasm
|
||||
- name: build web
|
||||
shell: bash
|
||||
run: yarn tronb:vite:dev
|
||||
- name: Run ubuntu/chrome snapshots
|
||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 }}
|
||||
shell: bash
|
||||
# TODO: break this in its own job, for now it's not slowing down the overall execution as ubuntu is the quickest,
|
||||
# but we could do better. This forces a large 1/1 shard of all 20 snapshot tests that runs in about 3 minutes.
|
||||
run: |
|
||||
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --shard=1/1
|
||||
env:
|
||||
CI: true
|
||||
NODE_ENV: development
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
VITE_KC_SKIP_AUTH: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
with:
|
||||
name: playwright-report-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- name: Clean up test-results
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
continue-on-error: true
|
||||
run: rm -r test-results
|
||||
- name: check for changes
|
||||
if: ${{ matrix.os == 'namespace-profile-ubuntu-8-cores' && matrix.shardIndex == 1 && github.ref != 'refs/heads/main' }}
|
||||
shell: bash
|
||||
id: git-check
|
||||
run: |
|
||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
|
||||
if git status | grep -q "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Commit changes, if any
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
git commit -m "A snapshot a day keeps the bugs away! 📷🐛 (OS: ${{matrix.os}})" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
# only upload artifacts if there's actually changes
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
with:
|
||||
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
- uses: actions/download-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
- name: Run playwright/electron flow (with retries)
|
||||
id: retry
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
shell: bash
|
||||
run: |
|
||||
.github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
|
||||
env:
|
||||
CI: true
|
||||
FAIL_ON_CONSOLE_ERRORS: true
|
||||
NODE_ENV: development
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
VITE_KC_SKIP_AUTH: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: test-results-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
name: prepared-wasm
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
id: deps-install
|
||||
run: npm install
|
||||
|
||||
- name: Cache Playwright Browsers
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cache/ms-playwright/
|
||||
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npm run playwright install --with-deps
|
||||
|
||||
- name: Build web
|
||||
run: npm run tronb:vite:dev
|
||||
|
||||
- name: Start Vector
|
||||
if: ${{ !contains(matrix.os, 'windows') }}
|
||||
run: .github/ci-cd-scripts/start-vector-${{ env.OS_NAME }}.sh
|
||||
env:
|
||||
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
|
||||
OS_NAME: ${{ env.OS_NAME }}
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
if: ${{ !cancelled() && (success() || failure()) }}
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: test-results-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
|
||||
- name: Run playwright/electron flow (with retries)
|
||||
id: retry
|
||||
if: ${{ !cancelled() && steps.deps-install.outcome == 'success' }}
|
||||
uses: nick-fields/retry@v3.0.2
|
||||
with:
|
||||
shell: bash
|
||||
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }}
|
||||
timeout_minutes: 30
|
||||
max_attempts: 9
|
||||
env:
|
||||
FAIL_ON_CONSOLE_ERRORS: true
|
||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
TAB_API_URL: ${{ secrets.TAB_API_URL }}
|
||||
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
|
||||
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
TARGET: desktop
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: test-results-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: test-results/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report-${{ env.OS_NAME }}-${{ matrix.shardIndex }}-${{ github.sha }}
|
||||
path: playwright-report/
|
||||
include-hidden-files: true
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
|
@ -21,10 +21,10 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- run: yarn generate:machine-api
|
||||
- run: yarn fmt
|
||||
cache: 'npm'
|
||||
- run: npm install
|
||||
- run: npm run generate:machine-api
|
||||
- run: npm run fmt || true
|
||||
- name: check for changes
|
||||
id: git-check
|
||||
run: |
|
||||
|
19
.github/workflows/generate-website-docs.yml
vendored
19
.github/workflows/generate-website-docs.yml
vendored
@ -5,6 +5,7 @@ on:
|
||||
paths:
|
||||
- .github/workflows/generate-website-docs.yml
|
||||
- 'docs/**'
|
||||
- 'public/kcl-samples/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/generate-website-docs.yml
|
||||
@ -37,11 +38,21 @@ jobs:
|
||||
run: |
|
||||
mkdir -p documentation/content/pages/docs/kcl/
|
||||
# cleanup old
|
||||
rm -rf documentation/content/pages/docs/kcl/*.md
|
||||
rm -rf documentation/content/pages/docs/kcl/types
|
||||
rm -rf documentation/content/pages/docs/kcl-std
|
||||
rm -rf documentation/content/pages/docs/kcl-lang
|
||||
# move new
|
||||
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/
|
||||
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
|
||||
mv -f docs/kcl-std documentation/content/pages/docs
|
||||
mv -f docs/kcl-lang documentation/content/pages/docs
|
||||
# We don't need the README
|
||||
rm documentation/content/pages/docs/kcl-std/README.md
|
||||
- name: move kcl-samples
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p documentation/content/pages/docs/kcl-samples
|
||||
# cleanup old
|
||||
rm -rf documentation/content/pages/docs/kcl-samples/*
|
||||
# move new
|
||||
mv -f public/kcl-samples/* documentation/content/pages/docs/kcl-samples/
|
||||
- name: commit the changes in the docs repo
|
||||
shell: bash
|
||||
run: |
|
||||
|
354
.github/workflows/kcl-language-server.yml
vendored
Normal file
354
.github/workflows/kcl-language-server.yml
vendored
Normal file
@ -0,0 +1,354 @@
|
||||
name: kcl-language-server
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- 'rust/kcl-language-server/**'
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-language-server.yml
|
||||
tags:
|
||||
- 'kcl-*'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- 'rust/kcl-language-server/**'
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-language-server.yml
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: read
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
CARGO_INCREMENTAL: 0
|
||||
CARGO_NET_RETRY: 10
|
||||
RUSTFLAGS: ""
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
FETCH_DEPTH: 0 # pull in the tags for the version string
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.15
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||
jobs:
|
||||
test:
|
||||
name: kcl-language-server (vscode tests)
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npm run build
|
||||
npm run test-compile
|
||||
ls -la dist
|
||||
xvfb-run -a npm run test
|
||||
if: runner.os == 'Linux'
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npm run test
|
||||
if: runner.os != 'Linux'
|
||||
build-release:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
code-target: win32-x64
|
||||
#- os: windows-latest
|
||||
#target: i686-pc-windows-msvc
|
||||
#code-target:
|
||||
#win32-ia32
|
||||
#- os: windows-latest
|
||||
#target: aarch64-pc-windows-msvc
|
||||
#code-target: win32-arm64
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
code-target: linux-x64
|
||||
#- os: ubuntu-latest
|
||||
#target: aarch64-unknown-linux-musl
|
||||
#code-target: linux-arm64
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
code-target: linux-arm64
|
||||
- os: ubuntu-latest
|
||||
target: arm-unknown-linux-gnueabihf
|
||||
code-target: linux-armhf
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
code-target: darwin-x64
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
code-target: darwin-arm64
|
||||
name: kcl-language-server build-release (${{ matrix.target }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.container }}
|
||||
env:
|
||||
RA_TARGET: ${{ matrix.target }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
rm rust/rust-toolchain.toml
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
components: rust-src
|
||||
target: ${{ matrix.target }}
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- name: Update apt repositories
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf' || matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update
|
||||
- if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
name: Install deps
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt install -y \
|
||||
ca-certificates \
|
||||
clang \
|
||||
cmake \
|
||||
curl \
|
||||
g++ \
|
||||
gcc \
|
||||
gcc-mingw-w64-i686 \
|
||||
gcc-mingw-w64 \
|
||||
jq \
|
||||
libmpc-dev \
|
||||
libmpfr-dev \
|
||||
libgmp-dev \
|
||||
libssl-dev \
|
||||
libxml2-dev \
|
||||
mingw-w64 \
|
||||
wget \
|
||||
zlib1g-dev
|
||||
|
||||
cargo install cross
|
||||
- name: Install AArch64 target toolchain
|
||||
if: matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: sudo apt-get install gcc-aarch64-linux-gnu
|
||||
- name: Install ARM target toolchain
|
||||
if: matrix.target == 'arm-unknown-linux-gnueabihf'
|
||||
run: sudo apt-get install gcc-arm-linux-gnueabihf
|
||||
- name: build
|
||||
run: |
|
||||
cd rust
|
||||
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
# npm will symlink which will cause issues w tarballing later
|
||||
yarn install
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
|
||||
- name: Package Extension (nightly)
|
||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
|
||||
- name: remove server
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu'
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
rm -rf server
|
||||
- name: Package Extension (no server, release)
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix
|
||||
- name: Package Extension (no server, nightly)
|
||||
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix --pre-release
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-${{ matrix.target }}
|
||||
path: ./rust/build
|
||||
build-release-x86_64-unknown-linux-musl:
|
||||
name: kcl-language-server build-release (x86_64-unknown-linux-musl)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RA_TARGET: x86_64-unknown-linux-musl
|
||||
# For some reason `-crt-static` is not working for clang without lld
|
||||
RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
|
||||
container:
|
||||
image: alpine:latest
|
||||
volumes:
|
||||
- /usr/local/cargo/registry:/usr/local/cargo/registry
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
clang \
|
||||
lld \
|
||||
musl-dev \
|
||||
nodejs \
|
||||
npm \
|
||||
yarn
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
- name: Use correct Rust toolchain
|
||||
shell: bash
|
||||
run: |
|
||||
rm rust/rust-toolchain.toml
|
||||
- name: Install rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
cache: rust
|
||||
components: rust-src
|
||||
target: ${{ matrix.target }}
|
||||
- name: build
|
||||
run: |
|
||||
cd rust
|
||||
cargo kcl-language-server-release build --client-patch-version ${{ github.run_number }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
# npm will symlink which will cause issues w tarballing later
|
||||
yarn install
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/')
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
|
||||
- name: Package Extension (release)
|
||||
if: startsWith(github.event.ref, 'refs/tags/') == false
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-musl
|
||||
path: ./rust/build
|
||||
publish:
|
||||
name: kcl-language-server (publish)
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["build-release", "build-release-x86_64-unknown-linux-musl"]
|
||||
if: startsWith(github.event.ref, 'refs/tags')
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
- run: 'echo "TAG: $TAG"'
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: ${{ env.FETCH_DEPTH }}
|
||||
- name: Install Nodejs
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
- run: 'echo "HEAD_SHA: $HEAD_SHA"'
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-aarch64-apple-darwin
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-apple-darwin
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-gnu
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-unknown-linux-musl
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-aarch64-unknown-linux-gnu
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-arm-unknown-linux-gnueabihf
|
||||
path: rust/build
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-x86_64-pc-windows-msvc
|
||||
path: rust/build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-i686-pc-windows-msvc
|
||||
#path:
|
||||
#build
|
||||
#- uses: actions/download-artifact@v4
|
||||
#with:
|
||||
#name: release-aarch64-pc-windows-msvc
|
||||
#path: rust/build
|
||||
- run: ls -al ./rust/build
|
||||
- name: Publish Release
|
||||
uses: ./.github/actions/github-release
|
||||
with:
|
||||
files: "rust/build/*"
|
||||
name: ${{ env.TAG }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: move files to dir for upload
|
||||
shell: bash
|
||||
run: |
|
||||
cd rust
|
||||
mkdir -p releases/language-server/${{ env.TAG }}
|
||||
cp -r build/* releases/language-server/${{ env.TAG }}
|
||||
- name: "Authenticate to Google Cloud"
|
||||
uses: "google-github-actions/auth@v2.1.8"
|
||||
with:
|
||||
credentials_json: "${{ secrets.GOOGLE_CLOUD_DL_SA }}"
|
||||
- name: Set up Cloud SDK
|
||||
uses: google-github-actions/setup-gcloud@v2.1.4
|
||||
with:
|
||||
project_id: kittycadapi
|
||||
- name: "upload files to gcp"
|
||||
id: upload-files
|
||||
uses: google-github-actions/upload-cloud-storage@v2.2.2
|
||||
with:
|
||||
path: rust/releases
|
||||
destination: dl.kittycad.io
|
||||
- run: rm rust/build/kcl-language-server-no-server.vsix
|
||||
- name: Publish Extension (Code Marketplace, release)
|
||||
# token from https://dev.azure.com/kcl-language-server/
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx vsce publish --pat ${{ secrets.VSCE_PAT }} --packagePath ../build/kcl-language-server-*.vsix
|
||||
- name: Publish Extension (OpenVSX, release)
|
||||
run: |
|
||||
cd rust/kcl-language-server
|
||||
npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../build/kcl-language-server-*.vsix
|
||||
timeout-minutes: 2
|
179
.github/workflows/kcl-python-bindings.yml
vendored
Normal file
179
.github/workflows/kcl-python-bindings.yml
vendored
Normal file
@ -0,0 +1,179 @@
|
||||
# This file is autogenerated by maturin v1.6.0 and then modified
|
||||
# To update, run
|
||||
#
|
||||
# maturin generate-ci github
|
||||
#
|
||||
name: kcl-python-bindings
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- 'rust/kcl-python-bindings/**'
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-python-bindings.yml
|
||||
tags:
|
||||
- 'kcl-*'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/rust-toolchain.toml'
|
||||
- 'rust/kcl-python-bindings/**'
|
||||
- '**.rs'
|
||||
- .github/workflows/kcl-python-bindings.yml
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: read
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
linux-x86_64:
|
||||
name: kcl-python-bindings (linux-x86_64)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
working-directory: rust/kcl-python-bindings
|
||||
target: x86_64
|
||||
args: --release --out dist --find-interpreter
|
||||
sccache: 'true'
|
||||
manylinux: auto
|
||||
before-script-linux: |
|
||||
yum install openssl-devel -y
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheels-linux-x86_64
|
||||
path: rust/kcl-python-bindings/dist
|
||||
windows:
|
||||
name: kcl-python-bindings (windows)
|
||||
runs-on: windows-16-cores
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x64
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
architecture: ${{ matrix.target }}
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
working-directory: rust/kcl-python-bindings
|
||||
target: ${{ matrix.target }}
|
||||
args: --release --out dist --find-interpreter
|
||||
sccache: 'true'
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheels-windows-${{ matrix.target }}
|
||||
path: rust/kcl-python-bindings/dist
|
||||
macos:
|
||||
name: kcl-python-bindings (macos)
|
||||
runs-on: macos-latest
|
||||
strategy:
|
||||
matrix:
|
||||
target:
|
||||
- x86_64
|
||||
- aarch64
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Build wheels
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
working-directory: rust/kcl-python-bindings
|
||||
target: ${{ matrix.target }}
|
||||
args: --release --out dist --find-interpreter
|
||||
sccache: 'true'
|
||||
- name: Upload wheels
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheels-macos-${{ matrix.target }}
|
||||
path: rust/kcl-python-bindings/dist
|
||||
test:
|
||||
name: kcl-python-bindings (test)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
- uses: taiki-e/install-action@just
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd rust/kcl-python-bindings
|
||||
just setup-uv
|
||||
just test
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
ZOO_HOST: https://api.dev.zoo.dev
|
||||
sdist:
|
||||
name: kcl-python-bindings (sdist)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: Install codespell
|
||||
run: |
|
||||
uv venv .venv
|
||||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||
uv pip install pip --upgrade
|
||||
- name: Build sdist
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
working-directory: rust/kcl-python-bindings
|
||||
command: sdist
|
||||
args: --out dist
|
||||
- name: Upload sdist
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheels-sdist
|
||||
path: rust/kcl-python-bindings/dist
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: [linux-x86_64, windows, macos, sdist]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: rust/kcl-python-bindings
|
||||
- name: Install the latest version of uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
- name: do uv things
|
||||
run: |
|
||||
cd rust/kcl-python-bindings
|
||||
uv venv .venv
|
||||
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
|
||||
echo "$PWD/.venv/bin" >> $GITHUB_PATH
|
||||
uv pip install pip --upgrade
|
||||
- name: Publish to PyPI
|
||||
uses: PyO3/maturin-action@v1
|
||||
env:
|
||||
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
||||
with:
|
||||
working-directory: rust/kcl-python-bindings
|
||||
command: upload
|
||||
args: --non-interactive --skip-existing wheels-*/*
|
55
.github/workflows/nix.yml
vendored
Normal file
55
.github/workflows/nix.yml
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
name: Test Nix Flake
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
nix-flake-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: nix flake check for all platforms
|
||||
run: |
|
||||
nix flake check --all-systems
|
||||
|
||||
nix-build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: nix build . for x86_64-linux
|
||||
run: nix build .
|
||||
|
||||
nix-build-macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: nix build . for x86_64-darwin
|
||||
run: nix build .
|
||||
|
6
.github/workflows/publish-apps-release.yml
vendored
6
.github/workflows/publish-apps-release.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Find tag workflow id
|
||||
id: tag_workflow_id
|
||||
@ -105,7 +105,7 @@ jobs:
|
||||
- name: Override release notes
|
||||
env:
|
||||
NOTES: ${{ github.event.release.body }}
|
||||
run: yarn files:set-notes
|
||||
run: npm run files:set-notes
|
||||
|
||||
- name: Authenticate to Google Cloud
|
||||
uses: 'google-github-actions/auth@v2.1.8'
|
||||
@ -126,7 +126,7 @@ jobs:
|
||||
destination: 'dl.kittycad.io/releases/modeling-app'
|
||||
|
||||
- name: Invalidate bucket cache on latest*.yml and last_download.json files
|
||||
run: yarn files:invalidate-bucket
|
||||
run: npm run files:invalidate-bucket
|
||||
|
||||
- name: Upload release files to Github
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
|
24
.github/workflows/ruff.yml
vendored
Normal file
24
.github/workflows/ruff.yml
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
name: ruff
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/ruff.yml
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/ruff.yml
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/ruff-action@v3
|
||||
|
180
.github/workflows/static-analysis.yml
vendored
180
.github/workflows/static-analysis.yml
vendored
@ -16,142 +16,114 @@ permissions:
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
yarn-fmt-check:
|
||||
npm-fmt-check:
|
||||
runs-on: 'ubuntu-22.04'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- run: yarn fmt-check
|
||||
cache: 'npm'
|
||||
- run: npm install
|
||||
- run: npm run fmt:check
|
||||
|
||||
yarn-build-wasm:
|
||||
runs-on: ubuntu-22.04
|
||||
npm-build-wasm:
|
||||
uses: ./.github/workflows/build-wasm.yml
|
||||
|
||||
npm-tsc:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- run: yarn build:wasm
|
||||
cache: 'npm'
|
||||
- run: npm install
|
||||
|
||||
yarn-tsc:
|
||||
runs-on: ubuntu-22.04
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run tsc
|
||||
|
||||
npm-lint:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: './src/wasm-lib'
|
||||
cache: 'npm'
|
||||
- run: npm install
|
||||
|
||||
- run: yarn build:wasm
|
||||
- run: yarn tsc
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
yarn-lint:
|
||||
runs-on: ubuntu-22.04
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run lint
|
||||
|
||||
npm-circular-dependencies:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- run: yarn lint
|
||||
cache: 'npm'
|
||||
- run: npm install
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run circular-deps:diff
|
||||
|
||||
python-codespell:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
- name: Install codespell
|
||||
run: |
|
||||
python -m pip install codespell
|
||||
- name: Run codespell
|
||||
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
|
||||
|
||||
yarn-unit-test-kcl-samples:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
|
||||
- run: yarn install
|
||||
- run: yarn build:wasm
|
||||
|
||||
- run: yarn simpleserver:bg
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
|
||||
- name: Install Chromium Browser
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: yarn playwright install chromium --with-deps
|
||||
|
||||
- name: run unit tests for kcl samples
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: yarn test:unit:kcl-samples
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
yarn-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'yarn'
|
||||
|
||||
- run: yarn install
|
||||
- run: yarn build:wasm
|
||||
|
||||
- run: yarn simpleserver:bg
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
|
||||
- name: Install Chromium Browser
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: yarn playwright install chromium --with-deps
|
||||
|
||||
- name: run unit tests
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: yarn test:unit
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
- name: check for changes
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
id: git-check
|
||||
run: |
|
||||
git add src/lang/std/artifactMapGraphs
|
||||
if git status src/lang/std/artifactMapGraphs | grep -q "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Commit changes, if any
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' && steps.git-check.outputs.modified == 'true' }}
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
# TODO when webkit works on ubuntu remove the os part of the commit message
|
||||
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
uses: crate-ci/typos@v1.32.0
|
||||
|
124
.github/workflows/unit-tests.yml
vendored
Normal file
124
.github/workflows/unit-tests.yml
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
name: Unit Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
npm-build-wasm:
|
||||
uses: ./.github/workflows/build-wasm.yml
|
||||
|
||||
npm-test-unit:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm install
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- run: npm run simpleserver:bg
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
|
||||
- name: Install Chromium Browser
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: npm run playwright install chromium --with-deps
|
||||
|
||||
- name: Run unit tests
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
run: xvfb-run -a npm run test:unit
|
||||
env:
|
||||
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||
|
||||
- name: Check for changes
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||
id: git-check
|
||||
run: |
|
||||
git add src/lang/std/artifactMapGraphs
|
||||
if git status src/lang/std/artifactMapGraphs | grep -q "Changes to be committed"
|
||||
then echo "modified=true" >> $GITHUB_OUTPUT
|
||||
else echo "modified=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit changes, if any
|
||||
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' && steps.git-check.outputs.modified == 'true' }}
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
echo ${{ github.head_ref }}
|
||||
git checkout ${{ github.head_ref }}
|
||||
# TODO when webkit works on ubuntu remove the os part of the commit message
|
||||
git commit -am "Look at this (photo)Graph *in the voice of Nickelback*" || true
|
||||
git push
|
||||
git push origin ${{ github.head_ref }}
|
||||
|
||||
npm-test-unit-components:
|
||||
runs-on: ubuntu-latest
|
||||
needs: npm-build-wasm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm install
|
||||
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
|
||||
with:
|
||||
tool: wasm-pack
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
- name: Copy prepared wasm
|
||||
run: |
|
||||
ls -R prepared-wasm
|
||||
cp prepared-wasm/kcl_wasm_lib_bg.wasm public
|
||||
mkdir rust/kcl-wasm-lib/pkg
|
||||
cp prepared-wasm/kcl_wasm_lib* rust/kcl-wasm-lib/pkg
|
||||
|
||||
- name: Copy prepared ts-rs bindings
|
||||
run: |
|
||||
ls -R prepared-ts-rs-bindings
|
||||
mkdir rust/kcl-lib/bindings
|
||||
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
|
||||
|
||||
- name: Run component tests
|
||||
run: npm run test:unit:components
|
5
.github/workflows/update-dev-branch.yml
vendored
5
.github/workflows/update-dev-branch.yml
vendored
@ -1,5 +1,8 @@
|
||||
name: update-dev-branch
|
||||
|
||||
# This is used to sync the `dev` branch with the `main` branch to continuously
|
||||
# deploy a second instance of the app to Vercel: https://app.dev.zoo.dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@ -26,4 +29,4 @@ jobs:
|
||||
# reset to main
|
||||
git reset --hard origin/main
|
||||
# force push it
|
||||
git push -f origin dev
|
||||
git push --force origin dev
|
||||
|
1
.github/workflows/vector.toml
vendored
1
.github/workflows/vector.toml
vendored
@ -8,6 +8,7 @@ include = ["/tmp/github-actions.log"]
|
||||
type = "remap"
|
||||
inputs = [ "github-actions-file" ]
|
||||
source = '''
|
||||
.platform = "OS_NAME"
|
||||
.action = "GITHUB_WORKFLOW"
|
||||
.repo = "GITHUB_REPOSITORY"
|
||||
.sha = "GITHUB_SHA"
|
||||
|
47
.gitignore
vendored
47
.gitignore
vendored
@ -1,7 +1,7 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
@ -26,16 +26,21 @@ yarn-error.log*
|
||||
.idea
|
||||
.vscode
|
||||
.helix
|
||||
src/wasm-lib/.idea
|
||||
src/wasm-lib/.vscode
|
||||
result
|
||||
|
||||
# rust
|
||||
src/wasm-lib/target
|
||||
src/wasm-lib/bindings
|
||||
src/wasm-lib/kcl/bindings
|
||||
public/wasm_lib_bg.wasm
|
||||
src/wasm-lib/lcov.info
|
||||
src/wasm-lib/grackle/test_json_output
|
||||
rust/target
|
||||
rust/kcl-lib/bindings
|
||||
rust/kcl-language-server/server
|
||||
public/kcl_wasm_lib_bg.wasm
|
||||
rust/lcov.info
|
||||
rust/kcl-wasm-lib/pkg
|
||||
*.snap.new
|
||||
rust/kcl-lib/fuzz/Cargo.lock
|
||||
rust/kcl-language-server-release/Cargo.lock
|
||||
|
||||
# kcl language server package
|
||||
rust/kcl-language-server/dist/
|
||||
|
||||
e2e/playwright/playwright-secrets.env
|
||||
e2e/playwright/temp1.png
|
||||
@ -47,27 +52,39 @@ e2e/playwright/**/*.png
|
||||
e2e/playwright/export-snapshots/*
|
||||
!e2e/playwright/export-snapshots/*.png
|
||||
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
|
||||
trace.zip
|
||||
|
||||
/kcl-samples
|
||||
/public/kcl-samples.zip
|
||||
/public/kcl-samples/.github
|
||||
/public/kcl-samples/screenshots/main.kcl
|
||||
/public/kcl-samples/step/main.kcl
|
||||
/public/kcl-samples/internal
|
||||
/rust/kcl-lib/tests/kcl_samples/internal
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/blob-report/
|
||||
/playwright/.cache/
|
||||
/src/lang/std/artifactMapCache
|
||||
|
||||
|
||||
## generated files
|
||||
src/**/*.typegen.ts
|
||||
|
||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
||||
Mac_App_Distribution.provisionprofile
|
||||
|
||||
*.tsbuildinfo
|
||||
src/wasm-lib/pkg
|
||||
|
||||
.eslintcache
|
||||
venv
|
||||
.vite/
|
||||
|
||||
# electron
|
||||
out/
|
||||
|
||||
# python
|
||||
__pycache__/
|
||||
uv.lock
|
||||
dist
|
||||
venv
|
||||
|
||||
.vscode-test
|
||||
.biome/
|
||||
.million
|
||||
|
@ -5,6 +5,6 @@ command = "vscode-eslint-language-server"
|
||||
[[language]]
|
||||
name = "typescript"
|
||||
auto-format = true
|
||||
formatter = { command = "node_modules/.bin/prettier", args = ["--parser", "typescript"] }
|
||||
language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
|
||||
formatter = { command = "./node_modules/@biomejs/biome/bin/biome", args = ["format", "--write", "--stdin-file-path=foo.ts"] }
|
||||
# language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
|
||||
|
||||
|
1
.husky/pre-commit
Executable file
1
.husky/pre-commit
Executable file
@ -0,0 +1 @@
|
||||
npm run fmt
|
@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn fmt-check
|
@ -7,10 +7,10 @@ coverage
|
||||
*.rs
|
||||
*.hbs
|
||||
target
|
||||
src/wasm-lib/pkg
|
||||
src/wasm-lib/kcl/bindings
|
||||
e2e/playwright/export-snapshots
|
||||
e2e/playwright/snapshots/prompt-to-edit
|
||||
|
||||
|
||||
# XState generated files
|
||||
src/machines/**.typegen.ts
|
||||
.vscode-test
|
||||
|
309
CONTRIBUTING.md
Normal file
309
CONTRIBUTING.md
Normal file
@ -0,0 +1,309 @@
|
||||
# Contributor Guide
|
||||
|
||||
## Running a development build
|
||||
|
||||
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
|
||||
|
||||
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
|
||||
|
||||
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
|
||||
|
||||
```
|
||||
fnm install --corepack-enabled
|
||||
fnm use
|
||||
```
|
||||
|
||||
Install the NPM dependencies with:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
|
||||
|
||||
```
|
||||
# macOS/Linux
|
||||
npm run install:rust
|
||||
npm run install:wasm-pack:sh
|
||||
|
||||
# Windows
|
||||
npm run install:rust:windows
|
||||
npm run install:wasm-pack:cargo
|
||||
```
|
||||
|
||||
Then to build the WASM layer, run:
|
||||
|
||||
```
|
||||
# macOS/Linux
|
||||
npm run build:wasm
|
||||
|
||||
# Windows
|
||||
npm run build:wasm:windows
|
||||
```
|
||||
|
||||
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `npm run install:tools:windows`.
|
||||
|
||||
```
|
||||
# macOS/Linux
|
||||
npm run fetch:wasm
|
||||
|
||||
# Windows
|
||||
npm run fetch:wasm:windows
|
||||
```
|
||||
|
||||
That will build the WASM binary and put in the `public` dir (though gitignored).
|
||||
|
||||
Finally, to run the web app only, run:
|
||||
|
||||
```
|
||||
npm start
|
||||
```
|
||||
|
||||
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
||||
|
||||
### Development environment variables
|
||||
|
||||
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
|
||||
|
||||
### Developing in Chrome
|
||||
|
||||
Chrome is in the process of rolling out a new default which
|
||||
[blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/).
|
||||
If you're having trouble logging into the `modeling-app`, you may need to
|
||||
enable third-party cookies. You can enable third-party cookies by clicking on
|
||||
the eye with a slash through it in the URL bar, and clicking on "Enable
|
||||
Third-Party Cookies".
|
||||
|
||||
## Desktop
|
||||
|
||||
To spin up the desktop app, `npm install` and `npm run build:wasm` need to have been done before hand then:
|
||||
|
||||
```
|
||||
npm run tron:start
|
||||
```
|
||||
|
||||
This will start the application and hot-reload on changes.
|
||||
|
||||
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
|
||||
|
||||
To package the app for your platform with electron-builder, run `npm run tronb:package:dev` (or `npm run tronb:package:prod` to point to the .env.production variables).
|
||||
|
||||
## Checking out commits / Bisecting
|
||||
|
||||
Which commands from setup are one off vs. need to be run every time?
|
||||
|
||||
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run build:wasm
|
||||
npm start
|
||||
```
|
||||
|
||||
## Before submitting a PR
|
||||
|
||||
Before you submit a contribution PR to this repo, please ensure that:
|
||||
|
||||
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
|
||||
- You have separated out refactoring commits from feature commits as much as possible
|
||||
- You have run all of the following commands locally:
|
||||
- `npm run fmt`
|
||||
- `npm run tsc`
|
||||
- `npm run test`
|
||||
- Here they are all together: `npm run fmt && npm run tsc && npm run test`
|
||||
|
||||
## Release a new version
|
||||
|
||||
#### 1. Create a 'Cut release $VERSION' issue
|
||||
|
||||
It will be used to document changelog discussions and release testing.
|
||||
|
||||
https://github.com/KittyCAD/modeling-app/issues/new
|
||||
|
||||
#### 2. Push a new tag
|
||||
|
||||
Create a new tag and push it to the repo. The `semantic-release.sh` script will automatically bump the minor part, which we use the most. For instance going from `v0.27.0` to `v0.28.0`.
|
||||
|
||||
```
|
||||
VERSION=$(./scripts/semantic-release.sh)
|
||||
git tag $VERSION
|
||||
git push origin --tags
|
||||
```
|
||||
|
||||
This will trigger the `build-apps` workflow, set the version, build & sign the apps, and generate release files.
|
||||
|
||||
The workflow should be listed right away [in this list](https://github.com/KittyCAD/modeling-app/actions/workflows/build-apps.yml?query=event%3Apush)).
|
||||
|
||||
#### 3. Manually test artifacts
|
||||
|
||||
##### Release builds
|
||||
|
||||
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in 2.).
|
||||
|
||||
Manually test against this [list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
|
||||
|
||||
A prompt should show up asking for a downgrade to the last release version. Running through that at the end of testing
|
||||
and making sure the current release candidate has the ability to be updated to what electron-updater points to is critical,
|
||||
but what is actually being downloaded and installed isn't.
|
||||
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing.
|
||||
|
||||
```
|
||||
# Windows (PowerShell)
|
||||
& 'C:\Program Files\Zoo Design Studio\Zoo Design Studio.exe'
|
||||
|
||||
# macOS
|
||||
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
|
||||
|
||||
# Linux
|
||||
./Zoo Design Studio-{version}-{arch}-linux.AppImage
|
||||
```
|
||||
|
||||
#### 4. Publish the release
|
||||
|
||||
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
|
||||
|
||||
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
|
||||
|
||||
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
|
||||
|
||||
#### 5. Close the issue
|
||||
|
||||
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
|
||||
|
||||
## Fuzzing the parser
|
||||
|
||||
Make sure you install cargo fuzz:
|
||||
|
||||
```bash
|
||||
$ cargo install cargo-fuzz
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cd rust/kcl-lib
|
||||
|
||||
# list the fuzz targets
|
||||
$ cargo fuzz list
|
||||
|
||||
# run the parser fuzzer
|
||||
$ cargo +nightly fuzz run parser
|
||||
```
|
||||
|
||||
For more information on fuzzing you can check out
|
||||
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
|
||||
|
||||
## Tests
|
||||
|
||||
### Playwright tests
|
||||
|
||||
Prepare these system dependencies:
|
||||
|
||||
- Set $token from https://zoo.dev/account/api-tokens
|
||||
|
||||
#### Snapshot tests (Google Chrome on Ubuntu only)
|
||||
|
||||
Only Ubunu and Google Chrome is supported for the set of tests evaluating screenshot snapshots.
|
||||
If you don't run Ubuntu locally or in a VM, you may use a GitHub Codespace.
|
||||
```
|
||||
npm run playwright -- install chrome
|
||||
npm run test:snapshots
|
||||
```
|
||||
You may use `-- --update-snapshots` as needed.
|
||||
|
||||
#### Electron flow tests (Chromium on Ubuntu, macOS, Windows)
|
||||
|
||||
```
|
||||
npm run playwright -- install chromium
|
||||
npm run test:playwright:electron:local
|
||||
```
|
||||
You may use `-- -g "my test"` to match specific test titles, or `-- path/to/file.spec.ts` for a test file.
|
||||
|
||||
#### Debugger
|
||||
|
||||
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
|
||||
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
|
||||
|
||||
If you want to limit to a single browser use `--project="webkit"` or `firefox`, `Google Chrome`
|
||||
Or comment out browsers in `playwright.config.ts`.
|
||||
|
||||
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
|
||||
|
||||
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `npm run playwright codegen -b wk --load-storage ./store localhost:3000`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
Where `./store` should look like this
|
||||
|
||||
</summary>
|
||||
|
||||
```JSON
|
||||
{
|
||||
"cookies": [],
|
||||
"origins": [
|
||||
{
|
||||
"origin": "http://localhost:3000",
|
||||
"localStorage": [
|
||||
{
|
||||
"name": "store",
|
||||
"value": "{\"state\":{\"openPanes\":[\"code\"]},\"version\":0}"
|
||||
},
|
||||
{
|
||||
"name": "persistCode",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "TOKEN_PERSIST_KEY",
|
||||
"value": "your-token"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
|
||||
|
||||
### Unit and component tests
|
||||
|
||||
If you already haven't, run the following:
|
||||
|
||||
```
|
||||
npm
|
||||
npm run build:wasm
|
||||
npm start
|
||||
```
|
||||
|
||||
and finally:
|
||||
|
||||
```
|
||||
npm run test:unit
|
||||
```
|
||||
|
||||
For individual testing:
|
||||
|
||||
```
|
||||
npm run test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
||||
```
|
||||
|
||||
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
|
||||
|
||||
### Rust tests
|
||||
|
||||
Prepare these system dependencies:
|
||||
|
||||
- Set `$KITTYCAD_API_TOKEN` from https://zoo.dev/account/api-tokens
|
||||
- Install `just` following [these instructions](https://just.systems/man/en/packages.html)
|
||||
|
||||
then run tests that target the KCL language:
|
||||
|
||||
```
|
||||
npm run test:rust
|
||||
```
|
||||
|
||||
### Logging
|
||||
|
||||
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
|
||||
|
||||
To enable memory metrics, build with `--features dhat-heap`.
|
20
INSTALL.md
20
INSTALL.md
@ -1,27 +1,27 @@
|
||||
# Setting Up Zoo Modeling App
|
||||
# Setting Up Zoo Design Studio
|
||||
|
||||
Compared to other CAD software, getting Zoo Modeling App up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
|
||||
Compared to other CAD software, getting Zoo Design Studio up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
|
||||
|
||||
## Windows
|
||||
|
||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
|
||||
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
|
||||
|
||||
2. Once downloaded, run the installer `Zoo Modeling App-{version}-{arch}-win.exe` which should take a few seconds.
|
||||
2. Once downloaded, run the installer `Zoo Design Studio-{version}-{arch}-win.exe` which should take a few seconds.
|
||||
|
||||
3. The installation happens at `C:\Program Files\Zoo Modeling App`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
|
||||
3. The installation happens at `C:\Program Files\Zoo Design Studio`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
|
||||
|
||||
## macOS
|
||||
|
||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
|
||||
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
|
||||
|
||||
2. Once downloaded, open the disk image `Zoo Modeling App-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
|
||||
2. Once downloaded, open the disk image `Zoo Design Studio-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
|
||||
|
||||
3. You can then open your `Applications` directory and double-click on `Zoo Modeling App` to open.
|
||||
3. You can then open your `Applications` directory and double-click on `Zoo Design Studio` to open.
|
||||
|
||||
|
||||
## Linux
|
||||
|
||||
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
|
||||
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
|
||||
|
||||
2. Install the dependencies needed to run the [AppImage format](https://appimage.org/).
|
||||
- On Ubuntu, install the FUSE library with these commands in a terminal.
|
||||
@ -30,7 +30,7 @@ Compared to other CAD software, getting Zoo Modeling App up and running is quick
|
||||
sudo apt install libfuse2
|
||||
```
|
||||
- Optionally, follow [these steps](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md#initial-setup) to install `appimaged`. It is a daemon that makes interacting with AppImage files more seamless.
|
||||
- Once installed, copy the downloaded `Zoo Modeling App-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
|
||||
- Once installed, copy the downloaded `Zoo Design Studio-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
|
||||
|
||||
- `appimaged` should automatically find it and make it executable. If not, run:
|
||||
```bash
|
||||
|
178
Makefile
178
Makefile
@ -1,25 +1,171 @@
|
||||
.PHONY: dev
|
||||
.PHONY: all
|
||||
all: install check build
|
||||
|
||||
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
|
||||
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
||||
###############################################################################
|
||||
# INSTALL
|
||||
|
||||
dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
|
||||
yarn start
|
||||
ifeq ($(OS),Windows_NT)
|
||||
export WINDOWS := true
|
||||
ifndef MSYSTEM
|
||||
export POWERSHELL := true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef WINDOWS
|
||||
CARGO ?= $(USERPROFILE)/.cargo/bin/cargo.exe
|
||||
WASM_PACK ?= $(USERPROFILE)/.cargo/bin/wasm-pack.exe
|
||||
else
|
||||
CARGO ?= $(shell which cargo || echo ~/.cargo/bin/cargo)
|
||||
WASM_PACK ?= $(shell which wasm-pack || echo ~/.cargo/bin/wasm-pack)
|
||||
endif
|
||||
|
||||
.PHONY: install
|
||||
install: node_modules/.package-lock.json $(CARGO) $(WASM_PACK) ## Install dependencies
|
||||
|
||||
node_modules/.package-lock.json: package.json package-lock.json
|
||||
npm prune
|
||||
npm install
|
||||
|
||||
$(CARGO):
|
||||
ifdef WINDOWS
|
||||
npm run install:rust:windows
|
||||
else
|
||||
npm run install:rust
|
||||
endif
|
||||
|
||||
$(WASM_PACK):
|
||||
ifdef WINDOWS
|
||||
npm run install:wasm-pack:cargo
|
||||
else
|
||||
npm run install:wasm-pack:sh
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# BUILD
|
||||
|
||||
CARGO_SOURCES := rust/.cargo/config.toml $(wildcard rust/Cargo.*) $(wildcard rust/**/Cargo.*)
|
||||
KCL_SOURCES := $(wildcard public/kcl-samples/**/*.kcl)
|
||||
RUST_SOURCES := $(wildcard rust/**/*.rs)
|
||||
|
||||
REACT_SOURCES := $(wildcard src/*.tsx) $(wildcard src/**/*.tsx)
|
||||
TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts)
|
||||
VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
|
||||
|
||||
.PHONY: build
|
||||
build: install public/kcl_wasm_lib_bg.wasm public/kcl-samples/manifest.json .vite/build/main.js
|
||||
|
||||
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
|
||||
ifdef WINDOWS
|
||||
npm run build:wasm:dev:windows
|
||||
else
|
||||
npm run build:wasm:dev
|
||||
endif
|
||||
|
||||
public/kcl-samples/manifest.json: $(KCL_SOURCES)
|
||||
cd rust/kcl-lib && EXPECTORATE=overwrite cargo test generate_manifest
|
||||
|
||||
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
|
||||
npm run tronb:vite:dev
|
||||
|
||||
###############################################################################
|
||||
# CHECK
|
||||
|
||||
.PHONY: check
|
||||
check: format lint
|
||||
|
||||
.PHONY: format
|
||||
format: install ## Format the code
|
||||
npm run fmt
|
||||
|
||||
.PHONY: lint
|
||||
lint: install ## Lint the code
|
||||
npm run tsc
|
||||
npm run lint
|
||||
|
||||
###############################################################################
|
||||
# RUN
|
||||
|
||||
TARGET ?= desktop
|
||||
|
||||
.PHONY: run
|
||||
run: run-$(TARGET)
|
||||
|
||||
.PHONY: run-web
|
||||
run-web: install build ## Start the web app
|
||||
npm run start
|
||||
|
||||
.PHONY: run-desktop
|
||||
run-desktop: install build ## Start the desktop app
|
||||
npm run tron:start
|
||||
|
||||
###############################################################################
|
||||
# TEST
|
||||
|
||||
E2E_GREP ?=
|
||||
E2E_WORKERS ?=
|
||||
E2E_FAILURES ?= 1
|
||||
|
||||
.PHONY: test
|
||||
test: test-unit test-e2e
|
||||
|
||||
.PHONY: test-unit
|
||||
test-unit: install ## Run the unit tests
|
||||
npm run test:rust
|
||||
npm run test:unit:components
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
npm run test:unit
|
||||
|
||||
.PHONY: test-e2e
|
||||
test-e2e: test-e2e-$(TARGET)
|
||||
|
||||
.PHONY: test-e2e-web
|
||||
test-e2e-web: install build ## Run the web e2e tests
|
||||
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
|
||||
ifdef E2E_GREP
|
||||
npm run chrome:test -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||
else
|
||||
npm run chrome:test -- --headed --workers='100%'
|
||||
endif
|
||||
|
||||
.PHONY: test-e2e-desktop
|
||||
test-e2e-desktop: install build ## Run the desktop e2e tests
|
||||
ifdef E2E_GREP
|
||||
npm run test:playwright:electron -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
|
||||
else
|
||||
npm run test:playwright:electron -- --workers='100%'
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
# CLEAN
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Delete all artifacts
|
||||
ifdef POWERSHELL
|
||||
git clean --force -d -x --exclude=.env* --exclude=**/*.env
|
||||
else
|
||||
rm -rf .vite/ build/
|
||||
rm -rf trace.zip playwright-report/ test-results/
|
||||
rm -rf public/kcl_wasm_lib_bg.wasm
|
||||
rm -rf rust/*/bindings/ rust/*/pkg/ rust/target/
|
||||
rm -rf node_modules/ rust/*/node_modules/
|
||||
endif
|
||||
|
||||
.PHONY: help
|
||||
help: install
|
||||
ifdef POWERSHELL
|
||||
@ powershell -Command "Get-Content $(MAKEFILE_LIST) | Select-String -Pattern '^[^\s]+:.*##\s.*$$' | ForEach-Object { $$line = $$_.Line -split ':.*?##\s+'; Write-Host -NoNewline $$line[0].PadRight(30) -ForegroundColor Cyan; Write-Host $$line[1] }"
|
||||
else
|
||||
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||
endif
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
###############################################################################
|
||||
|
||||
# I'm sorry this is so specific to my setup you may as well ignore this.
|
||||
# This is so you don't have to deal with electron windows popping up constantly.
|
||||
# It should work for you other Linux users.
|
||||
lee-electron-test:
|
||||
Xephyr -br -ac -noreset -screen 1200x500 :2 &
|
||||
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn tron:test -g "when using the file tree"
|
||||
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ npm run tron:test -g "when using the file tree"
|
||||
killall Xephyr
|
||||
|
||||
$(XSTATE_TYPEGENS): $(TS_SRC)
|
||||
yarn xstate typegen 'src/**/*.ts?(x)'
|
||||
|
||||
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
|
||||
yarn build:wasm
|
||||
|
||||
node_modules: package.json yarn.lock
|
||||
yarn install
|
||||
|
452
README.md
452
README.md
@ -1,17 +1,17 @@
|
||||

|
||||

|
||||
|
||||
## Zoo Modeling App
|
||||
# Zoo Design Studio
|
||||
|
||||
download at [zoo.dev/modeling-app/download](https://zoo.dev/modeling-app/download)
|
||||
[zoo.dev/modeling-app](https://zoo.dev/modeling-app)
|
||||
|
||||
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
|
||||
|
||||
Modeling App is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
|
||||
Design Studio is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
|
||||
|
||||
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
|
||||
- This makes version control—which is a solved problem in software engineering—trivial for CAD
|
||||
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
|
||||
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Modeling App
|
||||
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Design Studio
|
||||
- Everything graphics _has_ to be built for the GPU
|
||||
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
|
||||
- Make the resource-intensive pieces of an application auto-scaling
|
||||
@ -19,11 +19,11 @@ Modeling App is our take on what a modern modelling experience can be. It is app
|
||||
|
||||
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
|
||||
|
||||
Modeling App is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
|
||||
Design Studio is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
|
||||
|
||||
The 3D view in Modeling App is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
|
||||
The 3D view in Design Studio is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
|
||||
|
||||
## Tools
|
||||
## Technology
|
||||
|
||||
- UI
|
||||
- [React](https://react.dev/)
|
||||
@ -34,442 +34,18 @@ The 3D view in Modeling App is just a video stream from our hosted geometry engi
|
||||
- WebSockets (via [KittyCAD TS client](https://github.com/KittyCAD/kittycad.ts))
|
||||
- Code Editor
|
||||
- [CodeMirror](https://codemirror.net/)
|
||||
- Custom WASM LSP Server
|
||||
- [Custom WASM LSP Server](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib/src/lsp/kcl)
|
||||
- Modeling
|
||||
- [KittyCAD TypeScript client](https://github.com/KittyCAD/kittycad.ts)
|
||||
|
||||
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
|
||||
## Get Started
|
||||
|
||||
[Original demo slides](https://github.com/KittyCAD/Eng/files/10398178/demo.pdf)
|
||||
We recommend downloading the latest application binary from our [releases](https://github.com/KittyCAD/modeling-app/releases) page. If you don't see your platform or architecture supported there, please file an issue.
|
||||
|
||||
## Get started
|
||||
## Developing
|
||||
|
||||
We recommend downloading the latest application binary from [our Releases page](https://github.com/KittyCAD/modeling-app/releases). If you don't see your platform or architecture supported there, please file an issue.
|
||||
|
||||
## Running a development build
|
||||
|
||||
First, [install Rust via `rustup`](https://www.rust-lang.org/tools/install). This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We always use the latest stable version of Rust, so you may need to run `rustup update stable`. Then, run:
|
||||
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
followed by:
|
||||
|
||||
```
|
||||
yarn build:wasm
|
||||
```
|
||||
|
||||
or if you have the gh cli installed
|
||||
|
||||
```
|
||||
./get-latest-wasm-bundle.sh # this will download the latest main wasm bundle
|
||||
```
|
||||
|
||||
That will build the WASM binary and put in the `public` dir (though gitignored).
|
||||
|
||||
Finally, to run the web app only, run:
|
||||
|
||||
```
|
||||
yarn start
|
||||
```
|
||||
|
||||
If you're not an KittyCAD employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to localhost:3000 again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
|
||||
|
||||
### Development environment variables
|
||||
|
||||
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
|
||||
|
||||
### Developing in Chrome
|
||||
|
||||
Chrome is in the process of rolling out a new default which
|
||||
[blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/).
|
||||
If you're having trouble logging into the `modeling-app`, you may need to
|
||||
enable third-party cookies. You can enable third-party cookies by clicking on
|
||||
the eye with a slash through it in the URL bar, and clicking on "Enable
|
||||
Third-Party Cookies".
|
||||
|
||||
## Desktop
|
||||
|
||||
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then
|
||||
|
||||
```
|
||||
yarn tron:start
|
||||
```
|
||||
|
||||
This will start the application and hot-reload on changes.
|
||||
|
||||
Devtools can be opened with the usual Cmd-Opt-I (Mac) or Ctrl-Shift-I (Linux and Windows).
|
||||
|
||||
To build with electron-builder, run `yarn tronb:package:dev` (or `yarn tronb:package:prod` to point to the .env.production variables)
|
||||
|
||||
## Checking out commits / Bisecting
|
||||
|
||||
Which commands from setup are one off vs need to be run every time?
|
||||
|
||||
The following will need to be run when checking out a new commit and guarantees the build is not stale:
|
||||
```bash
|
||||
yarn install
|
||||
yarn build:wasm
|
||||
yarn start # or yarn build:local && yarn serve for slower but more production-like build
|
||||
```
|
||||
|
||||
## Before submitting a PR
|
||||
|
||||
Before you submit a contribution PR to this repo, please ensure that:
|
||||
|
||||
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
|
||||
- You have separated out refactoring commits from feature commits as much as possible
|
||||
- You have run all of the following commands locally:
|
||||
- `yarn fmt`
|
||||
- `yarn tsc`
|
||||
- `yarn test`
|
||||
- Here they are all together: `yarn fmt && yarn tsc && yarn test`
|
||||
|
||||
## Release a new version
|
||||
|
||||
#### 1. Create a 'Cut release $VERSION' issue
|
||||
|
||||
It will be used to document changelog discussions and release testing.
|
||||
|
||||
https://github.com/KittyCAD/modeling-app/issues/new
|
||||
|
||||
#### 2. Push a new tag
|
||||
|
||||
Create a new tag and push it to the repo. The `semantic-release.sh` script will automatically bump the minor part, which we use the most. For instance going from `v0.27.0` to `v0.28.0`.
|
||||
|
||||
```
|
||||
VERSION=$(./scripts/semantic-release.sh)
|
||||
git tag $VERSION
|
||||
git push origin --tags
|
||||
```
|
||||
|
||||
This will trigger the `build-apps` workflow, set the version, build & sign the apps, and generate release files as well as updater-test artifacts.
|
||||
|
||||
The workflow should be listed right away [in this list](https://github.com/KittyCAD/modeling-app/actions/workflows/build-apps.yml?query=event%3Apush)).
|
||||
|
||||
#### 3. Manually test artifacts
|
||||
|
||||
##### Release builds
|
||||
|
||||
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in 2.).
|
||||
|
||||
Manually test against this [list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
|
||||
|
||||
##### Updater-test builds
|
||||
|
||||
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
|
||||
|
||||
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
|
||||
|
||||
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
|
||||
```
|
||||
# Windows (PowerShell)
|
||||
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
|
||||
|
||||
# macOS
|
||||
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
|
||||
|
||||
# Linux
|
||||
./Zoo Modeling App-{version}-{arch}-linux.AppImage
|
||||
```
|
||||
|
||||
#### 4. Publish the release
|
||||
|
||||
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
|
||||
|
||||
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
|
||||
|
||||
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
|
||||
|
||||
#### 5. Close the issue
|
||||
|
||||
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
|
||||
|
||||
|
||||
## Fuzzing the parser
|
||||
|
||||
Make sure you install cargo fuzz:
|
||||
|
||||
```bash
|
||||
$ cargo install cargo-fuzz
|
||||
```
|
||||
|
||||
```bash
|
||||
$ cd src/wasm-lib/kcl
|
||||
|
||||
# list the fuzz targets
|
||||
$ cargo fuzz list
|
||||
|
||||
# run the parser fuzzer
|
||||
$ cargo +nightly fuzz run parser
|
||||
```
|
||||
|
||||
For more information on fuzzing you can check out
|
||||
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
|
||||
|
||||
## Tests
|
||||
|
||||
### Playwright tests
|
||||
|
||||
You will need a `./e2e/playwright/playwright-secrets.env` file:
|
||||
|
||||
```bash
|
||||
$ touch ./e2e/playwright/playwright-secrets.env
|
||||
$ cat ./e2e/playwright/playwright-secrets.env
|
||||
token=<dev.zoo.dev/account/api-tokens>
|
||||
snapshottoken=<your-snapshot-token>
|
||||
```
|
||||
|
||||
For a portable way to run Playwright you'll need Docker.
|
||||
|
||||
#### Generic example
|
||||
After that, open a terminal and run:
|
||||
|
||||
```bash
|
||||
docker run --network host --rm --init -it playwright/chrome:playwright-x.xx.x
|
||||
```
|
||||
|
||||
and in another terminal, run:
|
||||
|
||||
```bash
|
||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
|
||||
```
|
||||
|
||||
|
||||
#### Specific example
|
||||
|
||||
open a terminal and run:
|
||||
|
||||
```bash
|
||||
docker run --network host --rm --init -it playwright/chrome:playwright-1.46.0
|
||||
```
|
||||
|
||||
and in another terminal, run:
|
||||
|
||||
```bash
|
||||
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" e2e/playwright/command-bar-tests.spec.ts
|
||||
```
|
||||
|
||||
run a specific test change the test from `test('...` to `test.only('...`
|
||||
(note if you commit this, the tests will instantly fail without running any of the tests)
|
||||
|
||||
|
||||
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
|
||||
|
||||
run headed
|
||||
|
||||
```
|
||||
yarn playwright test --headed
|
||||
```
|
||||
|
||||
run with step through debugger
|
||||
|
||||
```
|
||||
PWDEBUG=1 yarn playwright test
|
||||
```
|
||||
|
||||
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
|
||||
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
|
||||
|
||||
If you want to limit to a single browser use `--project="webkit"` or `firefox`, `Google Chrome`
|
||||
Or comment out browsers in `playwright.config.ts`.
|
||||
|
||||
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
|
||||
|
||||
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `yarn playwright codegen -b wk --load-storage ./store localhost:3000`
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
|
||||
Where `./store` should look like this
|
||||
|
||||
</summary>
|
||||
|
||||
```JSON
|
||||
{
|
||||
"cookies": [],
|
||||
"origins": [
|
||||
{
|
||||
"origin": "http://localhost:3000",
|
||||
"localStorage": [
|
||||
{
|
||||
"name": "store",
|
||||
"value": "{\"state\":{\"openPanes\":[\"code\"]},\"version\":0}"
|
||||
},
|
||||
{
|
||||
"name": "persistCode",
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"name": "TOKEN_PERSIST_KEY",
|
||||
"value": "your-token"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
|
||||
|
||||
### Unit and component tests
|
||||
|
||||
If you already haven't, run the following:
|
||||
|
||||
```
|
||||
yarn
|
||||
yarn build:wasm
|
||||
yarn start
|
||||
```
|
||||
|
||||
and finally:
|
||||
|
||||
```
|
||||
yarn test:unit
|
||||
```
|
||||
|
||||
For individual testing:
|
||||
|
||||
```
|
||||
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
|
||||
```
|
||||
|
||||
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
|
||||
|
||||
### Rust tests
|
||||
|
||||
**Dependencies**
|
||||
|
||||
- `KITTYCAD_API_TOKEN`
|
||||
- `cargo-nextest`
|
||||
- `just`
|
||||
|
||||
#### Setting KITTYCAD_API_TOKEN
|
||||
Use the production zoo.dev token, set this environment variable before running the tests
|
||||
|
||||
#### Installing cargonextest
|
||||
|
||||
```
|
||||
cd src/wasm-lib
|
||||
cargo search cargo-nextest
|
||||
cargo install cargo-nextest
|
||||
```
|
||||
|
||||
#### just
|
||||
install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-binaries)
|
||||
|
||||
#### Running the tests
|
||||
|
||||
```bash
|
||||
# With just
|
||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||
# Make sure you installed cargo-nextest
|
||||
# Make sure you installed just
|
||||
cd src/wasm-lib
|
||||
just test
|
||||
```
|
||||
|
||||
```bash
|
||||
# Without just
|
||||
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
|
||||
# Make sure you installed cargo-nextest
|
||||
cd src/wasm-lib
|
||||
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
|
||||
```
|
||||
|
||||
Where `XXX` is an API token from the production engine (NOT the dev environment).
|
||||
|
||||
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
|
||||
|
||||
```
|
||||
cd src/wasm-lib
|
||||
KITTYCAD_API_TOKEN=XXX cargo run nextest
|
||||
```
|
||||
|
||||
### Mapping CI CD jobs to local commands
|
||||
|
||||
When you see the CI CD fail on jobs you may wonder three things
|
||||
- Do I have a bug in my code?
|
||||
- Is the test flaky?
|
||||
- Is there a bug in `main`?
|
||||
|
||||
To answer these questions the following commands will give you confidence to locate the issue.
|
||||
|
||||
#### Static Analysis
|
||||
|
||||
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
|
||||
|
||||
The following set of commands should get us closer to one and done commands to instantly retest issues.
|
||||
|
||||
```
|
||||
yarn test-setup
|
||||
```
|
||||
|
||||
> Gotcha, are packages up to date and is the wasm built?
|
||||
|
||||
|
||||
```
|
||||
yarn tsc
|
||||
yarn fmt-check
|
||||
yarn lint
|
||||
yarn test:unit:local
|
||||
```
|
||||
|
||||
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
|
||||
|
||||
#### E2E Tests
|
||||
|
||||
**Playwright Electron**
|
||||
|
||||
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
|
||||
|
||||
```
|
||||
yarn test:playwright:electron:local
|
||||
yarn test:playwright:electron:windows:local
|
||||
yarn test:playwright:electron:macos:local
|
||||
yarn test:playwright:electron:ubuntu:local
|
||||
```
|
||||
|
||||
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
|
||||
|
||||
#### Some notes on CI
|
||||
|
||||
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.
|
||||
|
||||
How to interpret failing playwright tests?
|
||||
If your tests fail, click through to the action and see that the tests failed on a line that includes `await page.getByTestId('loading').waitFor({ state: 'detached' })`, this means the test fail because the stream never started. It's you choice if you want to re-run the test, or ignore the failure.
|
||||
|
||||
We run on ubuntu and macos, because safari doesn't work on linux because of the dreaded "no RTCPeerConnection variable" error. But linux runs first and then macos for the same reason that we limit the number of parallel tests to 1 because we limit stream connections per user, so tests would start failing we if let them run together.
|
||||
|
||||
If something fails on CI you can download the artifact, unzip it and then open `playwright-report/data/<UUID>.zip` with https://trace.playwright.dev/ to see what happened.
|
||||
|
||||
#### Getting started writing a playwright test in our app
|
||||
|
||||
Besides following the instructions above and using the playwright docs, our app is weird because of the whole stream thing, which means our testing is weird. Because we've just figured out this stuff and therefore docs might go stale quick here's a 15min vid/tutorial
|
||||
|
||||
https://github.com/KittyCAD/modeling-app/assets/29681384/6f5e8e85-1003-4fd9-be7f-f36ce833942d
|
||||
|
||||
<details>
|
||||
|
||||
<summary>
|
||||
PS: for the debug panel, the following JSON is useful for snapping the camera
|
||||
</summary>
|
||||
|
||||
```JSON
|
||||
{"type":"modeling_cmd_req","cmd_id":"054e5472-e5e9-4071-92d7-1ce3bac61956","cmd":{"type":"default_camera_look_at","center":{"x":15,"y":0,"z":0},"up":{"x":0,"y":0,"z":1},"vantage":{"x":30,"y":30,"z":30}}}
|
||||
```
|
||||
|
||||
</details>
|
||||
Finally, if you'd like to run a development build or contribute to the project, please visit our [contributor guide](CONTRIBUTING.md) to get started.
|
||||
|
||||
## KCL
|
||||
|
||||
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/src/wasm-lib/kcl).
|
||||
|
||||
### Logging
|
||||
|
||||
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
|
||||
|
||||
To enable memory metrics, build with `--features dhat-heap`.
|
||||
To contribute to the KittyCAD Language, see the [README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib) for KCL.
|
||||
|
40
_typos.toml
Normal file
40
_typos.toml
Normal file
@ -0,0 +1,40 @@
|
||||
[files]
|
||||
extend-exclude = [
|
||||
"**/target",
|
||||
"node_modules",
|
||||
"build",
|
||||
"dist",
|
||||
"out",
|
||||
"**/Cargo.lock",
|
||||
"docs/**/*.md",
|
||||
"docs/**/*.json",
|
||||
"e2e/playwright/lib/console-error-whitelist.ts",
|
||||
".package-lock.json",
|
||||
"**/package-lock.json",
|
||||
"openapi/*.json",
|
||||
"packages/codemirror-lang-kcl/test/all.test.ts",
|
||||
"public/kcl-samples",
|
||||
"rust/kcl-lib/tests/kcl_samples",
|
||||
"tsconfig.tsbuildinfo",
|
||||
"src/lib/machine-api.d.ts",
|
||||
"kcl-book/book",
|
||||
]
|
||||
|
||||
[default.extend-words]
|
||||
metalness = "metalness" # appearance API
|
||||
Hom = "Hom" # short for homogenous
|
||||
typ = "typ" # used to declare a variable named 'type' which is a reserved keyword in Rust
|
||||
ue = "ue" # short for UnaryExpression
|
||||
THRE = "THRE" # Weird bug that wrongly detects THREEjs as a typo
|
||||
nwo = "nwo" # don't know what this is about tbh
|
||||
"ot" = "ot" # some abbreviation, idk what
|
||||
"oe" = "oe" # some abbreviation, idk what
|
||||
"colinear" = "colinear" # some engine shit, kidding
|
||||
|
||||
[default]
|
||||
extend-ignore-identifiers-re = [
|
||||
"\\dnd", # e.g. 2nd
|
||||
]
|
||||
extend-ignore-re = [
|
||||
"@xstate-layout .*",
|
||||
]
|
48
biome.json
Normal file
48
biome.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"correctness": {
|
||||
"noUnusedVariables": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noExplicitAny": "warn"
|
||||
},
|
||||
"style": {
|
||||
"useBlockStatements": "error",
|
||||
"useShorthandArrayType": "error"
|
||||
}
|
||||
}
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentWidth": 2,
|
||||
"indentStyle": "space",
|
||||
"lineWidth": 80,
|
||||
"formatWithErrors": true
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "single",
|
||||
"jsxQuoteStyle": "double",
|
||||
"trailingCommas": "es5",
|
||||
"semicolons": "asNeeded"
|
||||
},
|
||||
"parser": {
|
||||
"unsafeParameterDecoratorsEnabled": true
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"parser": {
|
||||
"cssModules": true
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"ignore": ["**/*.json"]
|
||||
}
|
||||
}
|
53
docs/kcl-lang/arithmetic.md
Normal file
53
docs/kcl-lang/arithmetic.md
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
title: "Arithmetic and logic"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
KCL supports the usual arithmetic operators on numbers and logic operators on booleans:
|
||||
|
||||
| Operator | Meaning |
|
||||
|----------|---------|
|
||||
| `+` | Addition |
|
||||
| `-` | Subtraction or unary negation |
|
||||
| `*` | Multiplication |
|
||||
| `/` | Division |
|
||||
| `%` | Modulus aka remainder |
|
||||
| `^` | Power, e.g., `x ^ 2` means `x` squared |
|
||||
| `&` | Logical 'and' |
|
||||
| `|` | Logical 'or' |
|
||||
| `!` | Unary logical 'not' |
|
||||
|
||||
KCL also supports comparsion operators which operate on numbers and produce booleans:
|
||||
|
||||
| Operator | Meaning |
|
||||
|----------|---------|
|
||||
| `==` | Equal |
|
||||
| `!=` | Not equal |
|
||||
| `<` | Less than |
|
||||
| `>` | Greater than |
|
||||
| `<=` | Less than or equal |
|
||||
| `>=` | Greater than or equal |
|
||||
|
||||
Arithmetics and logic expressions can be arbitrairly combined with the usual rules of associativity and precedence, e.g.,
|
||||
|
||||
```
|
||||
myMathExpression = 3 + 1 * 2 / 3 - 7
|
||||
```
|
||||
|
||||
You can also nest expressions in parenthesis:
|
||||
|
||||
```
|
||||
myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||
```
|
||||
|
||||
KCL numbers are implemented using [floating point numbers](https://en.wikipedia.org/wiki/Floating-point_arithmetic). This means that there are occasionally representation and rounding issues, and some oddities such as supporting positive and negative zero.
|
||||
|
||||
Some operators can be applied to other types:
|
||||
|
||||
- `+` can be used to concatenate strings, e.g., `'hello' + ' ' + 'world!'`
|
||||
- Unary `-` can be used with planes or line-like objects such as axes to produce an object with opposite orientation, e.g., `-XY` is a plain which is aligned with `XY` but whose normal aligns with the negative Z axis.
|
||||
- The following operators can be used with solids as shorthand for CSG operations:
|
||||
- `+` or `|` for [`union`](/docs/kcl-std/union).
|
||||
- `-` for [`subtract`](/docs/kcl-std/subtract).
|
||||
- `&` for [`intersect`](/docs/kcl-std/intersect)
|
32
docs/kcl-lang/arrays.md
Normal file
32
docs/kcl-lang/arrays.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
title: "Arrays and ranges"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Arrays are sequences of values.
|
||||
|
||||
Arrays can be written out as *array literals* using a sequence of expressions surrounded by square brackets, e.g., `['hello', 'world']` is an array of strings, `[x, x + 1, x + 2]` is an array of numbers (assuming `x` is a number), `[]` is an empty array, and `['hello', 42, true]` is a mixed array.
|
||||
|
||||
A value in an array can be accessed by indexing using square brackets where the index is a number, for example, `arr[0]`, `arr[42]`, `arr[i]` (where `arr` is an array and `i` is a (whole) number).
|
||||
|
||||
There are some useful functions for working with arrays in the standard library, see [std::array](/docs/kcl-std/modules/std-array) for details.
|
||||
|
||||
## Array types
|
||||
|
||||
Arrays have their own types: `[T]` where `T` is the type of the elements of the array, for example, `[string]` means an array of `string`s and `[any]` means an array of any values.
|
||||
|
||||
Array types can also include length information: `[T; n]` denotes an array of length `n` (where `n` is a number literal) and `[T; 1+]` denotes an array whose length is at least one (i.e., a non-empty array). E.g., `[string; 1+]` and `[number(mm); 3]` are valid array types.
|
||||
|
||||
## Ranges
|
||||
|
||||
Ranges are a succinct way to create an array of sequential numbers. The syntax is `[start .. end]` where `start` and `end` evaluate to whole numbers (integers). Ranges are inclusive of the start and end. The end must be greater than the start. Examples:
|
||||
|
||||
```kcl,norun
|
||||
[0..3] // [0, 1, 2, 3]
|
||||
[3..10] // [3, 4, 5, 6, 7, 8, 9, 10]
|
||||
x = 2
|
||||
[x..x+1] // [2, 3]
|
||||
```
|
||||
|
||||
The units of the start and end numbers must be the same and the result inherits those units.
|
30
docs/kcl-lang/attributes.md
Normal file
30
docs/kcl-lang/attributes.md
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
title: "Attributes"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Attributes are syntax which affects the language item they annotate. In KCL they are indicated using `@`. For example, `@settings` affects the file in which it appears.
|
||||
|
||||
There are two kinds of attributes: named and unnamed attributes. Named attributes (e.g., `@settings`) have a name immediately after the `@` (e.g., `settings`) and affect their surrounding scope. Unnamed attributes have no name and affect the following item, e.g.,
|
||||
|
||||
```kcl,norun
|
||||
@(lengthUnit = ft, coords = opengl)
|
||||
import "tests/inputs/cube.obj"
|
||||
```
|
||||
|
||||
has an unnamed attribute on the `import` statement.
|
||||
|
||||
Named and unnamed attributes may take a parenthesized list of arguments (like a function). Named attributes may also appear without any arguments (e.g., `@no_std`).
|
||||
|
||||
## Named attributes
|
||||
|
||||
The `@settings` attribute affects the current file and accepts the following arguments: `defaultLengthUnit`, `defaultAngleUnit`, and `kclVersion`. See [settings](/docs/kcl-lang/settings) for details.
|
||||
|
||||
The `@no_std` attribute affects the current file, takes no arguments, and causes the standard library to not be implicitly available. It can still be used by being explicitly imported.
|
||||
|
||||
## Unnamed attributes
|
||||
|
||||
Unnamed attributes may be used on `import` statements when importing non-KCL files. See [projects, modules, and imports](/docs/kcl-lang/modules) for details.
|
||||
|
||||
Other unnamed attributes are used on functions inside the standard library, but these are not available in user code.
|
99
docs/kcl-lang/foreign-imports.md
Normal file
99
docs/kcl-lang/foreign-imports.md
Normal file
@ -0,0 +1,99 @@
|
||||
---
|
||||
title: "Importing geometry from other CAD systems"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
`import` can also be used to import files from other CAD systems. The format of the statement is the
|
||||
same as for KCL files. You can only import the whole file, not items from it. E.g.,
|
||||
|
||||
```norun
|
||||
import "tests/inputs/cube.obj"
|
||||
|
||||
// Use `cube` just like a KCL object.
|
||||
```
|
||||
|
||||
```kcl
|
||||
import "tests/inputs/cube.sldprt" as cube
|
||||
|
||||
// Use `cube` just like a KCL object.
|
||||
```
|
||||
|
||||
For formats lacking unit data (such as STL, OBJ, or PLY files), the default
|
||||
unit of measurement is millimeters. Alternatively you may specify the unit
|
||||
by using an attribute. Likewise, you can also specify a coordinate system. E.g.,
|
||||
|
||||
```kcl
|
||||
@(lengthUnit = ft, coords = opengl)
|
||||
import "tests/inputs/cube.obj"
|
||||
```
|
||||
|
||||
When importing a GLTF file, the bin file will be imported as well.
|
||||
|
||||
Import paths are relative to the current project directory. Imports currently only work when
|
||||
using the native Design Studio, not in the browser.
|
||||
|
||||
### Supported values
|
||||
|
||||
File formats: `fbx`, `gltf`/`glb`, `obj`+, `ply`+, `sldprt`, `step`/`stp`, `stl`+. (Those marked with a
|
||||
'+' support customising the length unit and coordinate system).
|
||||
|
||||
Length units: `mm` (the default), `cm`, `m`, `inch`, `ft`, `yd`.
|
||||
|
||||
Coordinate systems:
|
||||
|
||||
- `zoo` (the default), forward: -Y, up: +Z, handedness: right
|
||||
- `opengl`, forward: +Z, up: +Y, handedness: right
|
||||
- `vulkan`, forward: +Z, up: -Y, handedness: left
|
||||
|
||||
---
|
||||
|
||||
## Performance deep‑dive for foreign‑file imports
|
||||
|
||||
Parallelized foreign‑file imports now let you overlap file reads, initialization,
|
||||
and rendering. To maximize throughput, you need to understand the three distinct
|
||||
stages—reading, initializing (background render start), and invocation (blocking)
|
||||
—and structure your code to defer blocking operations until the end.
|
||||
|
||||
### Foreign import execution stages
|
||||
|
||||
1. **Import (Read / Initialization) Stage**
|
||||
```kcl
|
||||
import "tests/inputs/cube.step" as cube
|
||||
```
|
||||
- Reads the file from disk and makes its API available.
|
||||
- Starts engine rendering but **does not block** your script.
|
||||
- This kick‑starts the render pipeline while you keep executing other code.
|
||||
|
||||
2. **Invocation (Blocking) Stage**
|
||||
```kcl
|
||||
import "tests/inputs/cube.step" as cube
|
||||
|
||||
cube
|
||||
|> translate(z=10) // ← blocks here only
|
||||
```
|
||||
- Any method call (e.g., `translate`, `scale`, `rotate`) waits for the background render to finish before applying transformations.
|
||||
|
||||
### Best practices
|
||||
|
||||
#### 1. Defer blocking calls
|
||||
|
||||
```kcl
|
||||
import "tests/inputs/cube.step" as cube // 1) Read / Background render starts
|
||||
|
||||
|
||||
// --- perform other operations and calculations here ---
|
||||
|
||||
|
||||
cube
|
||||
|> translate(z=10) // 2) Blocks only here
|
||||
```
|
||||
|
||||
#### 2. Split heavy work into separate modules
|
||||
|
||||
Place computationally expensive or IO‑heavy work into its own module so it can render in parallel while `main.kcl` continues.
|
||||
|
||||
#### Future improvements
|
||||
|
||||
Upcoming releases will auto‑analyse dependencies and only block when truly necessary. Until then, explicit deferral will give you the best performance.
|
||||
|
46
docs/kcl-lang/functions.md
Normal file
46
docs/kcl-lang/functions.md
Normal file
@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "Functions"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
We have support for defining your own functions. Functions can take in any
|
||||
type of argument. Below is an example of the syntax:
|
||||
|
||||
```
|
||||
fn myFn(x) {
|
||||
return x
|
||||
}
|
||||
```
|
||||
|
||||
As you can see above `myFn` just returns whatever it is given.
|
||||
|
||||
KCL uses keyword arguments:
|
||||
|
||||
```
|
||||
// If you declare a function like this
|
||||
fn add(left, right) {
|
||||
return left + right
|
||||
}
|
||||
|
||||
// You can call it like this:
|
||||
total = add(left = 1, right = 2)
|
||||
```
|
||||
|
||||
Functions can also declare one *unlabeled* arg. If you do want to declare an unlabeled arg, it must
|
||||
be the first arg declared.
|
||||
|
||||
```
|
||||
// The @ indicates an argument is used without a label.
|
||||
// Note that only the first argument can use @.
|
||||
fn increment(@x) {
|
||||
return x + 1
|
||||
}
|
||||
|
||||
fn add(@x, delta) {
|
||||
return x + delta
|
||||
}
|
||||
|
||||
two = increment(1)
|
||||
three = add(1, delta = 2)
|
||||
```
|
22
docs/kcl-lang/index.md
Normal file
22
docs/kcl-lang/index.md
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "KCL Language Reference"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
This is a reference for KCL. If you are learning KCL, you may prefer the [guide](https://zoo.dev/docs/kcl-book/intro.html) which explains
|
||||
things in a more tutorial fashion. See also our documentation of the [standard library](/docs/kcl-std).
|
||||
|
||||
## Topics
|
||||
|
||||
* [Pipelines](/docs/kcl-lang/pipelines)
|
||||
* [Arithmetic and logic](/docs/kcl-lang/arithmetic)
|
||||
* [Values and types](/docs/kcl-lang/types)
|
||||
* [Numeric types and units](/docs/kcl-lang/numeric)
|
||||
* [Functions](/docs/kcl-lang/functions)
|
||||
* [Arrays and ranges](/docs/kcl-lang/arrays)
|
||||
* [Projects and modules](/docs/kcl-lang/modules)
|
||||
* [Attributes](/docs/kcl-lang/attributes)
|
||||
* [Importing geometry from other CAD systems](/docs/kcl-lang/foreign-imports)
|
||||
* [Settings](/docs/kcl-lang/settings)
|
||||
* [Known Issues](/docs/kcl-lang/known-issues)
|
20
docs/kcl-lang/known-issues.md
Normal file
20
docs/kcl-lang/known-issues.md
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "Known Issues"
|
||||
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
The following are bugs that are not in modeling-app or kcl itself. These bugs
|
||||
once fixed in engine will just start working here with no language changes.
|
||||
|
||||
- **Sketch on Face**: If your sketch is outside the edges of the face (on which you
|
||||
are sketching) you will get multiple models returned instead of one single
|
||||
model for that sketch and its underlying 3D object.
|
||||
If you see a red line around your model, it means this is happening.
|
||||
|
||||
- **Import**: Right now you can import a file, even if that file has brep data
|
||||
you cannot edit it, after v1, the engine will account for this.
|
||||
|
||||
- **Appearance**: Changing the appearance on a loft does not work.
|
||||
|
||||
- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported.
|
279
docs/kcl-lang/modules.md
Normal file
279
docs/kcl-lang/modules.md
Normal file
@ -0,0 +1,279 @@
|
||||
---
|
||||
title: "Projects and modules"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
`KCL` allows splitting code up into multiple files. Each file is somewhat
|
||||
isolated from other files as a separate module.
|
||||
|
||||
When you define a function, you can use `export` before it to make it available
|
||||
to other modules.
|
||||
|
||||
```kcl
|
||||
// util.kcl
|
||||
export fn increment(@x) {
|
||||
return x + 1
|
||||
}
|
||||
```
|
||||
|
||||
Other files in the project can now import functions that have been exported.
|
||||
This makes them available to use in another file.
|
||||
|
||||
```norun
|
||||
// main.kcl
|
||||
import increment from "util.kcl"
|
||||
|
||||
answer = increment(41)
|
||||
```
|
||||
|
||||
Import statements must be at the top-level of a file. It is not allowed to have
|
||||
an `import` statement inside a function or in the body of an if‑else.
|
||||
|
||||
Multiple functions can be exported in a file.
|
||||
|
||||
```kcl
|
||||
// util.kcl
|
||||
export fn increment(@x) {
|
||||
return x + 1
|
||||
}
|
||||
|
||||
export fn decrement(@x) {
|
||||
return x - 1
|
||||
}
|
||||
```
|
||||
|
||||
When importing, you can import multiple functions at once.
|
||||
|
||||
```norun
|
||||
import increment, decrement from "util.kcl"
|
||||
```
|
||||
|
||||
Imported symbols can be renamed for convenience or to avoid name collisions.
|
||||
|
||||
```norun
|
||||
import increment as inc, decrement as dec from "util.kcl"
|
||||
```
|
||||
|
||||
You can import files from the current directory or from subdirectories, but if importing from a
|
||||
subdirectory you can only import `main.kcl`.
|
||||
|
||||
---
|
||||
|
||||
## Functions vs `clone`
|
||||
|
||||
There are two common patterns for re‑using geometry:
|
||||
|
||||
1. **Wrap the construction in a function** – flexible and fully parametric.
|
||||
2. **Duplicate an existing object with `clone`** – lightning‑fast, but an exact
|
||||
duplicate.
|
||||
|
||||
### Parametric function example
|
||||
|
||||
```kcl
|
||||
fn cube(center) {
|
||||
return startSketchOn(XY)
|
||||
|> startProfile(at = [center[0] - 10, center[1] - 10])
|
||||
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|
||||
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|
||||
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|
||||
|> close()
|
||||
|> extrude(length = 10)
|
||||
}
|
||||
|
||||
myCube = cube(center = [0, 0])
|
||||
```
|
||||
|
||||
*Pros*
|
||||
- Any argument can be a parameter – size, position, appearance, etc.
|
||||
- Works great inside loops, arrays, or optimisation sweeps.
|
||||
|
||||
*Cons*
|
||||
- Every invocation rebuilds the entire feature tree.
|
||||
- **Slower** than a straight duplicate – each call is its own render job.
|
||||
|
||||
### `clone` example
|
||||
|
||||
```kcl
|
||||
sketch001 = startSketchOn(-XZ)
|
||||
|> circle(center = [0, 0], radius = 10)
|
||||
|> extrude(length = 5)
|
||||
|> appearance(color = "#ff0000", metalness = 90, roughness = 90)
|
||||
|
||||
sketch002 = clone(sketch001) // ✓ instant copy
|
||||
```
|
||||
|
||||
*Pros*
|
||||
- Roughly an O(1) operation – we just duplicate the underlying engine handle.
|
||||
- Perfect when you need ten identical bolts or two copies of the same imported STEP file.
|
||||
|
||||
*Cons*
|
||||
- **Not parametric** – the clone is exactly the same shape as the source.
|
||||
- If you need to tweak dimensions per‑instance, you’re back to a function.
|
||||
|
||||
> **Rule of thumb** – Reach for `clone` when the geometry is already what you want. Reach for a function when you need customisation.
|
||||
|
||||
---
|
||||
|
||||
## Module‑level parallelism
|
||||
|
||||
Under the hood, the Design Studio runs **every module in parallel** where it can. This means:
|
||||
|
||||
- The top‑level code of `foo.kcl`, `bar.kcl`, and `baz.kcl` all start executing immediately and concurrently.
|
||||
- Imports that read foreign files (STEP/OBJ/…) overlap their I/O and background render.
|
||||
- CPU‑bound calculations in separate modules get their own worker threads.
|
||||
|
||||
### Why modules beat one‑big‑file
|
||||
|
||||
If you shoe‑horn everything into `main.kcl`, each statement runs sequentially:
|
||||
|
||||
```norun
|
||||
import "big.step" as gizmo // blocks main while reading
|
||||
|
||||
gizmo |> translate(x=50) // blocks again while waiting for render
|
||||
```
|
||||
|
||||
Split `gizmo` into its own file and the read/render can overlap whatever else `main.kcl` is doing.
|
||||
|
||||
```norun
|
||||
// gizmo.kcl (worker A)
|
||||
import "big.step"
|
||||
|
||||
// main.kcl (worker B)
|
||||
import "gizmo.kcl" as gizmo // non‑blocking
|
||||
|
||||
// ... other setup ...
|
||||
|
||||
gizmo |> translate(x=50) // only blocks here
|
||||
```
|
||||
|
||||
### Gotcha: defining but **not** calling functions
|
||||
|
||||
Defining a function inside a module is instantaneous – we just record the byte‑code. The heavy lifting happens when the function is **called**. So:
|
||||
|
||||
```norun
|
||||
// util.kcl
|
||||
export fn makeBolt(size) { /* … expensive CAD … */ }
|
||||
```
|
||||
|
||||
If `main.kcl` waits until the very end to call `makeBolt`, *none* of that work was parallelised – you’ve pushed the cost back onto the serial tail of your script.
|
||||
|
||||
**Better:** call it early or move the invocation into another module.
|
||||
|
||||
```norun
|
||||
// bolt_instance.kcl
|
||||
import makeBolt from "util.kcl"
|
||||
bolt = makeBolt(5) // executed in parallel
|
||||
bolt
|
||||
```
|
||||
|
||||
Now `main.kcl` can `import "bolt_instance.kcl" as bolt` and get the result that was rendered while it was busy doing other things.
|
||||
|
||||
---
|
||||
|
||||
## Whole module import
|
||||
|
||||
You can also import the whole module. This is useful if you want to use the
|
||||
result of a module as a variable, like a part.
|
||||
|
||||
```norun
|
||||
import "cube.kcl"
|
||||
cube
|
||||
|> translate(x=10)
|
||||
```
|
||||
|
||||
This imports the whole module and makes it available as `cube`. You can then
|
||||
use it like any other object. The `cube` variable is now a reference to the
|
||||
result of the module. This means that if you change the module, the `cube`
|
||||
variable will change as well.
|
||||
|
||||
In `cube.kcl`, you cannot have multiple objects. It has to be a single part. If
|
||||
you have multiple objects, you will get an error. This is because the module is
|
||||
expected to return a single object that can be used as a variable.
|
||||
|
||||
The last expression or variable definition becomes the module's return value.
|
||||
The module is expected to return a single object that can be used as a variable
|
||||
by whatever imports it.
|
||||
|
||||
So for example, this is allowed:
|
||||
|
||||
```norun
|
||||
... a bunch of code to create cube and cube2 ...
|
||||
|
||||
myUnion = union([cube, cube2])
|
||||
```
|
||||
|
||||
You can also do this:
|
||||
|
||||
```norun
|
||||
... a bunch of code to create cube and cube2 ...
|
||||
|
||||
union([cube, cube2])
|
||||
```
|
||||
|
||||
Either way, the last line will return the union of the two objects.
|
||||
|
||||
Or what you could do instead is:
|
||||
|
||||
```norun
|
||||
... a bunch of code to create cube and cube2 ...
|
||||
|
||||
myUnion = union([cube, cube2])
|
||||
myUnion
|
||||
```
|
||||
|
||||
This will assign the union of the two objects to a variable, and then return it
|
||||
on the last statement. It's simply another way of doing the same thing.
|
||||
|
||||
The final statement is what's important because it's the return value of the
|
||||
entire module. The module is expected to return a single object that can be used
|
||||
as a variable by the file that imports it.
|
||||
|
||||
The name of the file or subdirectory is used as the name of the variable within the importing program.
|
||||
If you want to use a different name, you can do so by using the `as` keyword:
|
||||
|
||||
```kcl,norun
|
||||
import "cube.kcl" // Introduces a new variable called `cube`.
|
||||
import "cube.kcl" as block // Introduces a new variable called `block`.
|
||||
import "cube/main.kcl" // Introduces a new variable called `cube`.
|
||||
import "cube/main.kcl" as block // Introduces a new variable called `block`.
|
||||
```
|
||||
|
||||
If the filename includes hyphens (`-`) or starts with an underscore (`_`), then you must specify a
|
||||
variable name.
|
||||
|
||||
---
|
||||
|
||||
## Multiple instances of the same import
|
||||
|
||||
Whether you are importing a file from another CAD system or a KCL file, that
|
||||
file represents object(s) in memory. If you import the same file multiple times,
|
||||
it will only be rendered once.
|
||||
|
||||
If you want to have multiple instances of the same object, you can use the
|
||||
[`clone`](/docs/kcl/clone) function. This will render a new instance of the object in memory.
|
||||
|
||||
```norun
|
||||
import cube from "cube.kcl"
|
||||
|
||||
cube
|
||||
|> translate(x=10)
|
||||
clone(cube)
|
||||
|> translate(x=20)
|
||||
```
|
||||
|
||||
In the sample above, the `cube` object is imported from a KCL file. The first
|
||||
instance is translated 10 units in the x direction. The second instance is
|
||||
cloned and translated 20 units in the x direction. The two instances are now
|
||||
separate objects in memory, and can be manipulated independently.
|
||||
|
||||
Here is an example with a file from another CAD system:
|
||||
|
||||
```kcl
|
||||
import "tests/inputs/cube.step"
|
||||
|
||||
cube
|
||||
|> translate(x=10)
|
||||
clone(cube)
|
||||
|> translate(x=20)
|
||||
```
|
48
docs/kcl-lang/numeric.md
Normal file
48
docs/kcl-lang/numeric.md
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
title: "Numeric types and units"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Numbers and numeric types in KCL include information about the units of the numbers. So rather than just having a number like `42`, we always have information about the units so we don't confuse 42 mm with 42 inches.
|
||||
|
||||
|
||||
## Numeric literals
|
||||
|
||||
When writing a number literal, you can use a unit suffix to explicitly state the unit, e.g., `42mm`. The following units are available:
|
||||
|
||||
- Length units:
|
||||
- metric: `mm`, `cm`, `m`
|
||||
- imperial: `in`, `ft`, `yd`
|
||||
- Angle units: `deg`, `rad`
|
||||
- `_` to indicate a unitless number such as a count or ratio.
|
||||
|
||||
If you write a numeric literal without a suffix, then the defaults for the current file are used. These defaults are specified using the `@settings` attribute, see [settings](/docs/kcl-lang/settings) for details. Note that if using the defaults, the KCL interpreter won't know whether you intend the number to be a length, angle, or count and will treat it as being possibly any of them.
|
||||
|
||||
|
||||
## Numeric types
|
||||
|
||||
Just like numbers carry units information, the `number` type also includes units information. Units are written in parentheses after the type, e.g., `number(mm)`.
|
||||
|
||||
Any of the suffixes described above can be used meaning that values with that type have the supplied units. E.g., `number(mm)` is the type of number values with mm units and `number(_)` is the type of number values with no units.
|
||||
|
||||
You can also use `number(Length)`, `number(Angle)`, or `number(Count)`. These types mean a number with any length, angle, or unitless (count) units, respectively (note that `number(_)` and `number(Count)` are equivalent since there is only one kind of unitless-ness).
|
||||
|
||||
Using just `number` means accepting any kind of number, even where the units are unknown by KCL.
|
||||
|
||||
|
||||
## Function calls
|
||||
|
||||
When calling a function with an argument with numeric type, the declared numeric type in the function signature and the units of the argument value used in the function call must be compatible. Units are adjusted automatically. For example, if a function requires an argument with type `number(mm)`, then you can call it with `2in` and the units will be automatically adjusted, but calling it with `90deg` will cause an error.
|
||||
|
||||
|
||||
## Mixing units with arithmetic
|
||||
|
||||
When doing arithmetic or comparisons, units will be adjusted as necessary if possible. However, often arithmetic expressions exceed the ability of KCL to accurately choose units which can result in warnings in your code or sometimes errors. In these cases, you will need to give KCL more information. Sometimes this can be done by making units explicit using suffixes. If not, then you will need to use *type ascription*, which asserts that an expression has the supplied type. For example, `(x * y): number(mm)` tells KCL that the units of `x * y` is mm. Note that type ascription does not do any adjustment of the numbers, e.g., `2mm: number(in)` has the value `2in` (note that this would be a very non-idiomatic way to use numeric type ascription, you could simply write `2in`. Usually type ascription is only necessary for supplying type information about the result of computation).
|
||||
|
||||
KCL has no support for area, volume, or other higher dimension units. When internal unit tracking requires multiple dimensions, KCL essentially gives up. This is usually where the extra type information described above is needed. If doing computation with higher dimensioned units, you must ensure that all adjustments occur before any computation. E.g., if you want to compute an area with unknown units, you must convert all numbers to the same unit before starting.
|
||||
|
||||
|
||||
## Explicit conversions
|
||||
|
||||
You might sometimes need to convert from one unit to another for some calculation. You can do this implicitly when calling a function (see above), but if you can't or don't want to, then you can use the explicit conversion functions in the [`std::units`](/docs/kcl-std/modules/std-units) module.
|
66
docs/kcl-lang/pipelines.md
Normal file
66
docs/kcl-lang/pipelines.md
Normal file
@ -0,0 +1,66 @@
|
||||
---
|
||||
title: "Pipelines"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
It can be hard to read repeated function calls, because of all the nested brackets.
|
||||
|
||||
```norun
|
||||
i = 1
|
||||
x = h(g(f(i)))
|
||||
```
|
||||
|
||||
You can make this easier to read by breaking it into many declarations, but that is a bit annoying.
|
||||
|
||||
```norun
|
||||
i = 1
|
||||
x0 = f(i)
|
||||
x1 = g(x0)
|
||||
x = h(x1)
|
||||
```
|
||||
|
||||
Instead, you can use the pipeline operator (`|>`) to simplify this.
|
||||
|
||||
Basically, `x |> f(%)` is a shorthand for `f(x)`. The left-hand side of the `|>` gets put into
|
||||
the `%` in the right-hand side.
|
||||
|
||||
So, this means `x |> f(%) |> g(%)` is shorthand for `g(f(x))`. The code example above, with its
|
||||
somewhat-clunky `x0` and `x1` constants could be rewritten as
|
||||
|
||||
```norun
|
||||
i = 1
|
||||
x = i
|
||||
|> f(%)
|
||||
|> g(%)
|
||||
|> h(%)
|
||||
```
|
||||
|
||||
This helps keep your code neat and avoid unnecessary declarations.
|
||||
|
||||
## Pipelines and keyword arguments
|
||||
|
||||
Say you have a long pipeline of sketch functions, like this:
|
||||
|
||||
```norun
|
||||
startSketchOn(XZ)
|
||||
|> line(%, end = [3, 4])
|
||||
|> line(%, end = [10, 10])
|
||||
|> line(%, end = [-13, -14])
|
||||
|> close(%)
|
||||
```
|
||||
|
||||
In this example, each function call outputs a sketch, and it gets put into the next function call via
|
||||
the `%`, into the first (unlabeled) argument.
|
||||
|
||||
If a function call uses an unlabeled first parameter, it will default to `%` if it's not given. This
|
||||
means that `|> line(%, end = [3, 4])` and `|> line(end = [3, 4])` are equivalent! So the above
|
||||
could be rewritten as
|
||||
|
||||
```norun
|
||||
startSketchOn(XZ)
|
||||
|> line(end = [3, 4])
|
||||
|> line(end = [10, 10])
|
||||
|> line(end = [-13, -14])
|
||||
|> close()
|
||||
```
|
45
docs/kcl-lang/settings.md
Normal file
45
docs/kcl-lang/settings.md
Normal file
@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "Settings"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
# KCL Settings
|
||||
|
||||
There are three levels of settings available in Zoo Design Studio:
|
||||
|
||||
1. [User Settings](/docs/kcl-lang/settings/user): Global settings that apply to all projects, stored in `user.toml`
|
||||
2. [Project Settings](/docs/kcl-lang/settings/project): Settings specific to a project, stored in `project.toml`
|
||||
3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
|
||||
|
||||
## Configuration Files
|
||||
|
||||
Zoo Design Studio uses TOML files for configuration:
|
||||
|
||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl-lang/settings/user)
|
||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl-lang/settings/project)
|
||||
|
||||
## Per-file settings
|
||||
|
||||
Settings which affect a single file are configured using the settings attribute.
|
||||
This must be at the top of the KCL file (comments before the attribute are permitted).
|
||||
For example:
|
||||
|
||||
```kcl
|
||||
// The settings attribute.
|
||||
@settings(defaultLengthUnit = in)
|
||||
|
||||
// The rest of your KCL code goes below...
|
||||
|
||||
x = 42 // Represents 42 inches.
|
||||
```
|
||||
|
||||
The settings attribute may contain multiple properties separated by commas.
|
||||
Valid properties are:
|
||||
|
||||
- `defaultLengthUnit`: the default length unit to use for numbers declared in this file.
|
||||
- Accepted values: `mm`, `cm`, `m`, `in` (inches), `ft` (feet), `yd` (yards).
|
||||
- `defaultAngleUnit`: the default angle unit to use for numbers declared in this file.
|
||||
- Accepted values: `deg` (degrees), `rad` (radians).
|
||||
|
||||
These settings override any project-wide settings (configured in project.toml or via the UI).
|
187
docs/kcl-lang/settings/project.md
Normal file
187
docs/kcl-lang/settings/project.md
Normal file
@ -0,0 +1,187 @@
|
||||
---
|
||||
title: "Project Settings"
|
||||
excerpt: "Project specific settings for the app. These live in `project.toml` in the base of the project directory. Updating the settings for the project in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
# Project Settings
|
||||
|
||||
Project specific settings for the app. These live in `project.toml` in the base of the project directory. Updating the settings for the project in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
|
||||
|
||||
## Project Configuration Structure
|
||||
|
||||
```toml
|
||||
[settings.app]
|
||||
# Set the appearance of the application
|
||||
name = "My Awesome Project"
|
||||
|
||||
[settings.app.appearance]
|
||||
# Use dark mode theme
|
||||
theme = "dark"
|
||||
# Set the app color to blue (240.0 = blue, 0.0 = red, 120.0 = green)
|
||||
color = 240.0
|
||||
|
||||
[settings.modeling]
|
||||
# Use inches as the default measurement unit
|
||||
base_unit = "in"
|
||||
|
||||
```
|
||||
|
||||
## Available Settings
|
||||
|
||||
### settings
|
||||
|
||||
|
||||
|
||||
#### app
|
||||
|
||||
The settings for the Design Studio.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### appearance
|
||||
|
||||
The settings for the appearance of the app.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has further nested options. See the schema for full details.
|
||||
##### onboarding_status
|
||||
|
||||
The onboarding status of the app.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### dismiss_web_banner
|
||||
|
||||
Permanently dismiss the banner warning to download the desktop app. This setting only applies to the web app. And is temporary until we have Linux support.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### stream_idle_mode
|
||||
|
||||
When the user is idle, and this is true, the stream will be torn down.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### allow_orbit_in_sketch_mode
|
||||
|
||||
When the user is idle, and this is true, the stream will be torn down.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### show_debug_panel
|
||||
|
||||
Whether to show the debug panel, which lets you see various states of the app to aid in development.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### named_views
|
||||
|
||||
Settings that affect the behavior of the command bar.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### modeling
|
||||
|
||||
Settings that affect the behavior while modeling.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### base_unit
|
||||
|
||||
The default unit to use in modeling dimensions.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### highlight_edges
|
||||
|
||||
Highlight edges of 3D objects?
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### enable_ssao
|
||||
|
||||
Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### text_editor
|
||||
|
||||
Settings that affect the behavior of the KCL text editor.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### text_wrapping
|
||||
|
||||
Whether to wrap text in the editor or overflow with scroll.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### blinking_cursor
|
||||
|
||||
Whether to make the cursor blink in the editor.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### command_bar
|
||||
|
||||
Settings that affect the behavior of the command bar.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### include_settings
|
||||
|
||||
Whether to include settings in the command bar.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
|
||||
|
||||
## Complete Example
|
||||
|
||||
```toml
|
||||
[settings.app]
|
||||
# Set the appearance of the application
|
||||
name = "My Awesome Project"
|
||||
|
||||
[settings.app.appearance]
|
||||
# Use dark mode theme
|
||||
theme = "dark"
|
||||
# Set the app color to blue (240.0 = blue, 0.0 = red, 120.0 = green)
|
||||
color = 240.0
|
||||
|
||||
[settings.modeling]
|
||||
# Use inches as the default measurement unit
|
||||
base_unit = "in"
|
||||
|
||||
```
|
237
docs/kcl-lang/settings/user.md
Normal file
237
docs/kcl-lang/settings/user.md
Normal file
@ -0,0 +1,237 @@
|
||||
---
|
||||
title: "User Settings"
|
||||
excerpt: "User specific settings for the app. These live in `user.toml` in the app's configuration directory. Updating the settings in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
# User Settings
|
||||
|
||||
User specific settings for the app. These live in `user.toml` in the app's configuration directory. Updating the settings in the app will update this file automatically. Do not edit this file manually, as it may be overwritten by the app. Manual edits can cause corruption of the settings file.
|
||||
|
||||
## User Configuration Structure
|
||||
|
||||
```toml
|
||||
[settings.app]
|
||||
# Set the appearance of the application
|
||||
[settings.app.appearance]
|
||||
# Use dark mode theme
|
||||
theme = "dark"
|
||||
# Set the app color to blue (240.0 = blue, 0.0 = red, 120.0 = green)
|
||||
color = 240.0
|
||||
|
||||
[settings.modeling]
|
||||
# Use millimeters as the default measurement unit
|
||||
base_unit = "mm"
|
||||
|
||||
[settings.text_editor]
|
||||
# Disable text wrapping in the editor
|
||||
text_wrapping = false
|
||||
|
||||
```
|
||||
|
||||
## Available Settings
|
||||
|
||||
### settings
|
||||
|
||||
|
||||
|
||||
#### app
|
||||
|
||||
The settings for the Design Studio.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### appearance
|
||||
|
||||
The settings for the appearance of the app.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has further nested options. See the schema for full details.
|
||||
##### onboarding_status
|
||||
|
||||
The onboarding status of the app.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### dismiss_web_banner
|
||||
|
||||
Permanently dismiss the banner warning to download the desktop app. This setting only applies to the web app. And is temporary until we have Linux support.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### stream_idle_mode
|
||||
|
||||
When the user is idle, teardown the stream after some time.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### allow_orbit_in_sketch_mode
|
||||
|
||||
Allow orbiting in sketch mode.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### show_debug_panel
|
||||
|
||||
Whether to show the debug panel, which lets you see various states of the app to aid in development.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### modeling
|
||||
|
||||
Settings that affect the behavior while modeling.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### base_unit
|
||||
|
||||
The default unit to use in modeling dimensions.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### camera_projection
|
||||
|
||||
The projection mode the camera should use while modeling.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### camera_orbit
|
||||
|
||||
The methodology the camera should use to orbit around the model.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### mouse_controls
|
||||
|
||||
The controls for how to navigate the 3D view.
|
||||
|
||||
**Possible values:** `zoo`, `onshape`, `trackpad_friendly`, `solidworks`, `nx`, `creo`, `autocad`
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### highlight_edges
|
||||
|
||||
Highlight edges of 3D objects?
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### enable_ssao
|
||||
|
||||
Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### show_scale_grid
|
||||
|
||||
Whether or not to show a scale grid in the 3D modeling view
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### text_editor
|
||||
|
||||
Settings that affect the behavior of the KCL text editor.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### text_wrapping
|
||||
|
||||
Whether to wrap text in the editor or overflow with scroll.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### blinking_cursor
|
||||
|
||||
Whether to make the cursor blink in the editor.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### project
|
||||
|
||||
Settings that affect the behavior of project management.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### directory
|
||||
|
||||
The directory to save and load projects from.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
##### default_project_name
|
||||
|
||||
The default project name to use when creating a new project.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
#### command_bar
|
||||
|
||||
Settings that affect the behavior of the command bar.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
This setting has the following nested options:
|
||||
|
||||
##### include_settings
|
||||
|
||||
Whether to include settings in the command bar.
|
||||
|
||||
|
||||
**Default:** None
|
||||
|
||||
|
||||
|
||||
|
||||
## Complete Example
|
||||
|
||||
```toml
|
||||
[settings.app]
|
||||
# Set the appearance of the application
|
||||
[settings.app.appearance]
|
||||
# Use dark mode theme
|
||||
theme = "dark"
|
||||
# Set the app color to blue (240.0 = blue, 0.0 = red, 120.0 = green)
|
||||
color = 240.0
|
||||
|
||||
[settings.modeling]
|
||||
# Use millimeters as the default measurement unit
|
||||
base_unit = "mm"
|
||||
|
||||
[settings.text_editor]
|
||||
# Disable text wrapping in the editor
|
||||
text_wrapping = false
|
||||
|
||||
```
|
161
docs/kcl-lang/types.md
Normal file
161
docs/kcl-lang/types.md
Normal file
@ -0,0 +1,161 @@
|
||||
---
|
||||
title: "Values and types"
|
||||
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
`KCL` defines the following types and keywords the language.
|
||||
|
||||
All these types can be nested in various forms where nesting applies. Like
|
||||
arrays can hold objects and vice versa.
|
||||
|
||||
## Constant declaration
|
||||
|
||||
Constants are defined with a name and a value, like so:
|
||||
|
||||
```
|
||||
myBool = false
|
||||
```
|
||||
|
||||
Currently you cannot redeclare a constant.
|
||||
|
||||
|
||||
## Objects
|
||||
|
||||
An object is defined with `{}` braces. Here is an example object:
|
||||
|
||||
```
|
||||
myObj = { a = 0, b = "thing" }
|
||||
```
|
||||
|
||||
To get the property of an object, you can call `myObj.a`, which in the above
|
||||
example returns 0.
|
||||
|
||||
## `ImportedGeometry`
|
||||
|
||||
Using `import` you can import geometry defined using other CAD software. In KCL,
|
||||
these objects have type `ImportedGeometry` and can mostly be treated like any
|
||||
other solid (they can be rotated, scaled, etc.), although there is no access to
|
||||
their internal components. See the [modules and imports docs](modules) for more
|
||||
detail on importing geometry.
|
||||
|
||||
|
||||
## Tags
|
||||
|
||||
Tags are used to give a name (tag) to a specific path.
|
||||
|
||||
### `TagDeclarator`
|
||||
|
||||
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||
way:
|
||||
|
||||
```norun
|
||||
startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
```
|
||||
|
||||
### `TagIdentifier`
|
||||
|
||||
As per the example above you can use the tag identifier to get a reference to the
|
||||
tagged object. The syntax for this is `myTag`.
|
||||
|
||||
In the example above we use the tag identifier to get the angle of the segment
|
||||
`segAng(rectangleSegmentA001)`.
|
||||
|
||||
### `Start`
|
||||
|
||||
There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
|
||||
for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
|
||||
is extruded).
|
||||
|
||||
### `End`
|
||||
|
||||
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
|
||||
for identifying the face of a solid which was finishes an extrusion.
|
||||
|
||||
### Tag Scope
|
||||
|
||||
Tags are scoped globally if in the root context meaning in this example you can
|
||||
use the tag `rectangleSegmentA001` in any function or expression in the file.
|
||||
|
||||
However if the code was written like this:
|
||||
|
||||
```norun
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
rect(origin = [20, 0])
|
||||
```
|
||||
|
||||
Those tags would only be available in the `rect` function and not globally.
|
||||
|
||||
However you likely want to use those tags somewhere outside the `rect` function.
|
||||
|
||||
Tags are accessible through the sketch group they are declared in.
|
||||
For example the following code works.
|
||||
|
||||
```norun
|
||||
fn rect(origin) {
|
||||
return startSketchOn(XZ)
|
||||
|> startProfile(at = origin)
|
||||
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001) - 90,
|
||||
length = 196.99,
|
||||
tag = $rectangleSegmentB001,
|
||||
)
|
||||
|> angledLine(
|
||||
angle = segAng(rectangleSegmentA001),
|
||||
length = -segLen(rectangleSegmentA001),
|
||||
tag = $rectangleSegmentC001,
|
||||
)
|
||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||
|> close()
|
||||
}
|
||||
|
||||
rect(origin = [0, 0])
|
||||
myRect = rect(origin = [20, 0])
|
||||
|
||||
myRect
|
||||
|> extrude(length = 10)
|
||||
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
|
||||
```
|
||||
|
||||
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
|
||||
the `rect` function. This is because the `rect` function is returning the
|
||||
sketch group that contains the tags.
|
||||
|
||||
---
|
||||
|
||||
If you find any issues using any of the above expressions or syntax,
|
||||
please file an issue with the `ast` label on the [modeling-app
|
||||
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
5
docs/kcl-std/README.md
Normal file
5
docs/kcl-std/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Autogenerated docs
|
||||
|
||||
Everything in this directory and its subdirectories (except this file) is automatically generated. Do not edit anything in this directory directly, your changes will be lost.
|
||||
|
||||
The directory contents are generated by running the `test_generate_stdlib_markdown_docs` test in `/rust/kcl-lib/src/docs/gen_std_tests.rs`. Files are generated from the standard library declared in KCL (`/rust/kcl-lib/std`) and in Rust (`/rust/kcl-lib/src/std`), and by copying files from `../kcl-src`.
|
@ -1,40 +1,54 @@
|
||||
---
|
||||
title: "angledLine"
|
||||
excerpt: "Draw a line segment relative to the current origin using the polar"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "Draw a line segment relative to the current origin using the polar measure of some angle and distance."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw a line segment relative to the current origin using the polar
|
||||
Draw a line segment relative to the current origin using the polar measure of some angle and distance.
|
||||
|
||||
measure of some angle and distance.
|
||||
|
||||
```js
|
||||
angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
|
||||
```kcl
|
||||
angledLine(
|
||||
@sketch: Sketch,
|
||||
angle: number,
|
||||
length?: number,
|
||||
lengthX?: number,
|
||||
lengthY?: number,
|
||||
endAbsoluteX?: number,
|
||||
endAbsoluteY?: number,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
|
||||
| `length` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `lengthX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `lengthY` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `endAbsoluteX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| `endAbsoluteY` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
|> yLineTo(15, %)
|
||||
|> angledLine({ angle = 30, length = 15 }, %)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> yLine(endAbsolute = 15)
|
||||
|> angledLine(angle = 30, length = 15)
|
||||
|> line(end = [8, -10])
|
||||
|> yLineTo(0, %)
|
||||
|> yLine(endAbsolute = 0)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
@ -1,44 +1,48 @@
|
||||
---
|
||||
title: "angledLineThatIntersects"
|
||||
excerpt: "Draw an angled line from the current origin, constructing a line segment"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw an angled line from the current origin, constructing a line segment
|
||||
Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment.
|
||||
|
||||
such that the newly created line intersects the desired target line segment.
|
||||
|
||||
```js
|
||||
angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
|
||||
```kcl
|
||||
angledLineThatIntersects(
|
||||
@sketch: Sketch,
|
||||
angle: number,
|
||||
intersectTag: TagIdentifier,
|
||||
offset?: number,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
|
||||
| `intersectTag` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the line to intersect with | Yes |
|
||||
| `offset` | [`number`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. Defaults to 0. | No |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(endAbsolute = [5, 10])
|
||||
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|
||||
|> line(endAbsolute = [0, 20])
|
||||
|> angledLineThatIntersects({
|
||||
angle = 80,
|
||||
intersectTag = lineToIntersect,
|
||||
offset = 10
|
||||
}, %)
|
||||
|> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10)
|
||||
|> close()
|
||||
|
||||
example = extrude(exampleSketch, length = 10)
|
220
docs/kcl-std/appearance.md
Normal file
220
docs/kcl-std/appearance.md
Normal file
File diff suppressed because one or more lines are too long
66
docs/kcl-std/arc.md
Normal file
66
docs/kcl-std/arc.md
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
40
docs/kcl-std/assertIs.md
Normal file
40
docs/kcl-std/assertIs.md
Normal file
File diff suppressed because one or more lines are too long
@ -1,42 +1,46 @@
|
||||
---
|
||||
title: "bezierCurve"
|
||||
excerpt: "Draw a smooth, continuous, curved line segment from the current origin to"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Draw a smooth, continuous, curved line segment from the current origin to
|
||||
Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape.
|
||||
|
||||
the desired (x, y), using a number of control points to shape the curve's shape.
|
||||
|
||||
```js
|
||||
bezierCurve(data: BezierData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
|
||||
```kcl
|
||||
bezierCurve(
|
||||
@sketch: Sketch,
|
||||
control1: Point2d,
|
||||
control2: Point2d,
|
||||
end: Point2d,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `data` | [`BezierData`](/docs/kcl/types/BezierData) | Data to draw a bezier curve. | Yes |
|
||||
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
|
||||
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
|
||||
| `control1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic | Yes |
|
||||
| `control2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic | Yes |
|
||||
| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn('XZ')
|
||||
|> startProfileAt([0, 0], %)
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XZ)
|
||||
|> startProfile(at = [0, 0])
|
||||
|> line(end = [0, 10])
|
||||
|> bezierCurve({
|
||||
to = [10, 10],
|
||||
control1 = [5, 0],
|
||||
control2 = [5, 10]
|
||||
}, %)
|
||||
|> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
|
||||
|> line(endAbsolute = [10, 0])
|
||||
|> close()
|
||||
|
@ -1,37 +1,43 @@
|
||||
---
|
||||
title: "circleThreePoint"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "Construct a circle derived from 3 points."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Construct a circle derived from 3 points.
|
||||
|
||||
|
||||
|
||||
```js
|
||||
circleThreePoint(p1: [number], p2: [number], p3: [number], sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
|
||||
```kcl
|
||||
circleThreePoint(
|
||||
@sketchSurfaceOrGroup: Sketch | Plane | Face,
|
||||
p1: Point2d,
|
||||
p2: Point2d,
|
||||
p3: Point2d,
|
||||
tag?: TagDeclarator,
|
||||
): Sketch
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|----------|------|-------------|----------|
|
||||
| `p1` | `[number]` | 1st point to derive the circle. | Yes |
|
||||
| `p2` | `[number]` | 2nd point to derive the circle. | Yes |
|
||||
| `p3` | `[number]` | 3rd point to derive the circle. | Yes |
|
||||
| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
|
||||
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
|
||||
| `sketchSurfaceOrGroup` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Plane or surface to sketch on. | Yes |
|
||||
| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
|
||||
| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
|
||||
| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
|
||||
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Identifier for the circle to reference elsewhere. | No |
|
||||
|
||||
### Returns
|
||||
|
||||
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
|
||||
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
|
||||
|
||||
|
||||
### Examples
|
||||
|
||||
```js
|
||||
exampleSketch = startSketchOn("XY")
|
||||
```kcl
|
||||
exampleSketch = startSketchOn(XY)
|
||||
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 5])
|
||||
|> extrude(length = 5)
|
||||
```
|
File diff suppressed because one or more lines are too long
33
docs/kcl-std/consts.md
Normal file
33
docs/kcl-std/consts.md
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
title: "KCL Constants"
|
||||
excerpt: "Documentation for the KCL constants."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
## Table of Contents
|
||||
|
||||
|
||||
### `std`
|
||||
|
||||
- [`END`](/docs/kcl/consts/std-END)
|
||||
- [`START`](/docs/kcl/consts/std-START)
|
||||
- [`X`](/docs/kcl/consts/std-X)
|
||||
- [`XY`](/docs/kcl/consts/std-XY)
|
||||
- [`XZ`](/docs/kcl/consts/std-XZ)
|
||||
- [`Y`](/docs/kcl/consts/std-Y)
|
||||
- [`YZ`](/docs/kcl/consts/std-YZ)
|
||||
- [`Z`](/docs/kcl/consts/std-Z)
|
||||
|
||||
### `std::math`
|
||||
|
||||
- [`E`](/docs/kcl/consts/std-math-E)
|
||||
- [`PI`](/docs/kcl/consts/std-math-PI)
|
||||
- [`TAU`](/docs/kcl/consts/std-math-TAU)
|
||||
|
||||
### `std::turns`
|
||||
|
||||
- [`HALF_TURN`](/docs/kcl/consts/std-turns-HALF_TURN)
|
||||
- [`QUARTER_TURN`](/docs/kcl/consts/std-turns-QUARTER_TURN)
|
||||
- [`THREE_QUARTER_TURN`](/docs/kcl/consts/std-turns-THREE_QUARTER_TURN)
|
||||
- [`ZERO`](/docs/kcl/consts/std-turns-ZERO)
|
||||
|
16
docs/kcl-std/consts/std-END.md
Normal file
16
docs/kcl-std/consts/std-END.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "END"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "Identifies the ending face of an extrusion. I.e., the new face created by an extrusion."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
|
||||
|
||||
```kcl
|
||||
END: string = 'end'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-START.md
Normal file
16
docs/kcl-std/consts/std-START.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "START"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "Identifies the starting face of an extrusion. I.e., the face which is extruded."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Identifies the starting face of an extrusion. I.e., the face which is extruded.
|
||||
|
||||
```kcl
|
||||
START: string = 'start'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-X.md
Normal file
16
docs/kcl-std/consts/std-X.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "X"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "The X-axis (can be used in both 2d and 3d contexts)."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
The X-axis (can be used in both 2d and 3d contexts).
|
||||
|
||||
```kcl
|
||||
X
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-XY.md
Normal file
16
docs/kcl-std/consts/std-XY.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "XY"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
|
||||
|
||||
```kcl
|
||||
XY
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-XZ.md
Normal file
16
docs/kcl-std/consts/std-XZ.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "XZ"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis.
|
||||
|
||||
```kcl
|
||||
XZ
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-Y.md
Normal file
16
docs/kcl-std/consts/std-Y.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "Y"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "The Y-axis (can be used in both 2d and 3d contexts)."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
The Y-axis (can be used in both 2d and 3d contexts).
|
||||
|
||||
```kcl
|
||||
Y
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-YZ.md
Normal file
16
docs/kcl-std/consts/std-YZ.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "YZ"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis.
|
||||
|
||||
```kcl
|
||||
YZ
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-Z.md
Normal file
16
docs/kcl-std/consts/std-Z.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "Z"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "The 3D Z-axis."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
The 3D Z-axis.
|
||||
|
||||
```kcl
|
||||
Z
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
33
docs/kcl-std/consts/std-math-E.md
Normal file
33
docs/kcl-std/consts/std-math-E.md
Normal file
File diff suppressed because one or more lines are too long
35
docs/kcl-std/consts/std-math-PI.md
Normal file
35
docs/kcl-std/consts/std-math-PI.md
Normal file
File diff suppressed because one or more lines are too long
33
docs/kcl-std/consts/std-math-TAU.md
Normal file
33
docs/kcl-std/consts/std-math-TAU.md
Normal file
File diff suppressed because one or more lines are too long
16
docs/kcl-std/consts/std-sweep-SKETCH_PLANE.md
Normal file
16
docs/kcl-std/consts/std-sweep-SKETCH_PLANE.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "sweep::SKETCH_PLANE"
|
||||
subtitle: "Constant in std::sweep"
|
||||
excerpt: "Local/relative to a position centered within the plane being sketched on"
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Local/relative to a position centered within the plane being sketched on
|
||||
|
||||
```kcl
|
||||
sweep::SKETCH_PLANE: string = 'sketchPlane'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-sweep-TRAJECTORY.md
Normal file
16
docs/kcl-std/consts/std-sweep-TRAJECTORY.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "sweep::TRAJECTORY"
|
||||
subtitle: "Constant in std::sweep"
|
||||
excerpt: "Local/relative to the trajectory curve"
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Local/relative to the trajectory curve
|
||||
|
||||
```kcl
|
||||
sweep::TRAJECTORY: string = 'trajectoryCurve'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-turns-HALF_TURN.md
Normal file
16
docs/kcl-std/consts/std-turns-HALF_TURN.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "turns::HALF_TURN"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: "A half turn, 180 degrees or π radians."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A half turn, 180 degrees or π radians.
|
||||
|
||||
```kcl
|
||||
turns::HALF_TURN: number(deg) = 180deg
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-turns-QUARTER_TURN.md
Normal file
16
docs/kcl-std/consts/std-turns-QUARTER_TURN.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "turns::QUARTER_TURN"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: "A quarter turn, 90 degrees or π/2 radians."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
A quarter turn, 90 degrees or π/2 radians.
|
||||
|
||||
```kcl
|
||||
turns::QUARTER_TURN: number(deg) = 90deg
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN.md
Normal file
16
docs/kcl-std/consts/std-turns-THREE_QUARTER_TURN.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "turns::THREE_QUARTER_TURN"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: "Three quarters of a turn, 270 degrees or 1.5*π radians."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
Three quarters of a turn, 270 degrees or 1.5*π radians.
|
||||
|
||||
```kcl
|
||||
turns::THREE_QUARTER_TURN: number(deg) = 270deg
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
16
docs/kcl-std/consts/std-turns-ZERO.md
Normal file
16
docs/kcl-std/consts/std-turns-ZERO.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "turns::ZERO"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: "No turn, zero degrees/radians."
|
||||
layout: manual
|
||||
---
|
||||
|
||||
No turn, zero degrees/radians.
|
||||
|
||||
```kcl
|
||||
turns::ZERO: number = 0
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
104
docs/kcl-std/extrude.md
Normal file
104
docs/kcl-std/extrude.md
Normal file
File diff suppressed because one or more lines are too long
66
docs/kcl-std/functions/std-array-map.md
Normal file
66
docs/kcl-std/functions/std-array-map.md
Normal file
File diff suppressed because one or more lines are too long
39
docs/kcl-std/functions/std-array-pop.md
Normal file
39
docs/kcl-std/functions/std-array-pop.md
Normal file
File diff suppressed because one or more lines are too long
41
docs/kcl-std/functions/std-array-push.md
Normal file
41
docs/kcl-std/functions/std-array-push.md
Normal file
File diff suppressed because one or more lines are too long
122
docs/kcl-std/functions/std-array-reduce.md
Normal file
122
docs/kcl-std/functions/std-array-reduce.md
Normal file
File diff suppressed because one or more lines are too long
271
docs/kcl-std/functions/std-clone.md
Normal file
271
docs/kcl-std/functions/std-clone.md
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user