Compare commits
549 Commits
url-scheme
...
ryan-branc
Author | SHA1 | Date | |
---|---|---|---|
c79cb0e8a4 | |||
638b4ce3e8 | |||
c4db8b7c9a | |||
6df8e97782 | |||
292cc4d43c | |||
c525889832 | |||
b0e9aac138 | |||
0c6f01fcff | |||
6e3eaf0df5 | |||
3269cdf812 | |||
6a4834989a | |||
8879f488bb | |||
67d0fb76f6 | |||
fff3c58560 | |||
8880df4fbb | |||
d94017c5e3 | |||
8fe91259fa | |||
57d4204f47 | |||
ee601f93bf | |||
b0b48a2e9f | |||
46f940ead5 | |||
014cedb2cc | |||
2375f900b9 | |||
9fd4fd0dd8 | |||
ee5037bf35 | |||
bc77507af8 | |||
34ae05e4d7 | |||
881745e131 | |||
11d469bdeb | |||
49fce9ed57 | |||
25aa2d80b2 | |||
9960a1f0c8 | |||
fb7b2be427 | |||
2ec68e3c73 | |||
6e2dd53ee0 | |||
f5c262206e | |||
9c9b448705 | |||
615b03aea5 | |||
a05bc9cc57 | |||
96c039a903 | |||
0bfef56ea3 | |||
325235e234 | |||
297d5aa219 | |||
c2554bc996 | |||
c3c435348d | |||
896c568914 | |||
a98c2a0f84 | |||
f0ab9e47c4 | |||
a533d8a031 | |||
495fb0480e | |||
c34cffdcb8 | |||
527b00f581 | |||
7ed4e2fb64 | |||
6831d828c5 | |||
6331c9f1dd | |||
864796cbc6 | |||
1dec1d4c49 | |||
381d45f651 | |||
645747ea66 | |||
286af1ff51 | |||
bca3e2f44b | |||
d13f7fd508 | |||
946479711d | |||
acfd65d4b4 | |||
aefcd845ea | |||
0434b0e0d8 | |||
cd3381cd56 | |||
6882a7ff14 | |||
9cdcc43ac3 | |||
af842aeded | |||
0d4b7adf99 | |||
e708b6ee6b | |||
4dd8a25fdd | |||
029799215b | |||
e3b8807d6f | |||
0e5d88df0b | |||
95781143eb | |||
c184a7d4d8 | |||
c38e52fbb7 | |||
ea0a3ac3ba | |||
385589ddf9 | |||
22df47fa96 | |||
a68748abcf | |||
e75b1dac86 | |||
56a402e4d2 | |||
b4b59219f0 | |||
89f528e598 | |||
1b8688f274 | |||
a977d0d386 | |||
397839da84 | |||
ac120838e5 | |||
e6a2ac9c4a | |||
6e7e6e96cf | |||
73e155d79b | |||
a782f26ec2 | |||
01076c3aed | |||
fe512611ac | |||
cba953c245 | |||
54ca6ea0b2 | |||
6a01608c3a | |||
530f15e04a | |||
725e59d987 | |||
54313c9b03 | |||
890d96496c | |||
35999366a7 | |||
2affc7271d | |||
d30fbf8b4b | |||
3f7e776464 | |||
79cff57f43 | |||
1cd2cd82b2 | |||
60e187bd3e | |||
c64175425b | |||
36464e6984 | |||
2f0002e53c | |||
482833c88f | |||
d9d0a72306 | |||
65cd9fab64 | |||
5e41e382ce | |||
1e3cb00092 | |||
d1a2bd01ca | |||
aca13d087b | |||
fcdde3e482 | |||
a1df3d0ffc | |||
1852e6167b | |||
29bf77bb82 | |||
e81b614523 | |||
5a5fe3bb95 | |||
0710f6e5f2 | |||
c9d5633647 | |||
f9419a98b5 | |||
999f72bccf | |||
9dbe74e008 | |||
88d9cdc52b | |||
2dd1f0f213 | |||
b971f3ecf4 | |||
2198bd7580 | |||
5fa1497b75 | |||
ff86e41283 | |||
08e4c03ca7 | |||
c654582137 | |||
6c2fa95a32 | |||
263a4f324d | |||
3160c58d8a | |||
73e26cbb4d | |||
21e2a92f54 | |||
d7f2bfdabe | |||
a76eabbb80 | |||
a82564989e | |||
e69837a411 | |||
7e31f870bf | |||
2f51763df9 | |||
7c4bf8d793 | |||
4747cdcab6 | |||
de73f335fe | |||
a62004da82 | |||
92e0da1f8d | |||
a111473658 | |||
7cfed9bff4 | |||
a30bd185d8 | |||
e8cae630a1 | |||
74ec749560 | |||
ebdaf59d1c | |||
cd68414d54 | |||
c8238ff04a | |||
8089369108 | |||
8ebe78c664 | |||
a85c1a9375 | |||
5701616f3e | |||
846acaba2f | |||
0a524d42f6 | |||
fe28527ef9 | |||
0e8d0083c4 | |||
4f4167b247 | |||
fbc2e9d02c | |||
33b15e818b | |||
6cebb84ae0 | |||
85403e47e4 | |||
0dfee64e3b | |||
6370d45f94 | |||
fb3e922180 | |||
1257ec0327 | |||
08e9fe2e52 | |||
7cec1d45fe | |||
93710bc8f2 | |||
87e7e9447f | |||
8be113d284 | |||
7cfc927d5c | |||
c0f04d5f86 | |||
3dbc701f26 | |||
16e7ae38e3 | |||
24c7260327 | |||
72cfc4a471 | |||
2d128ed32e | |||
cd6749ba02 | |||
7243405e1b | |||
c8da057ec2 | |||
220fe5b2b8 | |||
4e6429de49 | |||
5391a65b18 | |||
592628917a | |||
4c6e8633f7 | |||
c5150468a2 | |||
39126dbff1 | |||
f86a69f12a | |||
de354ee5d3 | |||
dfef7338ee | |||
ee08948f54 | |||
832f6b65e2 | |||
68efd77c5d | |||
8f138109dd | |||
8972f53256 | |||
0c5b13ade5 | |||
446f92a53a | |||
2256e3bc09 | |||
9e2876edc6 | |||
a138af1ec8 | |||
684c585a48 | |||
500be20649 | |||
5fbbe2fa8c | |||
5f5ecc5afe | |||
3dafc31cad | |||
9c230bc678 | |||
1fad6966b6 | |||
c7efb4c006 | |||
68fd921a64 | |||
a20e710e8f | |||
9daf2d7794 | |||
f86473d13b | |||
6fccc68c18 | |||
ade66d0876 | |||
b5f3a067ee | |||
bb9d24f821 | |||
bd3cd97d74 | |||
1b5839a7f8 | |||
a9e480f0ed | |||
63fa04608c | |||
0d4d7fa751 | |||
68cdb68231 | |||
053bdffc45 | |||
9ffc08b84a | |||
47e8d3f4fc | |||
53db421d97 | |||
289ed291c4 | |||
39ceb83840 | |||
af449ff6ca | |||
e1bf55cc4a | |||
8fe2d33063 | |||
d7e36eed24 | |||
6123ed6a82 | |||
da6cd5cf9f | |||
ad5bfa1a29 | |||
6358bdd7cd | |||
d6fe414b2e | |||
25e7e8cb89 | |||
a175870453 | |||
24516cdb2d | |||
496398de52 | |||
3304a74064 | |||
f4877cb160 | |||
f7196e7eb0 | |||
5260bd6820 | |||
394653247a | |||
fbd22a2d17 | |||
7c568f68e5 | |||
31b0766754 | |||
cd33b40c37 | |||
3300772e3d | |||
fa37752a41 | |||
34c5c153c8 | |||
3f343698a8 | |||
0bd9f42e17 | |||
aad29fca9f | |||
a8c1a14d48 | |||
8194f8b70b | |||
03e4f457d4 | |||
226ed37c5f | |||
0f3f923019 | |||
bf8fb0d127 | |||
4a275c2ff7 | |||
baf5509f1d | |||
47a5e1f6d3 | |||
d85211c5a4 | |||
1beb6b5186 | |||
17978ab1d7 | |||
a1bcad9dfb | |||
2e7bdf02cf | |||
6f76196b72 | |||
e7af064518 | |||
674d49e2ae | |||
4cb48674c6 | |||
82daec2aff | |||
f1ef9d5200 | |||
dc226d3270 | |||
7bf50d8fe0 | |||
b26764bc9a | |||
1b0c6298d7 | |||
fe9a483726 | |||
bd42ea037b | |||
fdb1b21af3 | |||
630ef316b8 | |||
e322926be9 | |||
a9e61da8b5 | |||
e2a835a437 | |||
c61273085f | |||
a79e365c0f | |||
2386ba24e5 | |||
e42a891df8 | |||
98200565bf | |||
570fd827ed | |||
0add26cf61 | |||
b54fc534c2 | |||
c66f851a3f | |||
13b8ab71d8 | |||
bdeab4f87d | |||
05ccf5e2f4 | |||
7ab015d783 | |||
3d6cfa980f | |||
9f5f1eb8c3 | |||
50fcdff879 | |||
efaae2b193 | |||
7e4ebacb72 | |||
72482506c3 | |||
a51b5b09a3 | |||
53ccc1ed6c | |||
8106749ccf | |||
081e34a600 | |||
541400f4be | |||
39d249030d | |||
f8a69fac73 | |||
24f4bf160f | |||
8011594e24 | |||
0e09affb8f | |||
197a47346a | |||
9d083710e0 | |||
afa7c1dc4e | |||
c74b695a71 | |||
d0c244e05e | |||
a315b77f02 | |||
15c854ff18 | |||
acd3a5717d | |||
8a2555550f | |||
62e75c852a | |||
dd3601ea7b | |||
a5e7782d9a | |||
79b0b70688 | |||
1d134c1be0 | |||
1c58572234 | |||
ecee51e82b | |||
978ac42f1c | |||
893996430e | |||
41e65fc4e9 | |||
99aa74ceba | |||
0bcf33ed00 | |||
d0a9b5ecab | |||
a569f818cf | |||
f73556ba7b | |||
29cdc66b34 | |||
c9800a58d0 | |||
e46aca4992 | |||
9564890b29 | |||
f8a1f40f20 | |||
c551d88db4 | |||
8eee3e1c58 | |||
b02529cae0 | |||
cf03021366 | |||
f52d2d55f1 | |||
59b1319e50 | |||
b07bbda20b | |||
3c01924184 | |||
bd16902f02 | |||
8c3af1a72a | |||
33f5d7740d | |||
b388f60648 | |||
8f4380be74 | |||
9ae8042a57 | |||
4b676d47da | |||
e6641e68f3 | |||
450afb1605 | |||
04433fecad | |||
6567e2ff92 | |||
91c32a7fe2 | |||
f735cdc22e | |||
1b72c7df85 | |||
062abd148f | |||
c93ed0f306 | |||
27e2518dde | |||
dc6505acaf | |||
6ff3284eca | |||
4cb6ceb043 | |||
1db3e1b5e4 | |||
d797d20d50 | |||
cf52e151fb | |||
87c551b869 | |||
2001262494 | |||
777b225066 | |||
ae6373e4f5 | |||
87979b17cf | |||
4be63e7331 | |||
56d930c4f2 | |||
d48eb0c66c | |||
a69d7d03d0 | |||
00a8273173 | |||
51868f892b | |||
8e9286a747 | |||
023ed1a687 | |||
5b7d707b26 | |||
5b95194aa7 | |||
6080a99e73 | |||
5106c49e21 | |||
25f18845c7 | |||
0a7f1a41fc | |||
1625b58577 | |||
ab6115c4e2 | |||
fe621240c3 | |||
97faf5ae2b | |||
e3b9a6e5d8 | |||
e94b1bc12a | |||
c0eff5bc14 | |||
b0f92c2f6d | |||
718873b3bb | |||
9f815eecc1 | |||
0384e5e6c6 | |||
48ef0885b7 | |||
3b2731f924 | |||
bf4e04f9f1 | |||
24475bbcdf | |||
bcca736a8d | |||
440eb2636a | |||
344e72d7ec | |||
ec7b733a0d | |||
63159c1cb8 | |||
df62a995b5 | |||
fa762c1c4d | |||
82b03a9d47 | |||
793b7407f6 | |||
040bcc2c09 | |||
ae2e219394 | |||
a83f549257 | |||
3871d2858f | |||
3effb87f8e | |||
3f2f035a9b | |||
4735eaef8c | |||
69f8da058a | |||
93ebf13621 | |||
20c4d44b8b | |||
8ea8f80e32 | |||
d73339fd8d | |||
031b230690 | |||
1125d74f12 | |||
5c7a2822d0 | |||
d44b1f8e54 | |||
c4ca69496b | |||
f06de7f586 | |||
75c6ae6e66 | |||
48639d70db | |||
c565d9670d | |||
7bf5953299 | |||
a9ab35e55f | |||
15418e98b0 | |||
20838bf618 | |||
acd52ab350 | |||
75b9d2913f | |||
d92e6f6453 | |||
c1a879837e | |||
daacca500c | |||
c1e8bb5288 | |||
8ca4166b08 | |||
4624f1c0ba | |||
7ac6a3a4f2 | |||
3cbf2b194a | |||
44f06aa199 | |||
1b878865b8 | |||
3b840e9a80 | |||
4a0811eec8 | |||
e63bf5db11 | |||
863e4e206f | |||
f1cd2355c6 | |||
164b675a86 | |||
b1afe1c541 | |||
26ef7218b2 | |||
e5a4fb439c | |||
97ad66a358 | |||
26438270ff | |||
a0cfda6d7a | |||
58a62b8097 | |||
e2909c509f | |||
07eaf93e78 | |||
6a5ca3088a | |||
6501072d80 | |||
726fd02bad | |||
d0f9ae475f | |||
da323e22d4 | |||
8dc3628e9b | |||
253744867b | |||
c45eb1e3e3 | |||
758aac9328 | |||
309943cf2c | |||
b3d4ab91fc | |||
5e73fa45f0 | |||
17d23a17db | |||
0460f8eaee | |||
2077cdb6fc | |||
cb0b7e8169 | |||
3a05211d30 | |||
d12d103cba | |||
04f6d3dcc8 | |||
9c9ffa0d03 | |||
c62b9f1f04 | |||
fcac3c72e4 | |||
1e2f577a9f | |||
1814f340fb | |||
43928f88aa | |||
6959036688 | |||
570d0473c6 | |||
44f0d7c25c | |||
3ccb04c4e7 | |||
00058f699a | |||
5a478fe0b3 | |||
723cf4f746 | |||
3950de0a4d | |||
901d474986 | |||
e7ab645267 | |||
cf830f9895 | |||
2c1f53f0f0 | |||
d39e2502d0 | |||
51fed9c541 | |||
b3a09abe01 | |||
cd3a2fea07 | |||
c29c4a8567 | |||
39ccd94884 | |||
d99ab22b56 | |||
20a8f2aa6a | |||
93266a9819 | |||
a9c7a7cb13 | |||
8dd9b8d192 | |||
23181d8144 | |||
834967df6a | |||
deacaac33a | |||
c55603853b | |||
93f652647e | |||
67cea620a6 | |||
ed0c7d038d | |||
d3aa789761 | |||
cd68f80b71 | |||
d341681c0d | |||
0578e9d2a1 | |||
b413538e9e | |||
c4e7754fc5 | |||
94515b5490 |
@ -1,3 +1,3 @@
|
|||||||
[codespell]
|
[codespell]
|
||||||
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast
|
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,absolutey,atleast,ue
|
||||||
skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,./src-tauri/gen/schemas
|
skip: **/target,node_modules,build,**/Cargo.lock,./docs/kcl/*.md,./src-tauri/gen/schemas
|
||||||
|
@ -3,3 +3,4 @@ VITE_KC_API_BASE_URL=https://api.dev.zoo.dev
|
|||||||
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
|
||||||
VITE_KC_SKIP_AUTH=false
|
VITE_KC_SKIP_AUTH=false
|
||||||
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
VITE_KC_CONNECTION_TIMEOUT_MS=5000
|
||||||
|
VITE_KC_DEV_TOKEN="your token from dev.zoo.dev should go in .env.development.local"
|
||||||
|
10
.eslintrc
10
.eslintrc
@ -4,7 +4,8 @@
|
|||||||
"project": "./tsconfig.json"
|
"project": "./tsconfig.json"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"css-modules"
|
"css-modules",
|
||||||
|
"suggest-no-throw",
|
||||||
],
|
],
|
||||||
"extends": [
|
"extends": [
|
||||||
"react-app",
|
"react-app",
|
||||||
@ -17,6 +18,7 @@
|
|||||||
"never"
|
"never"
|
||||||
],
|
],
|
||||||
"react-hooks/exhaustive-deps": "off",
|
"react-hooks/exhaustive-deps": "off",
|
||||||
|
"suggest-no-throw/suggest-no-throw": "warn",
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
@ -25,6 +27,12 @@
|
|||||||
"@typescript-eslint/no-floating-promises": "warn",
|
"@typescript-eslint/no-floating-promises": "warn",
|
||||||
"testing-library/prefer-screen-queries": "off"
|
"testing-library/prefer-screen-queries": "off"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["src/**/*.test.ts"],
|
||||||
|
"rules": {
|
||||||
|
"suggest-no-throw/suggest-no-throw": "off",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
37
.github/ISSUE_TEMPLATE/cryptic_error.yml
vendored
Normal file
37
.github/ISSUE_TEMPLATE/cryptic_error.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: Cryptic KCL Error
|
||||||
|
description: File a bug report for source code that produces a confusing error
|
||||||
|
title: "[CRYPTIC]: "
|
||||||
|
labels: ["cryptic-error"]
|
||||||
|
assignees: []
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: "Thank you for taking the time to report a confusing error. Please provide as much information as possible to help us resolve it."
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: kcl
|
||||||
|
attributes:
|
||||||
|
label: Paste minimal KCL source that produces a cryptic error
|
||||||
|
description: Minimal KCL reproducer that produces a cryptic error
|
||||||
|
placeholder: "const ..."
|
||||||
|
render: javascript
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: expected-behavior
|
||||||
|
attributes:
|
||||||
|
label: Expected Behavior
|
||||||
|
description: Description of what you expected to happen (if you know).
|
||||||
|
placeholder: "I expected that..."
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
id: additional-context
|
||||||
|
attributes:
|
||||||
|
label: Additional Context
|
||||||
|
description: Add any other context about the problem here.
|
||||||
|
placeholder: "Anything else you want to add..."
|
||||||
|
validations:
|
||||||
|
required: false
|
2
.github/workflows/build-and-store-wasm.yml
vendored
2
.github/workflows/build-and-store-wasm.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
# Upload the WASM bundle as an artifact
|
# Upload the WASM bundle as an artifact
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: wasm-bundle
|
name: wasm-bundle
|
||||||
path: src/wasm-lib/pkg
|
path: src/wasm-lib/pkg
|
||||||
|
4
.github/workflows/cargo-bench.yml
vendored
4
.github/workflows/cargo-bench.yml
vendored
@ -38,5 +38,7 @@ jobs:
|
|||||||
- name: Benchmark kcl library
|
- name: Benchmark kcl library
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |-
|
run: |-
|
||||||
cd src/wasm-lib/kcl; cargo bench -- iai
|
cd src/wasm-lib/kcl; cargo bench --all-features -- iai
|
||||||
|
env:
|
||||||
|
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||||
|
|
||||||
|
40
.github/workflows/cargo-check.yml
vendored
Normal file
40
.github/workflows/cargo-check.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/cargo-check.yml
|
||||||
|
pull_request:
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
name: cargo check
|
||||||
|
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
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Rust Cache
|
||||||
|
uses: Swatinem/rust-cache@v2.6.1
|
||||||
|
|
||||||
|
- name: Run check
|
||||||
|
run: |
|
||||||
|
cd "${{ matrix.dir }}"
|
||||||
|
# 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
|
||||||
|
cargo check --all --features disable-println --features pyo3
|
11
.github/workflows/cargo-clippy.yml
vendored
11
.github/workflows/cargo-clippy.yml
vendored
@ -9,6 +9,12 @@ on:
|
|||||||
- '**.rs'
|
- '**.rs'
|
||||||
- .github/workflows/cargo-clippy.yml
|
- .github/workflows/cargo-clippy.yml
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- '**/Cargo.toml'
|
||||||
|
- '**/Cargo.lock'
|
||||||
|
- '**/rust-toolchain.toml'
|
||||||
|
- '**.rs'
|
||||||
|
- .github/workflows/cargo-clippy.yml
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
@ -54,3 +60,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd "${{ matrix.dir }}"
|
cd "${{ matrix.dir }}"
|
||||||
cargo clippy --all --tests --benches -- -D warnings
|
cargo clippy --all --tests --benches -- -D warnings
|
||||||
|
# If this fails, run "cargo check" to update Cargo.lock,
|
||||||
|
# then add Cargo.lock to the PR.
|
||||||
|
- name: Check Cargo.lock doesn't need updating
|
||||||
|
run: |
|
||||||
|
cargo check --locked || echo "Pls run cargo check and commit the changed Cargo.lock"
|
||||||
|
168
.github/workflows/ci.yml
vendored
168
.github/workflows/ci.yml
vendored
@ -13,7 +13,8 @@ on:
|
|||||||
# Will checkout the last commit from the default branch (main as of 2023-10-04)
|
# Will checkout the last commit from the default branch (main as of 2023-10-04)
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_RELEASE: ${{ github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'pull_request' && contains(github.event.pull_request.title, 'Cut release v') }}
|
CUT_RELEASE_PR: ${{ github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'Cut release v')) }}
|
||||||
|
BUILD_RELEASE: ${{ github.event_name == 'release' || github.event_name == 'schedule' || github.event_name == 'pull_request' && (contains(github.event.pull_request.title, 'Cut release v')) }}
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -110,8 +111,14 @@ jobs:
|
|||||||
echo "$(jq --arg name 'Zoo Modeling App (Nightly)' \
|
echo "$(jq --arg name 'Zoo Modeling App (Nightly)' \
|
||||||
'.productName=$name' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json
|
'.productName=$name' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json
|
||||||
|
|
||||||
|
- name: Set updater test version
|
||||||
|
if: ${{ env.CUT_RELEASE_PR == 'true' }}
|
||||||
|
run: |
|
||||||
|
echo "$(jq --arg url 'https://dl.zoo.dev/releases/modeling-app/test/last_update.json' \
|
||||||
|
'.plugins.updater.endpoints[]=$url' src-tauri/tauri.release.conf.json --indent 2)" > src-tauri/tauri.release.conf.json
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: github.event_name == 'schedule'
|
if: ${{ github.event_name == 'schedule' || env.CUT_RELEASE_PR == 'true' }}
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
package.json
|
package.json
|
||||||
@ -130,12 +137,15 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [macos-14, ubuntu-latest, windows-latest]
|
os: [macos-14, ubuntu-latest, windows-latest]
|
||||||
env:
|
env:
|
||||||
|
# Specific Apple Universal target for macos
|
||||||
TAURI_ARGS_MACOS: ${{ matrix.os == 'macos-14' && '--target universal-apple-darwin' || '' }}
|
TAURI_ARGS_MACOS: ${{ matrix.os == 'macos-14' && '--target universal-apple-darwin' || '' }}
|
||||||
|
# Only build executable on linux (no appimage or deb)
|
||||||
TAURI_ARGS_UBUNTU: ${{ matrix.os == 'ubuntu-latest' && '--bundles' || '' }}
|
TAURI_ARGS_UBUNTU: ${{ matrix.os == 'ubuntu-latest' && '--bundles' || '' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
|
||||||
- name: Copy updated .json files
|
- name: Copy updated .json files
|
||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
@ -145,6 +155,14 @@ jobs:
|
|||||||
cp artifact/src-tauri/tauri.conf.json src-tauri/tauri.conf.json
|
cp artifact/src-tauri/tauri.conf.json src-tauri/tauri.conf.json
|
||||||
cp artifact/src-tauri/tauri.release.conf.json src-tauri/tauri.release.conf.json
|
cp artifact/src-tauri/tauri.release.conf.json src-tauri/tauri.release.conf.json
|
||||||
|
|
||||||
|
- name: Update WebView2 on Windows
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
# Workaround needed to build the tauri windows app with matching edge version.
|
||||||
|
# From https://github.com/actions/runner-images/issues/9538
|
||||||
|
run: |
|
||||||
|
Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/p/?LinkId=2124703' -OutFile 'setup.exe'
|
||||||
|
Start-Process -FilePath setup.exe -Verb RunAs -Wait
|
||||||
|
|
||||||
- name: Install ubuntu system dependencies
|
- name: Install ubuntu system dependencies
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
@ -170,9 +188,7 @@ jobs:
|
|||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
# TODO: re-enable for Windows builds, see https://github.com/tauri-apps/tauri/issues/9045
|
|
||||||
- name: Setup Rust cache
|
- name: Setup Rust cache
|
||||||
if: matrix.os != 'windows-latest'
|
|
||||||
uses: swatinem/rust-cache@v2
|
uses: swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src-tauri -> target'
|
workspaces: './src-tauri -> target'
|
||||||
@ -230,15 +246,100 @@ jobs:
|
|||||||
shell: cmd
|
shell: cmd
|
||||||
|
|
||||||
- name: Build the app (debug)
|
- name: Build the app (debug)
|
||||||
uses: tauri-apps/tauri-action@v0
|
|
||||||
if: ${{ env.BUILD_RELEASE == 'false' }}
|
if: ${{ env.BUILD_RELEASE == 'false' }}
|
||||||
with:
|
run: "yarn tauri build --debug ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||||
includeRelease: false
|
|
||||||
includeDebug: true
|
|
||||||
args: "${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
|
||||||
|
|
||||||
|
- name: Build for Mac TestFlight (nightly)
|
||||||
|
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
unset APPLE_SIGNING_IDENTITY
|
||||||
|
unset APPLE_CERTIFICATE
|
||||||
|
sign_app="3rd Party Mac Developer Application: KittyCAD Inc (${APPLE_TEAM_ID})"
|
||||||
|
sign_install="3rd Party Mac Developer Installer: KittyCAD Inc (${APPLE_TEAM_ID})"
|
||||||
|
profile="src-tauri/entitlements/Mac_App_Distribution.provisionprofile"
|
||||||
|
|
||||||
|
mkdir -p src-tauri/entitlements
|
||||||
|
echo -n "${APPLE_STORE_PROVISIONING_PROFILE}" | base64 --decode -o "${profile}"
|
||||||
|
|
||||||
|
echo -n "${APPLE_STORE_DISTRIBUTION_CERT}" | base64 --decode -o "dist.cer"
|
||||||
|
echo -n "${APPLE_STORE_INSTALLER_CERT}" | base64 --decode -o "installer.cer"
|
||||||
|
|
||||||
|
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||||
|
KEYCHAIN_PASSWORD="password"
|
||||||
|
|
||||||
|
# create temporary keychain
|
||||||
|
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
|
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||||
|
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
|
|
||||||
|
# import certificate to keychain
|
||||||
|
security import "dist.cer" -P "$APPLE_STORE_P12_PASSWORD" -k $KEYCHAIN_PATH -f pkcs12 -t cert -A
|
||||||
|
security import "installer.cer" -P "$APPLE_STORE_P12_PASSWORD" -k $KEYCHAIN_PATH -f pkcs12 -t cert -A
|
||||||
|
|
||||||
|
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
|
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||||
|
|
||||||
|
target="universal-apple-darwin"
|
||||||
|
|
||||||
|
# Turn off the default target
|
||||||
|
# We don't want to install the updater for the apple store build
|
||||||
|
sed -i.bu "s/default =/# default =/" src-tauri/Cargo.toml
|
||||||
|
rm src-tauri/Cargo.toml.bu
|
||||||
|
git diff src-tauri/Cargo.toml
|
||||||
|
|
||||||
|
yarn tauri build --target "${target}" --verbose --config src-tauri/tauri.app-store.conf.json
|
||||||
|
|
||||||
|
app_path="src-tauri/target/${target}/release/bundle/macos/Zoo Modeling App.app"
|
||||||
|
build_name="src-tauri/target/${target}/release/bundle/macos/Zoo Modeling App.pkg"
|
||||||
|
cp_dir="src-tauri/target/${target}/release/bundle/macos/Zoo Modeling App.app/Contents/embedded.provisionprofile"
|
||||||
|
entitlements="src-tauri/entitlements/app-store.entitlements"
|
||||||
|
|
||||||
|
cp "${profile}" "${cp_dir}"
|
||||||
|
|
||||||
|
codesign --deep --force -s "${sign_app}" --entitlements "${entitlements}" "${app_path}"
|
||||||
|
|
||||||
|
productbuild --component "${app_path}" /Applications/ --sign "${sign_install}" "${build_name}"
|
||||||
|
|
||||||
|
# Undo the changes to the Cargo.toml
|
||||||
|
git checkout src-tauri/Cargo.toml
|
||||||
|
|
||||||
|
env:
|
||||||
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
|
APPLE_STORE_PROVISIONING_PROFILE: ${{ secrets.APPLE_STORE_PROVISIONING_PROFILE }}
|
||||||
|
APPLE_STORE_DISTRIBUTION_CERT: ${{ secrets.APPLE_STORE_DISTRIBUTION_CERT }}
|
||||||
|
APPLE_STORE_INSTALLER_CERT: ${{ secrets.APPLE_STORE_INSTALLER_CERT }}
|
||||||
|
APPLE_STORE_P12_PASSWORD: ${{ secrets.APPLE_STORE_P12_PASSWORD }}
|
||||||
|
|
||||||
|
|
||||||
|
- name: 'Upload to Mac TestFlight (nightly)'
|
||||||
|
uses: apple-actions/upload-testflight-build@v1
|
||||||
|
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
||||||
|
with:
|
||||||
|
app-path: 'src-tauri/target/universal-apple-darwin/release/bundle/macos/Zoo Modeling App.pkg'
|
||||||
|
issuer-id: ${{ secrets.APPLE_STORE_ISSUER_ID }}
|
||||||
|
api-key-id: ${{ secrets.APPLE_STORE_API_KEY_ID }}
|
||||||
|
api-private-key: ${{ secrets.APPLE_STORE_API_PRIVATE_KEY }}
|
||||||
|
app-type: osx
|
||||||
|
|
||||||
|
|
||||||
|
- name: Clean up after Mac TestFlight (nightly)
|
||||||
|
if: ${{ github.event_name == 'schedule' && matrix.os == 'macos-14' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git status
|
||||||
|
# remove our target builds because we want to make sure the later build
|
||||||
|
# includes the updater, and that anything we changed with the target
|
||||||
|
# does not persist
|
||||||
|
rm -rf src-tauri/target
|
||||||
|
# Lets get rid of the info.plist for the normal mac builds since its
|
||||||
|
# being sketchy.
|
||||||
|
rm src-tauri/Info.plist
|
||||||
|
|
||||||
|
# We do this after the apple store because the apple store build is
|
||||||
|
# specific and we want to overwrite it with the this new build after and
|
||||||
|
# not upload the apple store build to the public bucket
|
||||||
- name: Build the app (release) and sign
|
- name: Build the app (release) and sign
|
||||||
uses: tauri-apps/tauri-action@v0
|
|
||||||
if: ${{ env.BUILD_RELEASE == 'true' }}
|
if: ${{ env.BUILD_RELEASE == 'true' }}
|
||||||
env:
|
env:
|
||||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
@ -250,8 +351,7 @@ jobs:
|
|||||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||||
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||||
TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}"
|
TAURI_CONF_ARGS: "--config ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}"
|
||||||
with:
|
run: "yarn tauri build ${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
||||||
args: "${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_ARGS_MACOS }} ${{ env.TAURI_ARGS_UBUNTU }}"
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
if: matrix.os != 'ubuntu-latest'
|
if: matrix.os != 'ubuntu-latest'
|
||||||
@ -261,11 +361,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: "${{ env.PREFIX }}/${{ env.MODE }}/bundle/*/*"
|
path: "${{ env.PREFIX }}/${{ env.MODE }}/bundle/*/*"
|
||||||
|
|
||||||
# TODO: re-enable linux e2e tests when possible
|
|
||||||
- name: Run e2e tests (linux only)
|
- name: Run e2e tests (linux only)
|
||||||
if: false
|
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
run: |
|
run: |
|
||||||
cargo install tauri-driver
|
cargo install tauri-driver --force
|
||||||
source .env.${{ env.BUILD_RELEASE == 'true' && 'production' || 'development' }}
|
source .env.${{ env.BUILD_RELEASE == 'true' && 'production' || 'development' }}
|
||||||
export VITE_KC_API_BASE_URL
|
export VITE_KC_API_BASE_URL
|
||||||
xvfb-run yarn test:e2e:tauri
|
xvfb-run yarn test:e2e:tauri
|
||||||
@ -273,8 +372,45 @@ jobs:
|
|||||||
E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/zoo-modeling-app"
|
E2E_APPLICATION: "./src-tauri/target/${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}/zoo-modeling-app"
|
||||||
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
|
||||||
|
- name: Run e2e tests (windows only)
|
||||||
|
if: ${{ matrix.os == 'windows-latest' && github.event_name != 'release' && github.event_name != 'schedule' }}
|
||||||
|
run: |
|
||||||
|
cargo install tauri-driver --force
|
||||||
|
yarn wdio run wdio.conf.ts
|
||||||
|
env:
|
||||||
|
E2E_APPLICATION: ".\\src-tauri\\target\\${{ env.BUILD_RELEASE == 'true' && 'release' || 'debug' }}\\Zoo Modeling App.exe"
|
||||||
|
KITTYCAD_API_TOKEN: ${{ env.BUILD_RELEASE == 'true' && secrets.KITTYCAD_API_TOKEN || secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
VITE_KC_API_BASE_URL: ${{ env.BUILD_RELEASE == 'true' && 'https://api.zoo.dev' || 'https://api.dev.zoo.dev' }}
|
||||||
|
E2E_TAURI_ENABLED: true
|
||||||
|
TS_NODE_COMPILER_OPTIONS: '{"module": "commonjs"}'
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
if: ${{ env.CUT_RELEASE_PR == 'true' }}
|
||||||
|
|
||||||
|
- name: Copy updated .json file for updater test
|
||||||
|
if: ${{ env.CUT_RELEASE_PR == 'true' }}
|
||||||
|
run: |
|
||||||
|
ls -l artifact
|
||||||
|
cp artifact/src-tauri/tauri.release.conf.json src-tauri/tauri.release.conf.json
|
||||||
|
cat src-tauri/tauri.release.conf.json
|
||||||
|
|
||||||
|
- name: Build the app (release, updater test)
|
||||||
|
if: ${{ env.CUT_RELEASE_PR == 'true' && matrix.os != 'ubuntu-latest' }}
|
||||||
|
env:
|
||||||
|
TAURI_CONF_ARGS: "-c ${{ matrix.os == 'windows-latest' && 'src-tauri\\tauri.release.conf.json' || 'src-tauri/tauri.release.conf.json' }}"
|
||||||
|
TAURI_BUNDLE_ARGS: "-b ${{ matrix.os == 'windows-latest' && 'msi' || 'dmg' }}"
|
||||||
|
run: "yarn tauri build ${{ env.TAURI_CONF_ARGS }} ${{ env.TAURI_BUNDLE_ARGS }} ${{ env.TAURI_ARGS_MACOS }}"
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ env.CUT_RELEASE_PR == 'true' && matrix.os != 'ubuntu-latest' }}
|
||||||
|
with:
|
||||||
|
path: "${{ matrix.os == 'macos-14' && 'src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg' || 'src-tauri/target/release/bundle/msi/*.msi' }}"
|
||||||
|
name: updater-test
|
||||||
|
|
||||||
|
|
||||||
publish-apps-release:
|
publish-apps-release:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
|
if: ${{ github.event_name == 'release' || github.event_name == 'schedule' }}
|
||||||
needs: [check-format, check-types, check-typos, build-test-web, prepare-json-files, build-test-apps]
|
needs: [check-format, check-types, check-typos, build-test-web, prepare-json-files, build-test-apps]
|
||||||
@ -349,7 +485,7 @@ jobs:
|
|||||||
cat last_download.json
|
cat last_download.json
|
||||||
|
|
||||||
- name: Authenticate to Google Cloud
|
- name: Authenticate to Google Cloud
|
||||||
uses: 'google-github-actions/auth@v2.1.2'
|
uses: 'google-github-actions/auth@v2.1.3'
|
||||||
with:
|
with:
|
||||||
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
credentials_json: '${{ secrets.GOOGLE_CLOUD_DL_SA }}'
|
||||||
|
|
||||||
|
37
.github/workflows/create-release.yml
vendored
Normal file
37
.github/workflows/create-release.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name: Create Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: read
|
||||||
|
if: contains(github.event.head_commit.message, 'Cut release v')
|
||||||
|
steps:
|
||||||
|
- uses: actions/github-script@v7
|
||||||
|
name: Read Cut release PR info and create release
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { owner, repo } = context.repo
|
||||||
|
const pulls = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
commit_sha: context.sha,
|
||||||
|
})
|
||||||
|
const { title, body } = pulls.data[0]
|
||||||
|
const version = title.split('Cut release ')[1]
|
||||||
|
|
||||||
|
const result = await github.rest.repos.createRelease({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
body,
|
||||||
|
tag_name: version,
|
||||||
|
name: version,
|
||||||
|
draft: true,
|
||||||
|
})
|
||||||
|
console.log(result)
|
273
.github/workflows/playwright.yml
vendored
273
.github/workflows/playwright.yml
vendored
@ -13,7 +13,7 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
actions: read
|
actions: read
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ jobs:
|
|||||||
|
|
||||||
- id: filter
|
- id: filter
|
||||||
name: Check for Rust changes
|
name: Check for Rust changes
|
||||||
uses: dorny/paths-filter@v2
|
uses: dorny/paths-filter@v3
|
||||||
with:
|
with:
|
||||||
filters: |
|
filters: |
|
||||||
rust:
|
rust:
|
||||||
@ -38,6 +38,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest-8-cores
|
runs-on: ubuntu-latest-8-cores
|
||||||
needs: check-rust-changes
|
needs: check-rust-changes
|
||||||
steps:
|
steps:
|
||||||
|
- name: Tune GitHub-hosted runner network
|
||||||
|
uses: smorimoto/tune-github-hosted-runner-network@v1
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@ -46,102 +48,158 @@ jobs:
|
|||||||
- uses: KittyCAD/action-install-cli@main
|
- uses: KittyCAD/action-install-cli@main
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
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
|
- name: Install Playwright Browsers
|
||||||
run: yarn playwright install --with-deps
|
run: yarn playwright install --with-deps
|
||||||
- name: download wasm
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||||
uses: actions/download-artifact@v2
|
uses: dawidd6/action-download-artifact@v6
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
||||||
name: wasm-bundle
|
name: wasm-bundle
|
||||||
|
workflow: build-and-store-wasm.yml
|
||||||
|
branch: main
|
||||||
path: src/wasm-lib/pkg
|
path: src/wasm-lib/pkg
|
||||||
- name: copy wasm blob
|
- name: copy wasm blob
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||||
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
- name: Setup Rust
|
- name: Cache Wasm (because rust diff)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Cache wasm
|
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
- name: Cache wasm
|
- name: OR Cache Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
- name: build wasm
|
- name: Install vector
|
||||||
|
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'
|
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: build wasm
|
- name: OR Build Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: build web
|
- name: build web
|
||||||
run: yarn build:local
|
run: yarn build:local
|
||||||
- name: Run ubuntu/chrome snapshots
|
# - name: Run ubuntu/chrome snapshots
|
||||||
run: yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
|
# continue-on-error: true
|
||||||
|
# run: |
|
||||||
|
# yarn playwright test --project="Google Chrome" --update-snapshots e2e/playwright/snapshot-tests.spec.ts
|
||||||
|
# env:
|
||||||
|
# CI: true
|
||||||
|
# token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
|
# snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
||||||
|
# - name: Clean up test-results
|
||||||
|
# if: always()
|
||||||
|
# continue-on-error: true
|
||||||
|
# run: rm -r test-results
|
||||||
|
# - name: check for changes
|
||||||
|
# id: git-check
|
||||||
|
# run: |
|
||||||
|
# git add .
|
||||||
|
# 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'
|
||||||
|
# run: |
|
||||||
|
# git add .
|
||||||
|
# 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 "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || 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-ubuntu-${{ github.sha }}
|
||||||
|
# path: playwright-report/
|
||||||
|
# retention-days: 30
|
||||||
|
# # if have previous run results, use them
|
||||||
|
# - uses: actions/download-artifact@v4
|
||||||
|
# if: always()
|
||||||
|
# continue-on-error: true
|
||||||
|
# with:
|
||||||
|
# name: test-results-ubuntu-${{ github.sha }}
|
||||||
|
# path: test-results/
|
||||||
|
- name: Run ubuntu/chrome flow (with retries)
|
||||||
|
id: retry
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
yarn playwright test --project="Google Chrome" --workers=1 --grep=@focus --repeat-each=100
|
||||||
|
# if [[ ! -f "test-results/.last-run.json" ]]; then
|
||||||
|
# # if no last run artifact, than run plawright normally
|
||||||
|
# echo "run playwright normally"
|
||||||
|
# yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
|
||||||
|
# # # send to axiom
|
||||||
|
# node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
|
||||||
|
# else
|
||||||
|
# echo "run playwright with last failed tests"
|
||||||
|
# yarn playwright test --project="Google Chrome" --last-failed e2e/playwright/flow-tests.spec.ts
|
||||||
|
# # send to axiom
|
||||||
|
# node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
|
||||||
|
# fi
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
|
# - name: send to axiom
|
||||||
- uses: actions/upload-artifact@v3
|
# if: always()
|
||||||
if: always()
|
# shell: bash
|
||||||
with:
|
# run: |
|
||||||
name: playwright-report
|
# node playwrightProcess.mjs | tee /tmp/github-actions.log
|
||||||
path: playwright-report/
|
|
||||||
retention-days: 30
|
|
||||||
- name: check for changes
|
|
||||||
id: git-check
|
|
||||||
run: |
|
|
||||||
git add .
|
|
||||||
if git status | grep -q "Changes to be committed"
|
|
||||||
then
|
|
||||||
echo "::set-output name=modified::true"
|
|
||||||
else
|
|
||||||
echo "::set-output name=modified::false"
|
|
||||||
fi
|
|
||||||
- name: Commit changes, if any
|
|
||||||
if: steps.git-check.outputs.modified == 'true'
|
|
||||||
run: |
|
|
||||||
git add .
|
|
||||||
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 safari works on ubuntu remove the os part of the commit message
|
|
||||||
git commit -am "A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)" || true
|
|
||||||
git push
|
|
||||||
git push origin ${{ github.head_ref }}
|
|
||||||
- name: Run ubuntu/chrome flow
|
|
||||||
run: yarn playwright test --project="Google Chrome" e2e/playwright/flow-tests.spec.ts
|
|
||||||
env:
|
|
||||||
CI: true
|
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: playwright-report
|
|
||||||
path: playwright-report/
|
|
||||||
retention-days: 30
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
if: github.ref == 'refs/heads/main'
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: wasm-bundle
|
name: test-results-ubuntu-${{ github.sha }}
|
||||||
path: src/wasm-lib/pkg
|
path: test-results/
|
||||||
|
retention-days: 30
|
||||||
|
overwrite: true
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: playwright-report-ubuntu-${{ github.sha }}
|
||||||
|
path: playwright-report/
|
||||||
|
retention-days: 30
|
||||||
|
overwrite: true
|
||||||
|
|
||||||
playwright-macos:
|
playwright-macos:
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: macos-14
|
runs-on: macos-14-large
|
||||||
needs: check-rust-changes
|
needs: check-rust-changes
|
||||||
steps:
|
steps:
|
||||||
|
- name: Tune GitHub-hosted runner network
|
||||||
|
uses: smorimoto/tune-github-hosted-runner-network@v1
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@ -149,59 +207,104 @@ jobs:
|
|||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
|
- name: Cache Playwright Browsers
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/ms-playwright
|
||||||
|
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-playwright-
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: yarn playwright install --with-deps
|
run: yarn playwright install --with-deps
|
||||||
- name: download wasm
|
- name: Download Wasm Cache
|
||||||
id: download-wasm
|
id: download-wasm
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||||
uses: actions/download-artifact@v4
|
uses: dawidd6/action-download-artifact@v6
|
||||||
with:
|
|
||||||
name: wasm-bundle
|
|
||||||
path: src/wasm-lib/pkg
|
|
||||||
continue-on-error: true
|
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
|
- name: copy wasm blob
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
if: needs.check-rust-changes.outputs.rust-changed == 'false'
|
||||||
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
run: cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Setup Rust
|
- name: Setup Rust
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
- name: Setup Rust
|
- name: Cache Wasm (because rust diff)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
- name: Cache wasm
|
|
||||||
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
- name: Cache wasm
|
- name: OR Cache Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: './src/wasm-lib'
|
workspaces: './src/wasm-lib'
|
||||||
- name: build wasm
|
- name: Install vector
|
||||||
|
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'
|
if: needs.check-rust-changes.outputs.rust-changed == 'true'
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: build wasm
|
- name: OR Build Wasm (because wasm cache failed)
|
||||||
if: steps.download-wasm.outcome == 'failure'
|
if: steps.download-wasm.outcome == 'failure'
|
||||||
run: yarn build:wasm
|
run: yarn build:wasm
|
||||||
- name: build web
|
- name: build web
|
||||||
run: yarn build:local
|
run: yarn build:local
|
||||||
- name: Run macos/safari flow
|
# if have previous run results, use them
|
||||||
# safari doesn't work on Ubuntu because of the same reason tauri doesn't (webRTC issues)
|
- uses: actions/download-artifact@v4
|
||||||
# TODO remove this and the matrix and run all tests on ubuntu when this is fixed
|
if: ${{ always() }}
|
||||||
run: yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
name: test-results-macos-${{ github.sha }}
|
||||||
|
path: test-results/
|
||||||
|
- name: Run macos/safari flow (with retries)
|
||||||
|
id: retry
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
yarn playwright test --project="webkit" --workers=1 --grep=@focus --repeat-each=1
|
||||||
|
# if [[ ! -f "test-results/.last-run.json" ]]; then
|
||||||
|
# # if no last run artifact, than run plawright normally
|
||||||
|
# echo "run playwright normally"
|
||||||
|
# yarn playwright test --project="webkit" e2e/playwright/flow-tests.spec.ts
|
||||||
|
# # # send to axiom
|
||||||
|
# node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
|
||||||
|
# else
|
||||||
|
# echo "run playwright with last failed tests"
|
||||||
|
# yarn playwright test --project="webkit" --last-failed e2e/playwright/flow-tests.spec.ts
|
||||||
|
# # send to axiom
|
||||||
|
# node playwrightProcess.mjs | tee /tmp/github-actions.log > /dev/null 2>&1
|
||||||
|
# fi
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
if: always()
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: test-results-macos-${{ github.sha }}
|
||||||
|
path: test-results/
|
||||||
|
retention-days: 30
|
||||||
|
overwrite: true
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: ${{ always() }}
|
||||||
|
with:
|
||||||
|
name: playwright-report-macos-${{ github.sha }}
|
||||||
path: playwright-report/
|
path: playwright-report/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
- uses: actions/upload-artifact@v4
|
overwrite: true
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
with:
|
|
||||||
name: wasm-bundle
|
|
||||||
path: src/wasm-lib/pkg
|
|
||||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -17,6 +17,7 @@
|
|||||||
.env.development.local
|
.env.development.local
|
||||||
.env.test.local
|
.env.test.local
|
||||||
.env.production.local
|
.env.production.local
|
||||||
|
.direnv
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
@ -54,3 +55,8 @@ src/**/*.typegen.ts
|
|||||||
src-tauri/gen
|
src-tauri/gen
|
||||||
|
|
||||||
src/wasm-lib/grackle/stdlib_cube_partial.json
|
src/wasm-lib/grackle/stdlib_cube_partial.json
|
||||||
|
Mac_App_Distribution.provisionprofile
|
||||||
|
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
venv
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Ignore artifacts:
|
# Ignore artifacts:
|
||||||
build
|
build
|
||||||
|
dist
|
||||||
coverage
|
coverage
|
||||||
|
|
||||||
# Ignore Rust projects:
|
# Ignore Rust projects:
|
||||||
@ -9,5 +10,6 @@ src/wasm-lib/pkg
|
|||||||
src/wasm-lib/kcl/bindings
|
src/wasm-lib/kcl/bindings
|
||||||
e2e/playwright/export-snapshots
|
e2e/playwright/export-snapshots
|
||||||
|
|
||||||
|
|
||||||
# XState generated files
|
# XState generated files
|
||||||
src/machines/**.typegen.ts
|
src/machines/**.typegen.ts
|
||||||
|
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"geos"
|
|
||||||
],
|
|
||||||
"editor.tabSize": 2,
|
|
||||||
"editor.insertSpaces": true,
|
|
||||||
}
|
|
17
Makefile
Normal file
17
Makefile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
.PHONY: dev
|
||||||
|
|
||||||
|
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
|
||||||
|
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
|
||||||
|
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
|
||||||
|
|
||||||
|
dev: node_modules public/wasm_lib_bg.wasm $(XSTATE_TYPEGENS)
|
||||||
|
yarn start
|
||||||
|
|
||||||
|
$(XSTATE_TYPEGENS): $(TS_SRC)
|
||||||
|
yarn xstate typegen 'src/**/*.ts?(x)'
|
||||||
|
|
||||||
|
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
|
||||||
|
yarn build:wasm-dev
|
||||||
|
|
||||||
|
node_modules: package.json yarn.lock
|
||||||
|
yarn install
|
180
README.md
180
README.md
@ -60,6 +60,12 @@ followed by:
|
|||||||
yarn build:wasm-dev
|
yarn build:wasm-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
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)
|
That will build the WASM binary and put in the `public` dir (though gitignored)
|
||||||
|
|
||||||
finally, to run the web app only, run:
|
finally, to run the web app only, run:
|
||||||
@ -68,7 +74,13 @@ finally, to run the web app only, run:
|
|||||||
yarn start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
## Developing in Chrome
|
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 ofcourse, 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
|
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/).
|
[blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/).
|
||||||
@ -77,24 +89,6 @@ 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
|
the eye with a slash through it in the URL bar, and clicking on "Enable
|
||||||
Third-Party Cookies".
|
Third-Party Cookies".
|
||||||
|
|
||||||
## Running tests
|
|
||||||
|
|
||||||
First, start the dev server following "Running a development build" above.
|
|
||||||
|
|
||||||
Then in another terminal tab, run:
|
|
||||||
|
|
||||||
```
|
|
||||||
yarn test
|
|
||||||
```
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
For running the rust (not tauri rust though) only, you can
|
|
||||||
```bash
|
|
||||||
cd src/wasm-lib
|
|
||||||
cargo test
|
|
||||||
```
|
|
||||||
|
|
||||||
## Tauri
|
## Tauri
|
||||||
|
|
||||||
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
|
To spin up up tauri dev, `yarn install` and `yarn build:wasm-dev` need to have been done before hand then
|
||||||
@ -130,35 +124,40 @@ Before you submit a contribution PR to this repo, please ensure that:
|
|||||||
|
|
||||||
## Release a new version
|
## Release a new version
|
||||||
|
|
||||||
1. Bump the versions in the .json files by creating a `Cut release v{x}.{y}.{z}` PR, committing the changes from
|
#### 1. Bump the versions by running `./make-release.sh` and create a Cut Release PR
|
||||||
|
|
||||||
```bash
|
That will create the branch with the updated json files for you:
|
||||||
VERSION=x.y.z yarn run bump-jsons
|
- run `./make-release.sh` or `./make-release.sh patch` for a patch update;
|
||||||
```
|
- run `./make-release.sh minor` for minor; or
|
||||||
|
- run `./make-release.sh major` for major.
|
||||||
|
|
||||||
Alternatively you can try the experimental `make-release.sh` bash script that will create the branch with the updated json files for you.
|
After it runs you should just need the push the branch and open a PR.
|
||||||
run `./make-release.sh` for a patch update
|
|
||||||
run `./make-release.sh "minor"` for minor
|
|
||||||
run `./make-release.sh "major"` for major
|
|
||||||
|
|
||||||
The PR may serve as a place to discuss the human-readable changelog and extra QA. A quick way of getting PR's merged since the last bump is to [use this PR filter](https://github.com/KittyCAD/modeling-app/pulls?q=is%3Apr+sort%3Aupdated-desc+is%3Amerged+), open up the browser console and paste in the following
|
**Important:** It needs to be prefixed with `Cut release v` to build in release mode and a few other things to test in the best context possible, the intent would be for instance to have `Cut release v1.2.3` for the `v1.2.3` release candidate.
|
||||||
|
|
||||||
```typescript
|
The PR may then serve as a place to discuss the human-readable changelog and extra QA. The `make-release.sh` tool suggests a changelog for you too to be used as PR description, just make sure to delete lines that are not user facing.
|
||||||
console.log(
|
|
||||||
'- ' +
|
|
||||||
Array.from(
|
|
||||||
document.querySelectorAll('[data-hovercard-type="pull_request"]')
|
|
||||||
).map((a) => `[${a.innerText}](${a.href})`).join(`
|
|
||||||
- `)
|
|
||||||
)
|
|
||||||
```
|
|
||||||
grab the md list and delete any that are older than the last bump
|
|
||||||
|
|
||||||
2. Merge the PR
|
#### 2. Smoke test artifacts from the Cut Release PR
|
||||||
|
|
||||||
3. Create a new release and tag pointing to the bump version commit using semantic versioning `v{x}.{y}.{z}`
|
The release builds can be find under the `artifact` zip, at the very bottom of the `ci` action page for each commit on this branch.
|
||||||
|
|
||||||
|
We don't have a strict process, but click around and check for anything obvious, posting results as comments in the Cut Release PR.
|
||||||
|
|
||||||
|
The other `ci` output in Cut Release PRs is `updater-test`, because we don't have a way to test this fully automated, we have a semi-automated process. Download updater-test zip file, install the app, run it, expect an updater prompt to a dummy v0.99.99, install it and check that the app comes back at that version (on both macOS and Windows).
|
||||||
|
|
||||||
|
#### 3. Merge the Cut Release PR
|
||||||
|
|
||||||
|
This will kick the `create-release` action, that creates a _Draft_ release out of this Cut Release PR merge after less than a minute, with the new version as title and Cut Release PR as description.
|
||||||
|
|
||||||
|
|
||||||
|
#### 4. Publish the release
|
||||||
|
|
||||||
|
Head over to https://github.com/KittyCAD/modeling-app/releases, the draft release corresponding to the merged Cut Release PR should show up at the top as _Draft_. Click on it, verify the content, and hit _Publish_.
|
||||||
|
|
||||||
|
#### 5. Profit
|
||||||
|
|
||||||
|
A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions, which can be found under `release` event filter.
|
||||||
|
|
||||||
4. A new Action kicks in at https://github.com/KittyCAD/modeling-app/actions, uploading artifacts to the release
|
|
||||||
|
|
||||||
## Fuzzing the parser
|
## Fuzzing the parser
|
||||||
|
|
||||||
@ -181,39 +180,51 @@ $ cargo +nightly fuzz run parser
|
|||||||
For more information on fuzzing you can check out
|
For more information on fuzzing you can check out
|
||||||
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
|
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
### Playwright
|
### Playwright tests
|
||||||
|
|
||||||
|
For a portable way to run Playwright you'll need Docker.
|
||||||
|
|
||||||
|
After that, open a terminal and run:
|
||||||
|
|
||||||
First time running plawright locally, you'll need to add the secrets file
|
|
||||||
```bash
|
```bash
|
||||||
touch ./e2e/playwright/playwright-secrets.env
|
docker run --network host --rm --init -it playwright/chrome:playwright-1.43.1
|
||||||
printf 'token="your-token"\nsnapshottoken="your-snapshot-token"' > ./e2e/playwright/playwright-secrets.env
|
```
|
||||||
|
|
||||||
|
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>
|
||||||
|
```
|
||||||
|
|
||||||
|
An example of a `<test suite>` is: `e2e/playwright/flow-tests.spec.ts`
|
||||||
|
|
||||||
|
YOU WILL NEED A PLAYWRIGHT-SECRETS.ENV FILE:
|
||||||
|
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ./e2e/playwright/playwright-secrets.env
|
||||||
|
token=<your-token>
|
||||||
|
snapshottoken=<your-snapshot-token>
|
||||||
```
|
```
|
||||||
then replace "your-token" with a dev token from dev.zoo.dev/account/api-tokens
|
then replace "your-token" with a dev token from dev.zoo.dev/account/api-tokens
|
||||||
|
|
||||||
then:
|
|
||||||
run playwright
|
|
||||||
```
|
|
||||||
yarn playwright test
|
|
||||||
```
|
|
||||||
|
|
||||||
run a specific test suite
|
|
||||||
```
|
|
||||||
yarn playwright test src/e2e-tests/example.spec.ts
|
|
||||||
```
|
|
||||||
|
|
||||||
run a specific test change the test from `test('...` to `test.only('...`
|
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)
|
(note if you commit this, the tests will instantly fail without running any of the tests)
|
||||||
|
|
||||||
run headed
|
run headed
|
||||||
|
|
||||||
```
|
```
|
||||||
yarn playwright test --headed
|
yarn playwright test --headed
|
||||||
```
|
```
|
||||||
|
|
||||||
run with step through debugger
|
run with step through debugger
|
||||||
|
|
||||||
```
|
```
|
||||||
PWDEBUG=1 yarn playwright test
|
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.
|
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.
|
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.
|
||||||
|
|
||||||
@ -258,12 +269,42 @@ Where `./store` should look like this
|
|||||||
|
|
||||||
</details>
|
</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.
|
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:nowatch
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd src/wasm-lib
|
||||||
|
cargo test
|
||||||
|
```
|
||||||
|
|
||||||
#### Some notes on CI
|
#### 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.
|
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?
|
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.
|
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.
|
||||||
@ -289,3 +330,26 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
|
|||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### Tauri e2e tests
|
||||||
|
|
||||||
|
#### Windows (local only until the CI edge version mismatch is fixed)
|
||||||
|
|
||||||
|
```
|
||||||
|
yarn install
|
||||||
|
yarn build:wasm-dev
|
||||||
|
cp src/wasm-lib/pkg/wasm_lib_bg.wasm public
|
||||||
|
yarn vite build --mode development
|
||||||
|
yarn tauri build --debug -b
|
||||||
|
$env:KITTYCAD_API_TOKEN="<YOUR_KITTYCAD_API_TOKEN>"
|
||||||
|
$env:VITE_KC_API_BASE_URL="https://api.dev.zoo.dev"
|
||||||
|
$env:E2E_TAURI_ENABLED="true"
|
||||||
|
$env:TS_NODE_COMPILER_OPTIONS='{"module": "commonjs"}'
|
||||||
|
$env:E2E_APPLICATION=".\src-tauri\target\debug\Zoo Modeling App.exe"
|
||||||
|
Stop-Process -Name msedgedriver
|
||||||
|
yarn wdio run wdio.conf.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
## KCL
|
||||||
|
|
||||||
|
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/src/wasm-lib/kcl).
|
||||||
|
@ -17,4 +17,13 @@ once fixed in engine will just start working here with no language changes.
|
|||||||
currently move or transform the imported objects at all, once we have assemblies
|
currently move or transform the imported objects at all, once we have assemblies
|
||||||
this will work.
|
this will work.
|
||||||
|
|
||||||
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet cases work currently.
|
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
|
||||||
|
cases work currently.
|
||||||
|
|
||||||
|
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
|
||||||
|
chamfer cases work currently.
|
||||||
|
|
||||||
|
Sketching on the chamfered face does not currently work.
|
||||||
|
|
||||||
|
- **Shell**: Shell is only working for `end` faces, not for `side` or `start`
|
||||||
|
faces. We are tracking the engine side bug on this.
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
657
docs/kcl/arc.md
657
docs/kcl/arc.md
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
34
docs/kcl/assert.md
Normal file
34
docs/kcl/assert.md
Normal file
File diff suppressed because one or more lines are too long
34
docs/kcl/assertGreaterThan.md
Normal file
34
docs/kcl/assertGreaterThan.md
Normal file
File diff suppressed because one or more lines are too long
35
docs/kcl/assertGreaterThanOrEq.md
Normal file
35
docs/kcl/assertGreaterThanOrEq.md
Normal file
File diff suppressed because one or more lines are too long
34
docs/kcl/assertLessThan.md
Normal file
34
docs/kcl/assertLessThan.md
Normal file
File diff suppressed because one or more lines are too long
35
docs/kcl/assertLessThanOrEq.md
Normal file
35
docs/kcl/assertLessThanOrEq.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
934
docs/kcl/chamfer.md
Normal file
934
docs/kcl/chamfer.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
984
docs/kcl/hole.md
984
docs/kcl/hole.md
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -20,9 +20,15 @@ layout: manual
|
|||||||
* [`angledLineToY`](kcl/angledLineToY)
|
* [`angledLineToY`](kcl/angledLineToY)
|
||||||
* [`arc`](kcl/arc)
|
* [`arc`](kcl/arc)
|
||||||
* [`asin`](kcl/asin)
|
* [`asin`](kcl/asin)
|
||||||
|
* [`assert`](kcl/assert)
|
||||||
|
* [`assertGreaterThan`](kcl/assertGreaterThan)
|
||||||
|
* [`assertGreaterThanOrEq`](kcl/assertGreaterThanOrEq)
|
||||||
|
* [`assertLessThan`](kcl/assertLessThan)
|
||||||
|
* [`assertLessThanOrEq`](kcl/assertLessThanOrEq)
|
||||||
* [`atan`](kcl/atan)
|
* [`atan`](kcl/atan)
|
||||||
* [`bezierCurve`](kcl/bezierCurve)
|
* [`bezierCurve`](kcl/bezierCurve)
|
||||||
* [`ceil`](kcl/ceil)
|
* [`ceil`](kcl/ceil)
|
||||||
|
* [`chamfer`](kcl/chamfer)
|
||||||
* [`circle`](kcl/circle)
|
* [`circle`](kcl/circle)
|
||||||
* [`close`](kcl/close)
|
* [`close`](kcl/close)
|
||||||
* [`cos`](kcl/cos)
|
* [`cos`](kcl/cos)
|
||||||
@ -30,14 +36,13 @@ layout: manual
|
|||||||
* [`extrude`](kcl/extrude)
|
* [`extrude`](kcl/extrude)
|
||||||
* [`fillet`](kcl/fillet)
|
* [`fillet`](kcl/fillet)
|
||||||
* [`floor`](kcl/floor)
|
* [`floor`](kcl/floor)
|
||||||
* [`getEdge`](kcl/getEdge)
|
|
||||||
* [`getExtrudeWallTransform`](kcl/getExtrudeWallTransform)
|
|
||||||
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
* [`getNextAdjacentEdge`](kcl/getNextAdjacentEdge)
|
||||||
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
* [`getOppositeEdge`](kcl/getOppositeEdge)
|
||||||
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
* [`getPreviousAdjacentEdge`](kcl/getPreviousAdjacentEdge)
|
||||||
* [`helix`](kcl/helix)
|
* [`helix`](kcl/helix)
|
||||||
* [`hole`](kcl/hole)
|
* [`hole`](kcl/hole)
|
||||||
* [`import`](kcl/import)
|
* [`import`](kcl/import)
|
||||||
|
* [`int`](kcl/int)
|
||||||
* [`lastSegX`](kcl/lastSegX)
|
* [`lastSegX`](kcl/lastSegX)
|
||||||
* [`lastSegY`](kcl/lastSegY)
|
* [`lastSegY`](kcl/lastSegY)
|
||||||
* [`legAngX`](kcl/legAngX)
|
* [`legAngX`](kcl/legAngX)
|
||||||
@ -55,13 +60,19 @@ layout: manual
|
|||||||
* [`patternCircular3d`](kcl/patternCircular3d)
|
* [`patternCircular3d`](kcl/patternCircular3d)
|
||||||
* [`patternLinear2d`](kcl/patternLinear2d)
|
* [`patternLinear2d`](kcl/patternLinear2d)
|
||||||
* [`patternLinear3d`](kcl/patternLinear3d)
|
* [`patternLinear3d`](kcl/patternLinear3d)
|
||||||
|
* [`patternTransform`](kcl/patternTransform)
|
||||||
* [`pi`](kcl/pi)
|
* [`pi`](kcl/pi)
|
||||||
|
* [`polar`](kcl/polar)
|
||||||
* [`pow`](kcl/pow)
|
* [`pow`](kcl/pow)
|
||||||
|
* [`profileStart`](kcl/profileStart)
|
||||||
|
* [`profileStartX`](kcl/profileStartX)
|
||||||
|
* [`profileStartY`](kcl/profileStartY)
|
||||||
* [`revolve`](kcl/revolve)
|
* [`revolve`](kcl/revolve)
|
||||||
* [`segAng`](kcl/segAng)
|
* [`segAng`](kcl/segAng)
|
||||||
* [`segEndX`](kcl/segEndX)
|
* [`segEndX`](kcl/segEndX)
|
||||||
* [`segEndY`](kcl/segEndY)
|
* [`segEndY`](kcl/segEndY)
|
||||||
* [`segLen`](kcl/segLen)
|
* [`segLen`](kcl/segLen)
|
||||||
|
* [`shell`](kcl/shell)
|
||||||
* [`sin`](kcl/sin)
|
* [`sin`](kcl/sin)
|
||||||
* [`sqrt`](kcl/sqrt)
|
* [`sqrt`](kcl/sqrt)
|
||||||
* [`startProfileAt`](kcl/startProfileAt)
|
* [`startProfileAt`](kcl/startProfileAt)
|
||||||
|
43
docs/kcl/int.md
Normal file
43
docs/kcl/int.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
File diff suppressed because one or more lines are too long
671
docs/kcl/line.md
671
docs/kcl/line.md
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
448
docs/kcl/patternTransform.md
Normal file
448
docs/kcl/patternTransform.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
48
docs/kcl/polar.md
Normal file
48
docs/kcl/polar.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
440
docs/kcl/profileStart.md
Normal file
440
docs/kcl/profileStart.md
Normal file
File diff suppressed because one or more lines are too long
435
docs/kcl/profileStartX.md
Normal file
435
docs/kcl/profileStartX.md
Normal file
File diff suppressed because one or more lines are too long
434
docs/kcl/profileStartY.md
Normal file
434
docs/kcl/profileStartY.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
913
docs/kcl/shell.md
Normal file
913
docs/kcl/shell.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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
225929
docs/kcl/std.json
225929
docs/kcl/std.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -74,6 +74,107 @@ You can nest expressions in parenthesis as well:
|
|||||||
let myMathExpression = 3 + (1 * 2 / (3 - 7))
|
let myMathExpression = 3 + (1 * 2 / (3 - 7))
|
||||||
```
|
```
|
||||||
|
|
||||||
Please if you find any issues using any of the above expressions or syntax
|
## Tags
|
||||||
|
|
||||||
|
Tags are used to give a name (tag) to a specific path.
|
||||||
|
|
||||||
|
### Tag Declaration
|
||||||
|
|
||||||
|
The syntax for declaring a tag is `$myTag` you would use it in the following
|
||||||
|
way:
|
||||||
|
|
||||||
|
```
|
||||||
|
startSketchOn('XZ')
|
||||||
|
|> startProfileAt(origin, %)
|
||||||
|
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||||
|
|> angledLine([
|
||||||
|
segAng(rectangleSegmentA001, %) - 90,
|
||||||
|
196.99
|
||||||
|
], %, $rectangleSegmentB001)
|
||||||
|
|> angledLine([
|
||||||
|
segAng(rectangleSegmentA001, %),
|
||||||
|
-segLen(rectangleSegmentA001, %)
|
||||||
|
], %, $rectangleSegmentC001)
|
||||||
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|
|> close(%)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Tag Identifier
|
||||||
|
|
||||||
|
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, %)`.
|
||||||
|
|
||||||
|
|
||||||
|
### 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:
|
||||||
|
|
||||||
|
```
|
||||||
|
fn rect = (origin) => {
|
||||||
|
return startSketchOn('XZ')
|
||||||
|
|> startProfileAt(origin, %)
|
||||||
|
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||||
|
|> angledLine([
|
||||||
|
segAng(rectangleSegmentA001, %) - 90,
|
||||||
|
196.99
|
||||||
|
], %, $rectangleSegmentB001)
|
||||||
|
|> angledLine([
|
||||||
|
segAng(rectangleSegmentA001, %),
|
||||||
|
-segLen(rectangleSegmentA001, %)
|
||||||
|
], %, $rectangleSegmentC001)
|
||||||
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|
|> close(%)
|
||||||
|
}
|
||||||
|
|
||||||
|
rect([0, 0])
|
||||||
|
rect([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.
|
||||||
|
|
||||||
|
```
|
||||||
|
fn rect = (origin) => {
|
||||||
|
return startSketchOn('XZ')
|
||||||
|
|> startProfileAt(origin, %)
|
||||||
|
|> angledLine([0, 191.26], %, $rectangleSegmentA001)
|
||||||
|
|> angledLine([
|
||||||
|
segAng(rectangleSegmentA001, %) - 90,
|
||||||
|
196.99
|
||||||
|
], %, $rectangleSegmentB001)
|
||||||
|
|> angledLine([
|
||||||
|
segAng(rectangleSegmentA001, %),
|
||||||
|
-segLen(rectangleSegmentA001, %)
|
||||||
|
], %, $rectangleSegmentC001)
|
||||||
|
|> lineTo([profileStartX(%), profileStartY(%)], %)
|
||||||
|
|> close(%)
|
||||||
|
}
|
||||||
|
|
||||||
|
rect([0, 0])
|
||||||
|
const myRect = rect([20, 0])
|
||||||
|
|
||||||
|
myRect
|
||||||
|
|> extrude(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
|
please file an issue with the `ast` label on the [modeling-app
|
||||||
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
repo](https://github.com/KittyCAD/modeling-app/issues/new).
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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