Compare commits

...

177 Commits

Author SHA1 Message Date
19a8a2bba8 add script to build on mac mini 2025-03-14 15:36:01 -04:00
e9806b83d7 Clip deltaY to +/- 100 (#5793)
* Clip deltaY to +/- 100
Should fix #5120

* Lint

* Fix the clip with @nickmccleery's suggestion
2025-03-14 13:17:10 -04:00
0229105158 fix: add better errors for missing commas in arrays and objects (#5210)
* fix: add better errors for missing commas in arrays and objects

* chore: add object prop shorthand missing comma test

* fix: wording on unexpected character in arrays and objects

* fix: don't eagerly evaluate whether there is a closing brace/bracket

* feat: exit early when detecting missing commas if encountering invalid tokens

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix: updated reserved word in test to replace removed one

---------

Co-authored-by: Tom Pridham <pridham.tom@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-14 16:52:10 +00:00
9e37e13b6b Further unfrig playwright (#5794)
* Bail on cleanup after 10s; move setup even higher

* Give macos time before starting an electron instance

* Try it again

* Again

* Remove stale TODO

* Use Kolmogorov complexity instead of text for ai assertions

* Help out prompt-to-edit test with being more explicit

* Try to give Mac more time to open a window

* Fix the other var change for prompt-to-edit test

* Forgot this

* Try some crazier shit

* 🤦 I forgot the return.

* Ok things were actually just not working well at all

* Fix export test to expect smaller size

* yarn tsc && yarn lint && yarn fmt
2025-03-14 10:19:58 +00:00
58e0c0e916 Improve KCL Samples (#5767)
* improve KCL Samples & .gitignore

* update block and car wheel assembly

* update flange and lego, delete flange xy

* artifacts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* scale

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 23:38:51 -07:00
dd99c27d56 bump all the rust things (#5806)
* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* getrandom

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* simlimk

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Revert "simlimk"

This reverts commit 3f5221db7e.

* terst

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 23:38:41 -07:00
3cff26b987 make sure all enter sketch mode are with the stuff they need in the same batch order always (#5646)
* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* comment out

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update artifacts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* small

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* last of the artifacts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update playwirght

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add crazy multi-profile test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* steps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix artifact graph

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cleanup

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates
;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more artifact grph

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* turn back on playwright

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* playwright fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* playwright fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 21:59:39 -07:00
78ac5b0a11 make deterministic date cleaner (#5777)
* make deterministic date cleaner

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update all the steps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more steps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* steps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 18:01:47 -07:00
24d0b14668 change runner (#5800)
Revert "try codspeed runner (#5796)"

This reverts commit ec64daa01f.
2025-03-13 13:57:24 -07:00
6fb32eeff2 fix python bindings building on linux (#5795)
* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 12:05:45 -07:00
ec64daa01f try codspeed runner (#5796)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 12:05:15 -07:00
e8886bb358 hide program memory source ranges from the app (#5759)
* hide program memory source ranges from the app

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fix unit tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fix memory

Signed-off-by: Jess Frazelle <github@jessfraz.com>

remove from paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix program memory source ranges

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
2025-03-13 11:13:33 -07:00
05a6313d97 try execute bench with walltime (#5772)
* try execute bench

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* timeout longer

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* timeout longer

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 10:33:00 -07:00
80f78e1c61 Revolve/Sweep multiple sketches at once (#5779)
* revolve multiple sketches at once

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* do the same for swweep

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* do the same for swweep

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-13 09:38:22 -07:00
c441a3ab1c Fix playwright mental model, don't make me psycho, thanks (#5680)
* Fix flakey tests with new toolbar.exitSketch

* tsc && lint && fmt

* Disable pw electron thing again

* Unfrig Playwright-Electron a ton; fix another ton of flakes.

* More deflaky

* Fix a ton of tests and playwright related hell

* Run jess's magic incantation to build rust kcl things

* yarn tsc

* yarn lint

* yarn fmt

* Remove double logs

* Revert to old settings spreads momentarily

* Expect error *in the fixtureSetup*, does not circumvent typechecking for regular usage

* Fix unit tests
2025-03-13 10:54:00 -04:00
e894242768 Add warning when using a module with no return value (#5771)
* Add warning when using a module with no return value

* Update output files since changing source range of the pipeline argument

* Change wording of error message to not use the term unlabeled
2025-03-12 18:05:18 +00:00
d8dff03746 Add cache for wasm in build-apps (#5758)
* WIP: break out e2e snapshots

* Separate prepare-wasm job

* Force e2e to run on pierremtb/adhoc/break-out-snapshots

* Quick fix

* Quick fix2

* Quick fix3

* Quick fix4

* Quick fix5

* Remove ifs for flow tests

* Clean up for review

* Cache wasm on PR for build-apps

* Add checks on build wasm tings

* Clean up for review
2025-03-12 13:53:30 -04:00
60aee7ddba Bump the security group with 2 updates (#5773)
Bumps the security group with 2 updates: [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) and [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime).


Updates `@babel/helpers` from 7.25.0 to 7.26.10
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-helpers)

Updates `@babel/runtime` from 7.25.0 to 7.26.10
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/helpers"
  dependency-type: indirect
  dependency-group: security
- dependency-name: "@babel/runtime"
  dependency-type: indirect
  dependency-group: security
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 10:03:14 -07:00
6c09da24a4 change server path for vscode extension (#5769)
change server path

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-12 16:46:18 +00:00
b61cd3123f KCL: Fix two cryptic error messages (#5745)
Firstly, before the code "{x = 1, y = }" would give the dreaded "unexpected token" error.

Now it says "This property has a label, but no value. Put some value after the equals sign".
And points to the = symbol with no matching right-hand side value. Yay!

Second fix: before, in the code `f(1, x=)`, the error complained that an unlabeled arg was not permitted there.

Now it says "This argument has a label, but no value. Put some value after the equals sign".
2025-03-12 16:27:10 +00:00
865bf8ae7a KCL: Fix cryptic error when using duplicate edges in fillet call (#5755)
Fixes https://github.com/KittyCAD/modeling-app/issues/4307

Now if you try to fillet the same edge twice in a single fillet command,
the error message is clearer, and the source range will highlight
the specific edges in the array which are duplicated.

Same goes for chamfer.

Note: although the Rust KCL interpreter sends back an array of SourceRange
for each KCL error, the frontend only puts the first one into CodeMirror
diagnostics. We should fix that: https://github.com/KittyCAD/modeling-app/issues/5754
2025-03-12 16:24:27 +00:00
f8e53c6577 Fix web onboarding dismissal infinite loop bug (#5742) 2025-03-12 13:34:11 +00:00
f31c2c6f81 Import geometry work w transforms (#5757)
* make work with imported geometry

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* iupdates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* update known issues

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-12 01:23:21 +00:00
e5c05e1980 change test names kcl-samples (#5766)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-11 23:29:26 +00:00
6d0da100e5 benchmark retry (#5760)
* benchmark retry

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix times

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix times

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* dont use a custom iter

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* just parse

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* use runs on

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-11 22:21:28 +00:00
b8a0ad7144 Dedicated job for snapshot tests (#5752)
* WIP: break out e2e snapshots

* Separate prepare-wasm job

* Force e2e to run on pierremtb/adhoc/break-out-snapshots

* Quick fix

* Quick fix2

* Quick fix3

* Quick fix4

* Quick fix5

* Remove ifs for flow tests

* Clean up for review

* should-run == 'true' madness
2025-03-11 17:18:42 -04:00
724e65ac97 Hide selection-type args from command palette while in an edit flow (#5763)
* Allow `hidden` config to be a callback

* Hide selection type args if `nodeToEdit` is present

in workflows that have an edit flow set up

* Remove Selection from headerArguments in edit flow tests
2025-03-11 16:29:03 -04:00
b5028f7aa8 Change to not expose exec artifacts (#5700)
Now that the artifact graph is built completely in Rust, these are an
implementation detail that shouldn't be exposed to TS.
2025-03-11 19:09:11 +00:00
df6b4f4c37 Move consts to dir in docs (#5753)
* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add consts to dir

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add consts to dir

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-11 18:44:27 +00:00
41eb64925b Improve sketch constraint test (#5756) 2025-03-11 14:14:03 -04:00
fc076173ff Make any error show on ErrorPage, not just route error responses (#5623)
* Make any error show on ErrorPage, not just route error responses

Closes #5620 by making any error show on the page so the user can copy
it for use in an issue. Previously, the logic was too narrow and only
showed the error on the page if `isRouterErrorResponse` was true.

* @nadr0's feedback

thanks for giving my crap work a review

* Update src/components/ErrorPage.tsx

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

* @nadr0 feedback, handle overflowing error case

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
2025-03-11 17:46:07 +00:00
98822869f7 fix settings docs names (#5751)
* fix settings docs names

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* add consts to dir

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-11 10:20:18 -07:00
df0510c199 cleandocs (#5750)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-11 08:51:23 -07:00
fda65bcbd7 codspeed (#5741)
* codspeed

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Update cargo-bench.yml

* Update cargo-bench.yml

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Update settings.md (#5743)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-11 08:03:49 -07:00
c37e564b59 fix wheels (#5748)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-11 08:01:49 -07:00
d6ad4b6e66 KCL: Fix cryptic error in type mismatch (#5735)
Previous error message:
"Expected a kcl_lib::execution::geometry::SolidSet but found Sketch"

New error message:
"Expected a SolidSet but found Sketch. You can convert a sketch (2D) into a Solid (3D) by calling a function like `extrude` or `revolve`"

Two improvements:
 - Don't print the fully-qualified Rust name (e.g. kcl_lib::executor::Solid) instead use the last part of that (e.g. just Solid)
 - Allow specific suggestions for combinations of got/want (e.g. "You can convert a sketch (2D) into a Solid (3D) by calling a function like `extrude` or `revolve`")

Closes #5616
2025-03-10 22:53:16 -05:00
546b4ea3b8 generate the settings docs (#5740)
* generate the settings docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Update docs/kcl/settings.md

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-10 18:59:10 -07:00
310932dc5a run rust benchmarks and compare on prs (#5734)
* run benchmarks and compare on prs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* run benchmarks and compare on prs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* benchmark kcl-samples

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-10 18:04:16 -07:00
51459bb413 turn on insta snapshot for step file output (#5732)
* turn on insta snapshot for step file output

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* use a macro for the kcl-samples

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Update rust/kcl-directory-test-macro/src/lib.rs

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* control the order

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* engine

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update steps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-10 15:35:45 -07:00
e00dae11ba Fix cryptic parser error (#5731)
# Problem

Before: "unexpected token |>", highlights the |>

After: "This argument needs a label, but it doesn't have one", highlights the argument with no label

Closes #5724 

# Discussion

I am trying a new approach to the parser: instead of parsing the specific correct thing we need, parse a more general form, then later, narrow it down to specifics and return a nice error if it's wrong. For example, instead of parsing labeled arguments, parse labeled OR unlabeled arguments. Then later check that the only unlabeled arg is the first one, and return a nice error if there's any other. This worked nicely for this PR, hopefully the approach will work for other "cryptic error" issues.
2025-03-10 17:09:54 -05:00
831c7f764a cargo publish was too big (#5699)
* cargo publish too big

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cargo publish too big

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bunmp again

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-10 14:29:04 -07:00
ec4ad268f7 Fix toolchain file copy to work on all platforms (#5733) 2025-03-10 16:44:44 -04:00
be640ea0bd ci: Fix e2e workflow to install rust toolchain when needed (#5728)
* ci: Fix e2e workflow to install rust toolchain when needed

* Unify conditions

* Pull out condition to variable

* Add echo so that debuggin is easier
2025-03-10 14:53:43 -04:00
f8ceab2233 Fix a recast bug and don't delete the user's code if parsing fails (#5663)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-08 09:33:45 -05:00
aea82e004a KCL: Convert x/y lines to use keyword arguments (#5615)
Previously, `xLine`, `xLineTo`, `yLine` and `yLineTo` used positional arguments. Now:

- `xLineTo` and `yLineTo` have been removed
- `xLine` and `yLine` both use keyword arguments:
  - `length`, optional (i.e. a relative distance along the X or Y axis)
  - `endAbsolute` optional (i.e. an absolute point along the X or Y axis)
  - `tag` optional
- Exactly one of `length` or `endAbsolute` must be given. Not both, not neither.

For example:

```
// Old way
|> xLine(6.04, %)
|> yLineTo(20, %, $base)

// New way
|> xLine(length = 6.04)
|> yLine(endAbsolute = 20, tag = $base)
```

This also improves some of the general-purpose keyword arguments code in modeling app's TS codebase.
2025-03-07 22:07:16 -06:00
bc3a0e3896 more updates for kcl-samples (#5696)
* screenshots and step

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* automations

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add manifest generation

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* small refactor

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update readme

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* write the readme

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes for comments

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* derive-docs tests updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update all the generated artifact commands, since we dont need to clear scene at the start of run so we dont need to recreate all the planes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-07 18:45:33 -08:00
be69039d40 bump kcl crate versions (#5697)
* bump kcl crate versions

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* update lock

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-07 18:44:43 -08:00
2c6d69497c Update KCL samples readme (#5677)
update KCL samples readme
2025-03-08 00:15:36 +00:00
18db3783af Fix project settings loading in browser (#5694)
Fixes #5625. #5142 regressed the project settings loading because it
failed to fire off a new `load.project` XState event in the case where
we were loading in the browser. It also may have had a bug with project
settings loading on refresh from the file page, as we were not properly
ensuring that the `settingsActor` was in the `idle` state before sending
our `load.project` event regardless.
2025-03-08 00:14:02 +00:00
b536040feb ci: Fix e2e jobs to pass the status check even when they're not run (#5693)
* ci: Fix e2e jobs to pass the status check even when they're not run
2025-03-08 00:00:57 +00:00
dd45cd4ef9 Don't try to clone a THREE.js group in coredump (#5690)
Fixes #5117 by just grabbing the `userData` off the group, and not
trying to clone the whole class instance which errors.
2025-03-07 19:09:56 +00:00
25cc5581be Factor out a struct for the result of parse_execute (#5629)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-08 08:00:55 +13:00
f7c192b64b Fix type parsing in CodeMirror and highlight them (#5674)
* Add new types and fix capitalization in CodeMirror grammar

* Add syntax highlighting for types
2025-03-07 18:56:29 +00:00
faae169154 Update dependabot config (#5639) 2025-03-07 17:36:54 +00:00
c74b9ba940 Block indexing if host is not app.zoo.dev (#5675)
* block indexing if host is not app.zoo.dev

* fix fmt
2025-03-07 17:23:40 +01:00
6cce3cda36 Misc tidying up around KclValue, etc. (#5653)
* Make some things a little less public

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Rename KclValue::Array to MixedArray

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add settings to KclValue::Function

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Remove a bunch of dead code, simplifying mock exec and meaning KclValue no longer needs to deserialize

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-07 15:04:57 +00:00
5d25f4a0e5 Support types in the standard library (#5651)
* Parse an unparse type decls (and refactor impl attributes slightly)

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Remove special treatment of geometric types from parser and executor

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Generate docs for std types

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Hover tool-tips for types and fixup the frontend

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Fixes

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-07 09:53:34 -05:00
79d37d360a Remove xstate typegen scripts (#5662) 2025-03-07 09:38:44 -05:00
69553fded7 test: Vendor kcl-samples and add simulation tests for them (#5460)
* Change to unzip

* Download kcl-samples as zip to public dir

* Fix fetch:samples, e2e electron still not working

* Change error message to be clearer

* Refactor so that input and output directories of sim tests can be different

* Add kcl samples test implementation

* Update output since adding kcl_samples tests

* Update kcl-samples branch

* Fix git-ignore pattern to only apply to the root

* Fix yarn install and yarn fetch:samples to work the first time

* Remove unneeded exists check

* Change to use kcl-samples in public directory

* Add kcl-samples

* Update output since updating kcl-samples

* Update output files

* Change to not fetch samples during yarn install

* Update output after merge

* Ignore kcl-samples in codespell

* WIP: Don't run e2e if only kcl-samples changed

* Conditionally run cargo tests

* Fix to round floating point values in program memory arrays

* Update output since merge and rounding numbers in memory

* Fix memory redaction for floating point to find more values

* Fix float redaction pattern

* Update output since rounding floating point numbers

* Add center to floating point pattern

* Fix trigger to use picomatch syntax

* Update output since rounding center

* Remove kcl-samples github workflows

* Enable Rust backtrace

* Update output after re-running

* Update output after changing order of post-extrude commands

* Fix to have deterministic order of commands

* Update output after reverting ordering changes

* Update kcl-samples

* Update output after updating samples

* Fix error messages to show the names of all samples that failed

* Change cargo test command to match current one

* Update kcl-samples

* Update output since updating kcl-samples

* Add generate manifest workflow and yarn script

* Fix error check to actually work

* Change util function to be what we actually need

* Move new files after merge

* Fix paths since directory move

* Add dependabot updates for kcl-samples

* Add GitHub workflow to make PR to kcl-samples repo

* Add GitHub workflow to check kcl-samples header comments

* Fix worfklow to change to the right directory

* Add auto-commit simulation test output changes

* Add permissions to workflows

* Fix to run git commit step

* Install just if needed

* Fix directory of justfile

* Add installation of cargo-insta

* Fix to use underscore

* Fix to allow just command failure

* Change to always install CLI tools and cache them

* Trying to fix overwrite failing

* Combine commands

* Change reviewer

* Change to PR targeting the next branch

* Change git commands to not do unnecessary fetch

* Comment out trigger for creating a PR

* Update kcl-samples from next branch

* Update outputs after kcl-samples change

* Fix to use bash pipefail

* Add rust backtrace

* Print full env from sim tests

* Change command to use long option name

* Fix to use ci profile even when calling through just

* Add INSTA_UPDATE=always

* Fix git push by using an app token on checkout

* Add comments

* Fix to use bash options

* Change to echo when no changes are found

* Fix so that kcl-samples updates don't trigger full run

* Fix paths to reflect new crate location

* Fix path detection

* Fix e2e job to ignore kcl_samples simulation test output

* Fix the fetch logic for the KCL samples after vendoring (#5661)

Fixes the last 2 E2E tests for #5460.

---------

Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-03-06 18:01:24 -05:00
200a9af61f add react perf plugin (#5645)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-06 18:57:46 +00:00
2696ddb996 Lf94/hidpi hovering fix (#5541)
* Fix hover highlights on HiDPI screens

* Fix flakey tests with new toolbar.exitSketch

* tsc && lint && fmt

* Disable pw electron thing again

* Fix test

---------

Co-authored-by: 49lf <ircsurfer33@gmail.com>
2025-03-06 11:19:13 -05:00
4e1b0daacb close websocket after test (#5652)
close the websocket properly
2025-03-06 03:09:00 +00:00
8aa46099a8 Types on test settings (#5643)
* type check the test settings

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix another

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-05 21:03:49 -05:00
00ff6371ed Bugfix: show proper error toast when user tries to rename project to conflicting name (#5613)
* Correct error toast behavior so rename error comes through

* Add rename error state to E2E test
2025-03-06 10:00:36 +11:00
b947dad6e9 Change step back shortcut in command palette to Shift+Backspace (#5604)
* Change cmdbar step back shortcut to Shift+Backspace

* Add visual button for step back

* Make the shortcut apply no matter what's in the input
2025-03-06 09:57:47 +11:00
c13bdbb749 Allow users to delete sketches on offset planes via feature tree (#5641)
* Add sketch-on-offset plane deletion cleanup logic

* Add an E2E test for this behavior
2025-03-06 09:56:28 +11:00
e500fad0e1 Don't crash when trying to apply lastSelectionEvent selection that is out-of-range (#5644)
* Dumbest possible fix: don't let the `throw` propogate

* Add E2E test

* Fix lint
2025-03-06 09:52:48 +11:00
bcac4d3798 Snapshots, yee shall kneel. (#5627)
* Give snapshotter a better chance of getting a good snapshot

* fmt tsc lint

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Fix tests

* Again

* Make cmdBarFixture Locators getters

* Fix export error test

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-05 14:09:21 -05:00
63897bd60e Bump taiki-e/install-action from 2.49.11 to 2.49.15 (#5632)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.49.11 to 2.49.15.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.49.11...v2.49.15)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 10:03:01 -08:00
d429e868ac Bump @types/node from 22.13.1 to 22.13.9 in /packages/codemirror-lsp-client (#5638) 2025-03-05 10:15:18 -05:00
faa51ddc18 Bump eslint-plugin-react from 7.37.3 to 7.37.4 (#5637) 2025-03-05 10:14:54 -05:00
c28eb360c0 Bump google-github-actions/auth from 2.1.7 to 2.1.8 (#5630) 2025-03-05 09:47:00 -05:00
69cac17543 Bump @types/node from 22.13.1 to 22.13.9 (#5635) 2025-03-05 09:20:16 -05:00
50c7356b6a Bump google-github-actions/upload-cloud-storage from 2.2.1 to 2.2.2 (#5633) 2025-03-05 09:19:00 -05:00
37715d9fa8 Move lsp server to this repo (#5619) 2025-03-04 22:21:12 -08:00
e8af61e11f Code completions for @settings (#5622)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-05 16:23:46 +13:00
de85c31e71 Make memory accessible from multiple threads/tasks (#5530)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-05 12:03:32 +13:00
725c56ea6f Fix to not specify the rust toolchain version everywhere (#5614)
* Fix to not specify the rust toolchain version everywhere

* Fix to source

* Fix warning about non-portable option to cp

* Fix to use built-in Swatinem/rust-cache

* Fix Swatinem/rust-cache to use the right directory
2025-03-04 20:39:22 +00:00
1b958ee29f Only save the themeColor setting on end of input (#5618)
* Only save the themeColor setting on end of input

Closes #4463 by making this input sliders less eager to write to disk,
which was gumming up the works.

* fmt
2025-03-04 14:11:38 -05:00
4b0f67e604 Explicitly set shell to bash for retry action in CI (#5610)
* Explicitly set shell to bash for retry action in CI

* Do not run tests on dep install failure

* Use single quotes for string

* Had the wrong name
2025-03-04 13:18:36 -05:00
8ba1a5cd4d Add button in settings menu to manually check for updates (#5607)
* Expose an electron handler for checking for updates

* Add "Check for updates" button to settings
2025-03-04 12:41:35 -05:00
df278c7e6a Various hover improvements (#5617)
* Show more info on hover for variables

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Move hover impls to lsp module

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Make hover work on names inside calls, fix doc line breaking, trim docs in tool tips

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Test the new hovers; fix signature syntax

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Hover tips for kwargs

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-04 09:53:31 +00:00
6e57a80c13 Bump script for kcl crates (#5612)
* start of kcl-bumper

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* works!

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add readme

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-03 16:03:18 -06:00
efe6565857 Bump taiki-e/install-action from 2.48.20 to 2.49.11 (#5608)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.48.20 to 2.49.11.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.48.20...v2.49.11)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 20:48:50 +00:00
fa0a34585b Bump once_cell from 1.20.2 to 1.20.3 in /rust (#5592)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.20.2 to 1.20.3.
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.20.2...v1.20.3)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 11:58:20 -08:00
dec74f633b Bump @codemirror/search from 6.5.6 to 6.5.10 (#5596)
Bumps [@codemirror/search](https://github.com/codemirror/search) from 6.5.6 to 6.5.10.
- [Changelog](https://github.com/codemirror/search/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/search/compare/6.5.6...6.5.10)

---
updated-dependencies:
- dependency-name: "@codemirror/search"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 19:16:58 +00:00
dfcea282ec add export test so we dont break cli / kcl.py (#5553)
* add export test so we dont break cli / kcl.py

Signed-off-by: Jess Frazelle <github@jessfraz.com>

Overwrite created date (#5602)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-03 18:26:01 +00:00
191dcf8bb0 Bump nick-fields/retry from 3.0.1 to 3.0.2 (#5589)
* Bump nick-fields/retry from 3.0.1 to 3.0.2

Bumps [nick-fields/retry](https://github.com/nick-fields/retry) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/nick-fields/retry/releases)
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js)
- [Commits](https://github.com/nick-fields/retry/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: nick-fields/retry
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-03 10:08:37 -08:00
cb1bbe4660 Bump tabled from 0.15.0 to 0.18.0 in /rust (#5593)
Bumps [tabled](https://github.com/zhiburt/tabled) from 0.15.0 to 0.18.0.
- [Changelog](https://github.com/zhiburt/tabled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zhiburt/tabled/commits)

---
updated-dependencies:
- dependency-name: tabled
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 10:05:50 -08:00
ff66cb1deb Bump parse-display from 0.9.1 to 0.10.0 in /rust (#5595)
Bumps [parse-display](https://github.com/frozenlib/parse-display) from 0.9.1 to 0.10.0.
- [Changelog](https://github.com/frozenlib/parse-display/blob/master/CHANGELOG.md)
- [Commits](https://github.com/frozenlib/parse-display/compare/v0.9.1...v0.10.0)

---
updated-dependencies:
- dependency-name: parse-display
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 10:05:21 -08:00
ab46349d63 Bump @codemirror/autocomplete from 6.17.0 to 6.18.6 in /packages/codemirror-lsp-client (#5601)
* Bump @codemirror/autocomplete in /packages/codemirror-lsp-client

Bumps [@codemirror/autocomplete](https://github.com/codemirror/autocomplete) from 6.17.0 to 6.18.6.
- [Changelog](https://github.com/codemirror/autocomplete/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/autocomplete/compare/6.17.0...6.18.6)

---
updated-dependencies:
- dependency-name: "@codemirror/autocomplete"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-03 10:04:44 -08:00
cffad78bf7 Bump convert_case from 0.6.0 to 0.8.0 in /rust (#5591)
* Bump convert_case from 0.6.0 to 0.8.0 in /rust

Bumps [convert_case](https://github.com/rutrum/convert-case) from 0.6.0 to 0.8.0.
- [Commits](https://github.com/rutrum/convert-case/commits)

---
updated-dependencies:
- dependency-name: convert_case
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-03 10:03:47 -08:00
bfb81877d3 Bump husky from 9.1.5 to 9.1.7 (#5597)
Bumps [husky](https://github.com/typicode/husky) from 9.1.5 to 9.1.7.
- [Release notes](https://github.com/typicode/husky/releases)
- [Commits](https://github.com/typicode/husky/compare/v9.1.5...v9.1.7)

---
updated-dependencies:
- dependency-name: husky
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 10:03:15 -08:00
c56398db83 Bump @types/diff from 6.0.0 to 7.0.1 (#5599)
Bumps [@types/diff](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/diff) from 6.0.0 to 7.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/diff)

---
updated-dependencies:
- dependency-name: "@types/diff"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 10:02:57 -08:00
36e0d35968 Bump @codemirror/commands from 6.6.0 to 6.8.0 (#5600)
Bumps [@codemirror/commands](https://github.com/codemirror/commands) from 6.6.0 to 6.8.0.
- [Changelog](https://github.com/codemirror/commands/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/commands/compare/6.6.0...6.8.0)

---
updated-dependencies:
- dependency-name: "@codemirror/commands"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 10:02:09 -08:00
62bf7d8715 Pin Rust to 1.85 to fix CI (#5606)
* Make Rust 1.85 the default

* Less specific Rust ver

* Pin Rust 1.85 to -clippy and -fmt

* Pin Rust version

* Use Rust 1.85 in package.json
2025-03-03 09:57:31 -08:00
a4db302174 move kcl.py to this repo (#5587)
* ci for kcl-python-bindings

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* bettter concurrency

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cleanup files

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updaets

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updaets

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updaets

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updaets

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* format

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* format

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 19:38:25 -05:00
66f3500ca9 Remove start sketch at (#5586)
* remove start sketch at

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 19:32:46 -05:00
c3bdc6f106 Move the wasm lib, and cleanup rust directory and all references (#5585)
* git mv src/wasm-lib rust

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv wasm-lib to workspace

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv kcl-lib

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv derive docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* resolve file paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* move more shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* make yarn build:wasm work

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix scripts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better references

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix cargo ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix reference

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cargo sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix script

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix a dep

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove unused deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Revert "remove unused deps"

This reverts commit fbabdb062e275fd5cbc1476f8480a1afee15d972.

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* deps;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 21:59:01 +00:00
0a2bf4b55f Fix to round floating point numbers in test output (#5584)
* Fix to round floating point numbers in test output

* Update output after rounding
2025-02-28 23:32:00 -08:00
bbae9b6363 Fix to have deterministic order of commands (#5583) 2025-02-28 23:31:38 -08:00
180d52280d minor fixes to some scripts / From<impl for Project Config> (#5582)
minor fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 03:02:06 +00:00
dce1dca7c7 bump to 45 for kcl-samples next (#5581)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 02:30:21 +00:00
343f6572a2 circle moved to kw args (#5560)
* rust side of circle args

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* change circle in all test js files

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more js side

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* ud[ates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* ud[ates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-28 20:40:01 -05:00
c8e58d49e0 Remove unused Zoo CLI step in e2e-tests.yml (#5574)
pierremtb/adhoc/remove-unused-cli-step-e2e
2025-02-28 17:19:46 -08:00
c18546fb2f more pedantic rust types for project specific settings versus user settings (#5575)
* move debug_panel to app settings

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* move showDebugPanel to app settings with backwards compatibility;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more pedantic project specific settings

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-01 00:15:57 +00:00
466c23a9d8 Add support for hidden command arguments (#5534)
* Add configuration/type support for `hidden`

* Add UI support for `hidden` configuration

* Make `nodeToEdit` args hidden

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Fix cmdBarFixture to actually serialize to "pickCommand" case

* Add test step to ensure hidden commands can't be backed into

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-28 23:00:29 +00:00
8403025c77 fix bug where even clear scene fails miette cant get output (#5578)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-28 23:00:10 +00:00
9ce591a1a1 Disable view control menu items and gizmo clicks conditionally (#5537)
* Disable view control menu items and gizmo clicks conditionally

* Actually just turn off all mouse events, moves too

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix gizmo flickering

* fmt

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Add test step for disabling gizmo in sketch mode

* Use grayscale to indicate disabled state?

@max-mrgrsk feel free to discard if you prefer the opacity, I don't have
a strong opinion at the moment.

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: max-mrgrsk <156543465+max-mrgrsk@users.noreply.github.com>
2025-02-28 22:27:35 +00:00
f238f3882b Feature: Named views (#5532)
* feature: building skeleton for adding a viewpoint in frontend as well as rust with the settings toml

* chore: named views loaded into memory

* fix: testing code

* chore: saving off progress, skeleton for listing and deleting named views

* fix: fixed state stale dereferencing issue

* feat: initial skeleton for loading view points

* fix: pushing bug

* fix: saving off progress

* fix: trying to update to main?

* fix: main fixes, API fixes

* fix: what is happening

* fix: ope

* fix: implemented default values on serde

* fix: pushing working dev code... need to clean it up

* feature: adding no results found on filteroptions within an options input, not just command input bar level

* fix: initial PR cleanup pass of junky code

* fix: addressing comments in initial pass

* fix: addressing PR comments

* fix: moved modeling.namedViews to app.namedViews as per request

* fix: _id and _version are now id and version.

* fix: python codespell, perspective

* fix: cargo fmt

* fix: updating description of the named view commands

* fix: removing testing code

* fix: feature flag this to DEV only

* fix: ts ignore for production engine api

* fix: deep parital fights arrays and objects within settings, doing a namedview type predicate checking

* fix: auto fixes

* Remove unnecessary alias

* Reword toast messages (more consistency)

* fmt

* cargo clippy

* Fix Set appearance flakes

* cargo test

* fix: removing pub since the toml_stringify was refactored

* fix: adding ignore this on user level

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* chore: Vec<NamedView> to HashMap<uuid::Uuid,NamedView>

* fix: removing debugging code

* chore: HashMap to IndexMap

* fix: remove testing code

---------

Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-28 16:37:25 -05:00
a91208eb1c Add expandable disclosure to AI operation success toasts (#5555)
* Add expandable disclosure to Text-to-CAD success toast

Closes #5258 by adding a details element that the user can open if they
don't like the result of their "successful" prompt.

* Add the same disclosure to the Prompt-to-Edit toast

* Rework text per @greg-kcio's feedback

* Fix tsc

* WIP fix up ttc e2e tests
2025-02-28 16:26:11 -05:00
b92b0a9afe Upload public mirror of origin modeling-app slides to README (#5549)
Closes #4264.
2025-02-28 16:14:58 -05:00
964347f43a Fix sketch-on-face sketches to be in the artifact graph (#5489)
* Add code ref to sketch-on-face artifacts

* Fix to add execution artifacts to the artifact graph

* Update output after including exec artifacts

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-28 21:06:26 +00:00
3811c88b5c properly flush batch (#5565)
* properly flush batch

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* only flush if not on error

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better method

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* ensure nothing in batch assembly test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-28 19:52:14 +00:00
69a1473197 Scheduled e2e tests on main (#5551)
* WIP: Scheduled e2e tests

* Update .github/workflows/e2e-tests.yml

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-02-28 18:55:45 +00:00
1f1e996cfa Bugfix: absolute line segment dragging behavior offset was relative (#5571)
* Refactor: Use the named constant for 'endAbsolute' in more places

* Bugfix: lineTo was calculating relative distances instead of absolute

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-28 12:50:14 -05:00
58167deda7 Fix file I/O errors to not be engine type errors (#5554)
* Fix file I/O errors to not be engine type errors

* Update output
2025-02-28 12:08:44 -05:00
83d22a4f5f Release kcl 44 (#5570) 2025-02-28 09:56:19 -06:00
7003b19a70 Release kcl 42 (#5569) 2025-02-28 09:50:32 -06:00
687ef1429d make code dryer, (#5566)
make code dryer, inner_run used to be recursive i didnt realize it changed

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-28 19:24:48 +13:00
b1b00a9a22 Fix Toolbar flash bug (during sketchMode animation (#5564)
* fix toolbar flash during animation

* add regression test

* fmt

* test tweak

* fmt
2025-02-28 04:50:01 +00:00
a0924bcfa3 Save the rust version of settings (#5563)
* ensure we save the correct value for the settings versus relying on tomlStringify

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more exact functions

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-27 19:35:39 -05:00
5ce22e2de8 better track the root source code (#5558)
* better track the root source code

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix mut self

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-27 22:34:01 +00:00
850c5c62d1 Fix overflow in KCL command palette input (#5559)
Closes #4719.
2025-02-27 20:18:32 +00:00
b31786c9ab Add step to E2E test to verify Backspace doesn't dismiss command palette (#5557) 2025-02-27 18:58:17 +00:00
936549d60f Fix nightly changelog (#5550) 2025-02-27 11:00:56 -05:00
0babbcff49 Remove skipWin tag on point-and-click e2e tests (#5531)
* Remove skipWin tag on point-and-click e2e tests

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-27 09:34:15 -05:00
02c2e80b31 Remove hole from toolbar (#5543)
* Remove hole from toolbar
Fixes #5542

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-27 09:33:57 -05:00
da236d9a3e Fix switching between KCL arguments (#5512)
* Fix switching between KCL arguments

Needed to imperatively send a transaction to the editor, since it
doesn't get re-rendered when switching from one KCL-type arg to another.

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-02-27 10:01:08 +00:00
1104d908c0 Improve hover tool tips and function docs (#5538)
* Improve hover tool tips and function docs

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-27 22:03:37 +13:00
2efea3ec06 export shit i need (#5539)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-27 05:15:52 +00:00
775007ef0d clean stale docs (#5536)
clean-stale-docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-27 03:44:28 +00:00
f490e7d6fe better errors from rust to lsp for execution errors (#5526)
* better errors start

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* conversions

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* miette update

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* related errrors test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* a bit better

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* regenerate other errors

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* add diagnostics test

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-27 03:29:59 +00:00
89bc93e4cd Add default planes to std (#5433)
* Type ascription

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Support negation of planes

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add default planes to std

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Don't double wrap docs files in const_

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-27 15:58:58 +13:00
12edb6375d Fix a units bug in multi-module projects (#5529)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-27 15:46:41 +13:00
8d9bba02d6 add pattern3d tests that now work that were being used for debugging (#3862)
* more samples for useOriginal

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-02-26 20:23:27 -05:00
56e100fad7 Transform std lib functions (#5067)
* transform

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* u[dates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-26 17:45:19 -07:00
38f7a4089e Add in the basics for Import ordering (#5524)
* Add in the basics for Import ordering

This will walk AST for import notes, and build up a mapping of
relationships tying in the target of the import (the "dependency")
to our current program (the "dependent").

This allows us to build up a mapping of what dependency and reverse
dependency relationships look like, in order to sort dependencies by
topologically sorting them.

Since I wanted to enable some parallelism here long-term, this returns
the (kinda awkward) `Vec<Vec<String>>` type.

This is a list of list of dependency targets which can safely be run
concurrently, because they have no dependency relationship to eachother.
Each list of dependencies should be gated, and start the next list of
dependencies after the first is complely done. This isn't ideal and will
change long-term, but for now this will work to enable very basic
opportunistic parallelism.

* clippy v1.0

* allow this

this lint doesn't apply here, order doesn't matter. Elsewhere in this
program where order does matter we do the intermediate vec.

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2025-02-27 00:26:19 +00:00
91f5465e2d Revert "Correct hovering highlights on HiDPI screens + correct 2 flakey tests" (#5535)
* Revert "Correct hovering highlights on HiDPI screens + correct 2 flakey tests…"

This reverts commit 5743b9ced0.

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-26 15:49:13 -08:00
58a9c60d0b Test code examples in docs and add docs for per-file settings (#5474)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-27 09:34:55 +13:00
725c4d95f8 prompt-to-edit API request snapshot testing infrastructure (#5514)
* POC write output to json

* move to cmd bar

* write files

* clean up

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* tweak

* tweak

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* update fmt ignore etc

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-27 05:44:40 +11:00
615b7feabb Don't toss logs on successful snapshot tests (#5522) 2025-02-26 12:09:38 -05:00
5743b9ced0 Correct hovering highlights on HiDPI screens + correct 2 flakey tests (#5510)
* Fix hover highlights on HiDPI screens

* Fix flakey tests with new toolbar.exitSketch

* tsc && lint && fmt

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Disable pw electron thing again

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-26 11:12:08 -05:00
8896d06028 Release KCL 39 (#5518) 2025-02-26 09:07:57 -06:00
max
1f217ef50b Fix Second-Body Extrude Selection (#5456)
* getSweepArtifactFromSelection

* update getPathToExtrudeForSegmentSelection

* update shell

* add tests and update selection

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* add support for wall and cap

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fmt

* add CallExpressionKw

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-26 08:28:41 -05:00
5ef5c6280c Fix: revert the red color for runtime error back to the hue shift color (#5509)
* fix: don't use red for runtime error, use hue shift like the original error icon

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix: decrease font size for better layout

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-25 22:15:01 -06:00
aac95e1e2e Fix to add revolve about edge to the artifact graph (#5511) 2025-02-25 23:04:10 -05:00
18f4a1303c Multiple prompt-to-edit selection, plus direct editor selections (#5478)
* Add multiple selections and editor selections for promptToEdit

* remove unused

* re-enable prompt to edit tests

* add test for manual code selection

* at test for multi-selection

* clean up

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* typo

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-26 03:06:51 +00:00
ded97eda61 Fix kcl-samples URL and other minor things (#5508)
* Fix kcl-samples URL

* Delete debug files
2025-02-25 20:54:05 +00:00
f6b06520ee Bugfix: wait for settings loading before onboarding redirect check (#5470)
* Bugfix: wait for settings loading before onboarding redirect check

If you refresh the app while viewing a file, the settingsActor could not
have loaded the user settings before checking the onboardingStatus
setting. This uses a subscription on the settingsActor to await the
"init" state, after the user settings have loaded.

* Adjust approach to not use routeLoaders

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-25 14:35:19 -05:00
dcfcdc98ce Feature: Show runtime errors within files that are being imported (#5500)
* chore: dumping progress

* chore: saving progress

* fix: Got a working example of filenames piped from Rust to TS

* fix: cleaning up debugging code

* fix: TS type for filenames

* fix: rust linter errors

* fix: cargo fmt

* fix: testing code, updating KCLError class for filenames

* fix: auto fixes

* feat: display badge in project folder if there is an error in another file

* chore: skeleton ideas for badge notifications from errors in imported files

* fix: more skeleton code to test some potential implementations

* fix: addressing PR comments

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix: fixing the rust struct?

* fix: cargo fmt

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* feat: skeleton workflow for showing runtime errors

* chore: showBadge, adding more props

* fix: new application state to reset errors from previous execution if parse fails first

* fix: cleanup

* fix: better UI

* fix: adding comment for future

* fix: revert for production

* fix: removing unused comment

* chore: swapping JS object to typed Map

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-25 13:18:59 -06:00
9ab3325580 Revert "Get rid of failing cache on build-apps' setup-node" and fix wasm copy on Windows (#5505)
* Revert "Get rid of failing cache on build-apps' setup-node (#5490)"

This reverts commit 2523242bb1.

* Fix JSON backlash escape hell
2025-02-25 18:56:00 +00:00
cb5ad3ab27 Make nightly builds tag-based to allow manual triggering (#5493)
* Get rid of failing cache on build-apps' setup-node

* Make nightly runs tag-based to allow manual triggering
Fixes #5492

* Add permissions contents write
2025-02-25 12:53:40 -05:00
1e539cc134 Chore: Return file paths to map SourceRange index to filename (#5471)
* chore: dumping progress

* chore: saving progress

* fix: Got a working example of filenames piped from Rust to TS

* fix: cleaning up debugging code

* fix: TS type for filenames

* fix: rust linter errors

* fix: cargo fmt

* fix: testing code, updating KCLError class for filenames

* fix: auto fixes

* fix: addressing PR comments

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix: fixing the rust struct?

* fix: cargo fmt

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-25 11:51:54 -06:00
4297dc43ae Disable pw object.assign context (#5498) 2025-02-25 16:49:58 +00:00
935b4ee7f5 KCL: All keyword arguments should use camelCase (#5481)
Closes #5355
2025-02-25 10:29:59 -06:00
2523242bb1 Get rid of failing cache on build-apps' setup-node (#5490) 2025-02-25 09:53:18 -05:00
309e4fadf0 Backspace as Delete only on macOS (#5453)
* Backspace as Delete only on macOS

* Call isDesktop first

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-25 09:41:25 -05:00
842054de09 refactor codeToIdSelections (#5432)
* add test for original range to artifact conversion

* try naieve refactor

* types clean up

* typo

* break function into smaller functions

* optimizations

* better comments

* camera test tweak

* fmt

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* overflow fix

* update binary search to ignore end ranges

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* break binary search into sub function

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-25 12:51:25 +00:00
af146284b6 Share instances of the std prelude (#5448)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-25 16:10:06 +13:00
5ac40e6849 Use Rust 1.85 (#5441) 2025-02-24 18:04:43 -06:00
d3e0625e8a Add edit flow for Helix (#5394)
* WIP: Add edit flow for Helix
Fixes #5392

* Clean upp

* Add e2e test step
2025-02-24 18:44:13 -05:00
484da28374 Rename AI-related buttons to reduce confusion (#5475)
Just renaming the titles for now; there are lots of other places we
refer to "text-to-cad" and "prompt-to-edit" that we will will want to
follow up on eventually I'm sure. This is a user fix with the least
chance of introducing bugs.
2025-02-24 18:14:00 +00:00
fa9e6ccea9 Bring back Playwright-Electron Workbench's on-failure screenshot + new PLAYWRIGHT_RECORD_VIDEO (#5464)
* Fix playwright-electron screenshots on failure and add PLAYWRIGHT_RECORD_VIDEO

* yarn tsc
2025-02-24 13:09:39 -05:00
77fbb68419 Improve dev experience on windows (#5335)
* Add files:flip-to-nightly:windows

* Add fetch:wasm:windows script

* Add install:tools:windows

* Update install:tools:windows

* Remove wasm-pack and improve README instruction

* yarn.lock

* Update to Powershell 7, fixes left and right

* Contd clean up

* install:wasm-pack fix and cleanup

* Fix vercel (hopefully)

* Attempt 2 for Vercel

* Attempt 3 for Vercel

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Attempt 5

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Another fix

* Try with install:wasm-pack:cargo

* Decouple wasm-pack install and build:wasm

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Use install:wasm-pack:sh where possible

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* @jtran's comments

* Back to cargo

* Use binary install of wasm-pack through taiki-e/install-action

* Fix QL suggestions

* Add PS7 link

* Fix build:wasm:windows

* Fix flip-files-to-nightly after PS7 upgrade

* Pin taiki-e/install-action@v2.48.20

* Try with taiki-e/install-action@2dbeb927f5

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-24 11:19:09 -05:00
253a7910b0 Fix settings loading actions (#5469)
Due to a lapse in understanding between `Set all settings` event and
`setAllSettings` action, these were missing from slots where user and
project settings are loaded. We want to fire off these effectful actions
when those settings are updated so that we can, for example, get the
opposite theme for sketch mode properly.
2025-02-24 10:23:10 -05:00
88c6be810f Bump nick-fields/retry from 3.0.0 to 3.0.1 (#5466)
Bumps [nick-fields/retry](https://github.com/nick-fields/retry) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/nick-fields/retry/releases)
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js)
- [Commits](https://github.com/nick-fields/retry/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: nick-fields/retry
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 08:32:30 -05:00
2860926571 Bump tailwindcss from 3.4.7 to 3.4.17 (#5468)
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) from 3.4.7 to 3.4.17.
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v3.4.17/packages/tailwindcss)

---
updated-dependencies:
- dependency-name: tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 05:43:05 -05:00
fb81c02877 Bump electron-updater from 6.5.0 to 6.6.0 (#5467)
Bumps [electron-updater](https://github.com/electron-userland/electron-builder/tree/HEAD/packages/electron-updater) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/electron-userland/electron-builder/releases)
- [Changelog](https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/CHANGELOG.md)
- [Commits](https://github.com/electron-userland/electron-builder/commits/electron-updater@6.6.0/packages/electron-updater)

---
updated-dependencies:
- dependency-name: electron-updater
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 05:41:48 -05:00
d78648f0f8 Bump @codemirror/language from 6.10.3 to 6.10.8 (#5402)
* Bump @codemirror/language from 6.10.3 to 6.10.8

Bumps [@codemirror/language](https://github.com/codemirror/language) from 6.10.3 to 6.10.8.
- [Changelog](https://github.com/codemirror/language/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/language/compare/6.10.3...6.10.8)

---
updated-dependencies:
- dependency-name: "@codemirror/language"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: 49fl <ircsurfer33@gmail.com>
2025-02-22 14:36:36 -05:00
fe31769be5 update github action to only post comment once (#5454)
* update github action

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

---------

Co-authored-by: 49fl <ircsurfer33@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-22 14:21:02 -05:00
388371b05d External retry of the playwright step instead of --last-failed (#5465)
* External retry

* Trigger CI

* More external attemps, less internal retries

* Trigger CI

* Trigger CI

* Clean up for PR

* Add --retries=2 to cargo test
2025-02-22 12:59:19 -05:00
9db69007e5 Initiate connection when we receive SDP and don't connect when null (#5451)
* Initiate connection when we receive SDP and don't connect when null

Sometimes clients were gathering ice candidates faster than we returning
the SDP answer, which meant we tried to parse a null as the remote
description.

Clean up tsc error and add log on timeout

* Add fallback for windows CI

WIP

* If we get sdp answer just connect

* typo

* Fmt

---------

Co-authored-by: 49fl <ircsurfer33@gmail.com>
2025-02-22 12:38:09 -05:00
f2a6492ab7 Set apperance in feature tree context menu (#5439)
* Revert "Revert multi-profile (#4812)"

This reverts commit efe8089b08.

* fix poor 1000ms wait UX

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu-latest-8-cores)

* trigger CI

* Add Rust side artifacts for startSketchOn face or plane (#4834)

* Add Rust side artifacts for startSketchOn face or plane

* move ast digging

---------

Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>

* lint

* lint

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-macos-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-16-cores)

* trigger CI

* chore: disabled file watcher which prevents faster file write (#4835)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* partial fixes

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Trigger CI

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Trigger CI

* Fix up all the tests

* Fix partial execution

* wip

* WIP

* wip

* rust changes to make three point confrom to same as others since we're not ready with name params yet

* most of the fix for 3 point circle

* get overlays working for circle three point

* fmt

* fix types

* cargo fmt

* add face codef ref for walls and caps

* fix sketch on face after updates to rust side artifact graph

* some things needed for multi-profile tests

* bad attempts at fixing rust

* more

* more

* fix rust

* more rust fixes

* overlay fix

* remove duplicate test

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* lint and typing

* maybe fix a unit test

* small thing

* WIP: Add Delete right click menu item to Feature Tree
Copying code around
Fixes #5090

* I don't know why it works

* WIP

* fix circ dep

* fix unit test

* fix some tests

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Working deletion machine loo

* Working helix deletion

* Extend deletion to more things

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* fix sweep point-and-click test

* fix more tests and add a fix me

* fix more tests

* fix electron specific test

* tsc

* more test tweaks

* update docs

* commint snaps?

* is clippy happy now?

* clippy again

* test works now without me changing anything big-fixed-itself

* small bug

* make three point have cross hair to make it consistent with othe rtools

* fix up state diagram

* fmt

* add draft point for first click of three point circ

* 1 test for three point circle

* 2 test for three point circle

* clean up

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* remove bad doc comment

* remove test skip

* remove onboarding test changes

* Update src/lang/modifyAst.ts

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

* Update output from simulation tests

* Fix to use correct source ranges

This also reduces cloning.

* Change back to skipping face cap none and both

* Update output after changing back to skipping none and both

* Fix clippy warning

* fix profile start snap bug

* WIP: migrate to actor

* add path ids to cap

* fix going into edit sketch

* make other startSketchOn's work

* fix snapshot test

* explain function name

* Update src/lib/rectangleTool.ts

Co-authored-by: Frank Noirot <frank@zoo.dev>

* rename error

* remove file tree from diff

* Update src/clientSideScene/segments.ts

Co-authored-by: Frank Noirot <frank@zoo.dev>

* nit

* Continue actor migration

* Prevent double write to KCL code on revolve

* Clean up

* Update output after adding cap-to-path graph edge

* Clean up

* Update machine diag

* Update context menu hotkey class

* Fix edit/select sketch-on-cap via feature tree

* clean up for face codeRef

* fix changing tools part way through circle/rect tools

* fix delete of circle profile

* fix close profiles

* fix closing profile bug (tangentArcTo being ignored)

* remove stale comment

* Delete paths associated with sketch when the sketch plane is deleted

* Add support for deleting sketches on caps (not walls)

* get delet working for walls

* make delet of extrusions work for multi profile

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Delete the sketch statement too on the cap and wall cases

* Don't write to file in `split-sketch-pipe-if-needed` unless necessary

* Don't wait for file write to complete within `updateEditorWithAstAndWriteToFile`
It is already debounced internally. If we await it, we will have to wait for a debounced timeout

* Fix bad conflict resolution

* Fix a few things post merge

* Add guard back, fixing tests

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores)

* Add e2e test

* WIP: Add Set apperance right click menu item to Feature Tree
Fixes #5372

* Working cheap implementation

* Unset appearance via Default option

* More colors

* Add basic test

* Add test

* Lint

* 🔪 them timers

* Increase color matching threshold on appearance test

* Fix colors in e2e

* Move Set apperance down in the menu

* Revert "Move Set apperance down in the menu"

This reverts commit eb1d2e2c1c.

* Attempt at fixing dual extrude for role option search in test

---------

Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: 49lf <ircsurfer33@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-02-22 13:09:54 +00:00
3ddce116e5 Warn when calling deprecated functions (#5447)
* Warn when calling deprecated std functions

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Refactor function values

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-22 20:16:29 +13:00
57f7d022ca Allow using a different source range for suggestions than the error message (#5442)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-02-22 18:55:44 +13:00
cbc12559c7 KCL: Go back to kcl-samples next (#5458) 2025-02-21 18:24:01 -05:00
2416 changed files with 7102058 additions and 211641 deletions

View File

@ -1,3 +1,3 @@
[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
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,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo

View File

@ -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

View File

@ -4,6 +4,7 @@
"project": "./tsconfig.json"
},
"plugins": [
"react-perf",
"css-modules",
"jest",
"jsx-a11y",

View File

@ -0,0 +1,8 @@
FROM node:slim
COPY . /action
WORKDIR /action
RUN npm install --production
ENTRYPOINT ["node", "/action/main.js"]

View 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.

View 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
View 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);
});

View File

@ -0,0 +1,10 @@
{
"name": "wasmtime-github-release",
"version": "0.0.0",
"main": "main.js",
"dependencies": {
"@actions/core": "^1.6",
"@actions/github": "^5.0",
"glob": "^7.1.5"
}
}

View File

@ -21,7 +21,7 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
fi
retry=1
max_retrys=5
max_retrys=1
# retry failed tests, doing our own retries because using inbuilt playwright retries causes connection issues
while [[ $retry -le $max_retrys ]]; do

350
.github/dependabot.yml vendored
View File

@ -1,41 +1,331 @@
# 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/'
- 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:
- major
- minor
- patch
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
- 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*"
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
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:
- major
- minor
- patch
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:
- major
- minor
- patch
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:
- major
- minor
- patch
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:
- major
- minor
- patch
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:
- major
- minor
- patch
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: /public/kcl-samples
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:
- major
- minor
- patch
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:
- major
- minor
- patch
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:
- major
- minor
- patch
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

View File

@ -16,12 +16,21 @@ jobs:
cache: 'yarn'
- name: Install dependencies
run: yarn
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache wasm
- 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@955a6ff1416eae278c9f833008a9beb4b7f9afe3
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
@ -30,4 +39,4 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: wasm-bundle
path: src/wasm-lib/pkg
path: rust/kcl-wasm-lib/pkg

View File

@ -7,14 +7,11 @@ 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)
- 'nightly-v[0-9]+.[0-9]+.[0-9]+'
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.ref_type == 'tag' && startsWith(github.ref_name, 'nightly-v') }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@ -36,20 +33,71 @@ jobs:
- run: yarn 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@955a6ff1416eae278c9f833008a9beb4b7f9afe3
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
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
run: "yarn build:wasm"
- name: Set nightly version, product name, release notes, and icons
if: ${{ env.IS_NIGHTLY == 'true' }}
run: yarn files:flip-to-nightly
run: |
export VERSION=${GITHUB_REF_NAME#nightly-v}
yarn files:set-version
yarn files:flip-to-nightly
- name: Set release version
if: ${{ env.IS_RELEASE == 'true' }}
@ -63,7 +111,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
@ -113,9 +161,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
@ -128,8 +176,9 @@ jobs:
- name: yarn install
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
uses: nick-fields/retry@v3.0.0
uses: nick-fields/retry@v3.0.2
with:
shell: bash
timeout_minutes: 2
max_attempts: 3
command: yarn install
@ -179,8 +228,9 @@ jobs:
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
uses: nick-fields/retry@v3.0.2
with:
shell: bash
timeout_minutes: 10
max_attempts: 3
command: yarn tronb:package:prod
@ -240,8 +290,9 @@ jobs:
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
uses: nick-fields/retry@v3.0.2
with:
shell: bash
timeout_minutes: 10
max_attempts: 3
command: yarn tronb:package:prod
@ -269,7 +320,7 @@ jobs:
runs-on: ubuntu-22.04
permissions:
contents: write
if: ${{ github.ref_type == 'tag' || github.event_name == 'schedule' }}
if: ${{ github.ref_type == 'tag' }}
env:
VERSION_NO_V: ${{ needs.prepare-files.outputs.version }}
VERSION: ${{ format('v{0}', needs.prepare-files.outputs.version) }}
@ -326,8 +377,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%20Modeling%20App%20%28Nightly%29' || 'Zoo%20Modeling%20App' }}
run: |
RELEASE_DIR=https://${WEBSITE_DIR}
jq --null-input \
@ -382,7 +433,7 @@ jobs:
# 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 PREVIOUS_TAG=$(git tag --list --sort=-committerdate "nightly-v[0-9]*" | head -n2 | tail -n1)
export NOTES=$(./scripts/get-nightly-changelog.sh)
yarn files:set-notes
@ -410,14 +461,3 @@ 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 })

62
.github/workflows/cargo-bench.yml vendored Normal file
View File

@ -0,0 +1,62 @@
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:
- runs-on=${{ github.run_id }}
- runner=32cpu-linux-x64
- extras=s3-cache
steps:
- uses: runs-on/action@v1
- 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 --measurement-mode walltime
- name: Run the benchmarks
uses: CodSpeedHQ/action@v3
with:
working-directory: rust
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
mode: walltime
env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}

View File

@ -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

View File

@ -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
cache-workspaces: rust
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2.6.1
- 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.

View File

@ -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
cache-workspaces: rust
components: rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@v2.6.1
- name: Run cargo fmt
run: |
cd "${{ matrix.dir }}"
cd rust
cargo fmt -- --check
shell: bash

View File

@ -5,25 +5,35 @@ on:
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']
steps:
- uses: actions/checkout@v4
- name: Install latest rust
uses: actions-rs/toolchain@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
toolchain: stable
override: true
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: Install vector
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
@ -40,22 +50,95 @@ jobs:
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
- uses: taiki-e/install-action@cargo-llvm-cov
- 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
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 --retries=2 --no-fail-fast --profile ci simulation_tests::kcl_samples 2>&1 | tee /tmp/github-actions.log
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
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
cd rust
just overwrite-sim-test kcl_samples
git add kcl-lib/tests
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}}
# Configure nextest when it's run by insta (via just).
NEXTEST_PROFILE: ci
RUST_BACKTRACE: full
RUST_MIN_STACK: 10485760000
- name: cargo test
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
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
cd rust
cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --retries=2 --no-fail-fast -P ci 2>&1 | tee /tmp/github-actions.log
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
RUST_MIN_STACK: 10485760000
- name: Upload to codecov.io
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
uses: codecov/codecov-action@v5
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
flags: wasm-lib
flags: rust
verbose: true
files: lcov.info

View File

@ -27,6 +27,15 @@ jobs:
const owner = context.repo.owner;
const repo = context.repo.repo;
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number
});
const commentExists = comments.some(comment => comment.body === message);
if (!commentExists) {
// Post a comment on the PR
await github.rest.issues.createComment({
owner,
@ -34,3 +43,4 @@ jobs:
issue_number,
body: message,
});
}

48
.github/workflows/check-kcl-header.yml vendored Normal file
View 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

View File

@ -3,6 +3,8 @@ on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: 0 * * * * # hourly
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@ -16,64 +18,91 @@ permissions:
jobs:
check-rust-changes:
conditions:
runs-on: ubuntu-latest
outputs:
rust-changed: ${{ steps.filter.outputs.rust }}
significant: ${{ steps.path-changes.outputs.significant }}
should-run: ${{ steps.should-run.outputs.should-run }}
steps:
- uses: actions/checkout@v4
- 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 "significant=true" >> $GITHUB_OUTPUT
exit 0
fi
changed_files=$(git diff --name-only origin/${{ github.base_ref }})
echo "$changed_files"
if grep -Evq '^README.md|^public/kcl-samples/|^rust/kcl-lib/tests/kcl_samples/' <<< "$changed_files" ; then
echo "significant=true" >> $GITHUB_OUTPUT
else
echo "significant=false" >> $GITHUB_OUTPUT
fi
- name: Should run
id: should-run
shell: bash
run: |
set -euo pipefail
# We should run when this is a scheduled run or if there are
# significant changes in the diff.
if [[ ${{ github.event_name }} == 'schedule' || ${{ steps.path-changes.outputs.significant }} == 'true' ]]; then
echo "should-run=true" >> $GITHUB_OUTPUT
else
echo "should-run=false" >> $GITHUB_OUTPUT
fi
- name: Display conditions
shell: bash
run: |
# For debugging purposes.
set -euo pipefail
echo "significant: ${{ steps.path-changes.outputs.significant }}"
echo "should-run: ${{ steps.should-run.outputs.should-run }}"
prepare-wasm:
# seperate job on Ubuntu to build or fetch the wasm blob once on the fastest runner
runs-on: namespace-profile-ubuntu-8-cores
needs: conditions
steps:
- uses: actions/checkout@v4
if: needs.conditions.outputs.should-run == 'true'
- id: filter
if: needs.conditions.outputs.should-run == 'true'
name: Check for Rust changes
uses: dorny/paths-filter@v3
with:
filters: |
rust:
- 'src/wasm-lib/**'
- 'rust/**'
electron:
timeout-minutes: 60
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
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]
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
if: needs.conditions.outputs.should-run == 'true'
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- uses: KittyCAD/action-install-cli@main
- name: Install dependencies
shell: bash
if: needs.conditions.outputs.should-run == 'true'
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'
if: ${{ needs.conditions.outputs.should-run == 'true' && github.event_name != 'schedule' && steps.filter.outputs.rust == 'false' }}
uses: dawidd6/action-download-artifact@v7
continue-on-error: true
with:
@ -81,65 +110,118 @@ jobs:
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') }}
path: rust/kcl-wasm-lib/pkg
- name: Build WASM condition
id: wasm
if: needs.conditions.outputs.should-run == 'true'
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: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
shell: bash
run: |
brew install gnu-sed
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Install vector
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
if: ${{ needs.conditions.outputs.should-run == 'true' && 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@955a6ff1416eae278c9f833008a9beb4b7f9afe3
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
with:
tool: wasm-pack
- name: Rust Cache
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
uses: Swatinem/rust-cache@v2
with:
workspaces: './rust'
- name: Build Wasm
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
shell: bash
# TODO: figure out what to do with this, it's failing
if: false
run: yarn build:wasm
- uses: actions/upload-artifact@v4
if: needs.conditions.outputs.should-run == 'true'
with:
name: prepared-wasm
path: |
rust/kcl-wasm-lib/pkg/kcl_wasm_lib*
snapshots:
name: playwright:snapshots:ubuntu
runs-on: namespace-profile-ubuntu-8-cores
needs: [conditions, prepare-wasm]
steps:
- uses: actions/create-github-app-token@v1
if: needs.conditions.outputs.should-run == 'true'
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
if: needs.conditions.outputs.should-run == 'true'
with:
token: ${{ steps.app-token.outputs.token }}
- uses: actions/download-artifact@v4
if: needs.conditions.outputs.should-run == 'true'
name: prepared-wasm
- name: Copy prepared wasm
if: needs.conditions.outputs.should-run == 'true'
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
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
if: needs.conditions.outputs.should-run == 'true'
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
id: deps-install
if: needs.conditions.outputs.should-run == 'true'
run: yarn
- name: Cache Playwright Browsers
if: needs.conditions.outputs.should-run == 'true'
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
- name: Install Playwright Browsers
if: needs.conditions.outputs.should-run == 'true'
run: yarn playwright install --with-deps
- name: build web
shell: bash
if: needs.conditions.outputs.should-run == 'true'
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.
if: needs.conditions.outputs.should-run == 'true'
run: |
PLATFORM=web yarn playwright test --config=playwright.config.ts --retries="3" --update-snapshots --grep=@snapshot --shard=1/1
yarn test:snapshots
env:
CI: true
NODE_ENV: development
@ -147,33 +229,37 @@ jobs:
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()) }}
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
with:
name: playwright-report-${{ matrix.os }}-snapshot-${{ matrix.shardIndex }}-${{ github.sha }}
name: playwright-report-snapshots-${{ 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()) }}
if: ${{ needs.conditions.outputs.should-run == 'true' && !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' }}
if: ${{ needs.conditions.outputs.should-run == 'true' && 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
git add e2e/playwright/snapshot-tests.spec.ts-snapshots e2e/playwright/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'
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.git-check.outputs.modified == 'true' }}
shell: bash
run: |
git add e2e/playwright/snapshot-tests.spec.ts-snapshots
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
@ -183,26 +269,96 @@ jobs:
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'
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.git-check.outputs.modified == 'true' }}
with:
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
name: playwright-report-ubuntu-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
electron:
needs: [conditions, prepare-wasm]
timeout-minutes: 60
name: playwright:electron:${{ matrix.os }} ${{ matrix.shardIndex }} ${{ matrix.shardTotal }}
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: add ref here for main and latest release tag
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
if: needs.conditions.outputs.should-run == 'true'
- uses: actions/download-artifact@v4
if: ${{ !cancelled() && (success() || failure()) }}
if: needs.conditions.outputs.should-run == 'true'
name: prepared-wasm
- name: Copy prepared wasm
if: needs.conditions.outputs.should-run == 'true'
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
if: needs.conditions.outputs.should-run == 'true'
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install dependencies
id: deps-install
if: needs.conditions.outputs.should-run == 'true'
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
run: yarn playwright install --with-deps
- name: Build web
if: needs.conditions.outputs.should-run == 'true'
run: yarn tronb:vite:dev
- 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
# TODO: Add back axiom logs
- uses: actions/download-artifact@v4
if: ${{ needs.conditions.outputs.should-run == 'true' && !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()) }}
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && steps.deps-install.outcome == 'success' }}
uses: nick-fields/retry@v3.0.2
with:
shell: bash
run: |
.github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{matrix.os}}
timeout_minutes: 30
max_attempts: 25
env:
CI: true
FAIL_ON_CONSOLE_ERRORS: true
@ -210,20 +366,21 @@ jobs:
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()
if: ${{ needs.conditions.outputs.should-run == 'true' && 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()
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}
with:
name: playwright-report-${{ matrix.os }}-${{ matrix.shardIndex }}-${{ github.sha }}
path: playwright-report/
include-hidden-files: true
retention-days: 30
overwrite: true

View File

@ -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
@ -39,9 +40,21 @@ jobs:
# 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/settings
rm -rf documentation/content/pages/docs/kcl/consts
# 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/settings documentation/content/pages/docs/kcl/
mv -f docs/kcl/consts documentation/content/pages/docs/kcl/
- 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: |

View File

@ -0,0 +1,401 @@
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: 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: |
yarn install
cd rust/kcl-language-server
yarn install
- name: Run tests
run: |
cd rust/kcl-language-server
yarn build
yarn test-compile
ls -la dist
xvfb-run -a yarn test
if: runner.os == 'Linux'
- name: Run tests
run: |
cd rust/kcl-language-server
yarn 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: 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
yarn install
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package -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 -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 -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 -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: 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 \
yarn \
npm
- 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
yarn install
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package -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 -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: 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.2
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

View File

@ -0,0 +1,182 @@
# 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:
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:
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:
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:
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 }}
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-*/*

24
.github/workflows/ruff.yml vendored Normal file
View 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

View File

@ -37,6 +37,9 @@ jobs:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
with:
tool: wasm-pack
- run: yarn build:wasm
yarn-tsc:
@ -49,10 +52,14 @@ jobs:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- run: yarn --cwd ./rust/kcl-language-server --modules-folder node_modules install
- uses: Swatinem/rust-cache@v2
with:
workspaces: './src/wasm-lib'
workspaces: './rust'
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
with:
tool: wasm-pack
- run: yarn build:wasm
- run: yarn tsc
@ -66,6 +73,7 @@ jobs:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- run: yarn --cwd ./rust/kcl-language-server --modules-folder node_modules install
- run: yarn lint
python-codespell:
@ -92,6 +100,9 @@ jobs:
cache: 'yarn'
- run: yarn install
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
with:
tool: wasm-pack
- run: yarn build:wasm
- run: yarn simpleserver:bg
@ -118,6 +129,9 @@ jobs:
cache: 'yarn'
- run: yarn install
- uses: taiki-e/install-action@955a6ff1416eae278c9f833008a9beb4b7f9afe3
with:
tool: wasm-pack
- run: yarn build:wasm
- run: yarn simpleserver:bg
@ -129,7 +143,7 @@ jobs:
- name: run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn test:unit
run: xvfb-run -a yarn test:unit
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}

39
.github/workflows/tag-nightly.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: tag-nightly
permissions:
contents: write
on:
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)
jobs:
tag-nightly:
runs-on: ubuntu-22.04
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'
- run: yarn install
- name: Push tag
run: |
VERSION_NO_V=$(date +'%-y.%-m.%-d')
TAG="nightly-v$VERSION_NO_V"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag $TAG
git push origin tag $TAG

40
.gitignore vendored
View File

@ -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,19 @@ yarn-error.log*
.idea
.vscode
.helix
src/wasm-lib/.idea
src/wasm-lib/.vscode
# 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
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
@ -48,26 +51,33 @@ e2e/playwright/export-snapshots/*
!e2e/playwright/export-snapshots/*.png
!e2e/playwright/snapshot-tests.spec.ts-snapshots/*.png
/kcl-samples
/public/kcl-samples.zip
/public/kcl-samples/.github
/public/kcl-samples/screenshots/main.kcl
/public/kcl-samples/step/main.kcl
/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

View File

@ -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

View File

@ -1,6 +1,6 @@
.PHONY: dev
WASM_LIB_FILES := $(wildcard src/wasm-lib/**/*.rs)
KCL_WASM_LIB_FILES := $(wildcard rust/**/*.rs)
TS_SRC := $(wildcard src/**/*.tsx) $(wildcard src/**/*.ts)
XSTATE_TYPEGENS := $(wildcard src/machines/*.typegen.ts)
@ -18,7 +18,7 @@ lee-electron-test:
$(XSTATE_TYPEGENS): $(TS_SRC)
yarn xstate typegen 'src/**/*.ts?(x)'
public/wasm_lib_bg.wasm: $(WASM_LIB_FILES)
public/kcl_wasm_lib_bg.wasm: $(KCL_WASM_LIB_FILES)
yarn build:wasm
node_modules: package.json yarn.lock

View File

@ -40,7 +40,7 @@ The 3D view in Modeling App is just a video stream from our hosted geometry engi
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
[Original demo slides](https://github.com/KittyCAD/Eng/files/10398178/demo.pdf)
[Original demo slides](https://github.com/user-attachments/files/19010536/demo.pdf)
## Get started
@ -48,22 +48,53 @@ We recommend downloading the latest application binary from [our Releases page](
## 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:
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:
```
yarn install
```
followed by:
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
yarn install:rust
yarn install:wasm-pack:sh
# Windows
yarn install:rust:windows
yarn install:wasm-pack:cargo
```
Then to build the WASM layer, run:
```
# macOS/Linux
yarn build:wasm
# Windows
yarn build:wasm:windows
```
or if you have the gh cli installed
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 `yarn install:tools:windows`.
```
./get-latest-wasm-bundle.sh # this will download the latest main wasm bundle
# macOS/Linux
yarn fetch:wasm
# Windows
yarn fetch:wasm:windows
```
That will build the WASM binary and put in the `public` dir (though gitignored).
@ -74,7 +105,7 @@ 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.
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` 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
@ -101,13 +132,14 @@ 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)
To package the app for your platform 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
@ -163,6 +195,7 @@ The other `build-apps` output in the release `build-apps` workflow (triggered by
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'
@ -186,7 +219,6 @@ A new `publish-apps-release` will kick in and you should be able to find it [her
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:
@ -196,7 +228,7 @@ $ cargo install cargo-fuzz
```
```bash
$ cd src/wasm-lib/kcl
$ cd rust/kcl-lib
# list the fuzz targets
$ cargo fuzz list
@ -224,6 +256,7 @@ 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
@ -236,7 +269,6 @@ and in another terminal, run:
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:
@ -254,7 +286,6 @@ PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project=
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
@ -348,17 +379,19 @@ Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testin
- `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
cd rust
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
@ -368,7 +401,7 @@ install [`just`](https://github.com/casey/just?tab=readme-ov-file#pre-built-bina
# 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
cd rust
just test
```
@ -376,7 +409,7 @@ just test
# Without just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
cd src/wasm-lib
cd rust
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
```
@ -385,13 +418,14 @@ 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
cd rust
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`?
@ -410,7 +444,6 @@ yarn test-setup
> Gotcha, are packages up to date and is the wasm built?
```
yarn tsc
yarn fmt-check
@ -466,7 +499,7 @@ PS: for the debug panel, the following JSON is useful for snapping the camera
## KCL
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/src/wasm-lib/kcl).
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib).
### Logging

View File

@ -1,15 +0,0 @@
---
title: "QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
QUARTER_TURN: number(deg) = 90deg
```

View File

@ -1,15 +0,0 @@
---
title: "THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -9,7 +9,7 @@ Compute the absolute value of a number.
```js
abs(num: number) -> number
abs(num: number): number
```
### Tags
@ -21,11 +21,11 @@ abs(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

View File

@ -9,7 +9,7 @@ Compute the arccosine of a number (in radians).
```js
acos(num: number) -> number
acos(num: number): number
```
### Tags
@ -21,11 +21,11 @@ acos(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

View File

@ -9,7 +9,11 @@ Returns the angle to match the given length for x.
```js
angleToMatchLengthX(tag: TagIdentifier, to: number, sketch: Sketch) -> number
angleToMatchLengthX(
tag: TagIdentifier,
to: number,
sketch: Sketch,
): number
```
@ -17,13 +21,13 @@ angleToMatchLengthX(tag: TagIdentifier, to: number, sketch: Sketch) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| `to` | `number` | | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| `to` | [`number`](/docs/kcl/types/number) | | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

View File

@ -9,7 +9,11 @@ Returns the angle to match the given length for y.
```js
angleToMatchLengthY(tag: TagIdentifier, to: number, sketch: Sketch) -> number
angleToMatchLengthY(
tag: TagIdentifier,
to: number,
sketch: Sketch,
): number
```
@ -17,13 +21,13 @@ angleToMatchLengthY(tag: TagIdentifier, to: number, sketch: Sketch) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| `to` | `number` | | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| `to` | [`number`](/docs/kcl/types/number) | | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -36,7 +40,7 @@ sketch001 = startSketchOn('XZ')
angle = angleToMatchLengthY(seg01, 15, %),
length = 5
}, %)
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
extrusion = extrude(sketch001, length = 5)

View File

@ -1,15 +1,19 @@
---
title: "angledLine"
excerpt: "Draw a line segment relative to the current origin using the polar"
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
angledLine(
data: AngledLineData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,23 +22,23 @@ angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
| 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> yLineTo(15, %)
|> yLine(endAbsolute = 15)
|> angledLine({ angle = 30, length = 15 }, %)
|> line(end = [8, -10])
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
example = extrude(exampleSketch, length = 10)

View File

@ -1,15 +1,19 @@
---
title: "angledLineOfXLength"
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'x' dimension."
layout: manual
---
Create a line segment from the current 2-dimensional sketch origin
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'x' dimension.
along some angle (in degrees) for some relative length in the 'x' dimension.
```js
angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
angledLineOfXLength(
data: AngledLineData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -
| 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
sketch001 = startSketchOn('XZ')
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLineOfXLength({ angle = 45, length = 10 }, %, $edge1)
|> angledLineOfXLength({ angle = -15, length = 20 }, %, $edge2)

View File

@ -1,15 +1,19 @@
---
title: "angledLineOfYLength"
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'y' dimension."
layout: manual
---
Create a line segment from the current 2-dimensional sketch origin
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some relative length in the 'y' dimension.
along some angle (in degrees) for some relative length in the 'y' dimension.
```js
angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
angledLineOfYLength(
data: AngledLineData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -
| 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [10, 0])
|> angledLineOfYLength({ angle = 45, length = 10 }, %)

View File

@ -1,15 +1,19 @@
---
title: "angledLineThatIntersects"
excerpt: "Draw an angled line from the current origin, constructing a line segment"
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
angledLineThatIntersects(
data: AngledLineThatIntersectsData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag
| 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [5, 10])
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)

View File

@ -1,15 +1,19 @@
---
title: "angledLineToX"
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension."
layout: manual
---
Create a line segment from the current 2-dimensional sketch origin
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension.
along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension.
```js
angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
angledLineToX(
data: AngledLineToData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLineToX({ angle = 30, to = 10 }, %)
|> line(end = [0, 10])

View File

@ -1,15 +1,19 @@
---
title: "angledLineToY"
excerpt: "Create a line segment from the current 2-dimensional sketch origin"
excerpt: "Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension."
layout: manual
---
Create a line segment from the current 2-dimensional sketch origin
Create a line segment from the current 2-dimensional sketch origin along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension.
along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension.
```js
angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
angledLineToY(
data: AngledLineToData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLineToY({ angle = 60, to = 20 }, %)
|> line(end = [-20, 0])

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,11 @@ The arc is constructed such that the current position of the sketch is placed al
Unless this makes a lot of sense and feels like what you're looking for to construct your shape, you're likely looking for tangentialArc.
```js
arc(data: ArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
arc(
data: ArcData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -20,18 +24,18 @@ arc(data: ArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`ArcData`](/docs/kcl/types/ArcData) | Data to draw an arc. | 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [10, 0])
|> arc({

View File

@ -1,15 +1,19 @@
---
title: "arcTo"
excerpt: "Draw a 3 point arc."
excerpt: "Draw a three point arc."
layout: manual
---
Draw a 3 point arc.
Draw a three point arc.
The arc is constructed such that the start point is the current position of the sketch and two more points defined as the end and interior point. The interior point is placed between the start point and end point. The radius of the arc will be controlled by how far the interior point is placed from the start and end.
```js
arcTo(data: ArcToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
arcTo(
data: ArcToData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ arcTo(data: ArcToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`ArcToData`](/docs/kcl/types/ArcToData) | Data to draw a three point arc (arcTo). | 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> arcTo({ end = [10, 0], interior = [5, 5] }, %)
|> close()

View File

@ -9,7 +9,7 @@ Compute the arcsine of a number (in radians).
```js
asin(num: number) -> number
asin(num: number): number
```
### Tags
@ -21,11 +21,11 @@ asin(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
angle = toDegrees(asin(0.5)),
length = 20
}, %)
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)

View File

@ -1,15 +1,18 @@
---
title: "assert"
excerpt: "Check a value at runtime, and raise an error if the argument provided"
excerpt: "Check a value at runtime, and raise an error if the argument provided is false."
layout: manual
---
Check a value at runtime, and raise an error if the argument provided
Check a value at runtime, and raise an error if the argument provided is false.
is false.
```js
assert(data: bool, message: string) -> ()
assert(
data: bool,
message: string,
): ()
```
@ -17,8 +20,8 @@ assert(data: bool, message: string) -> ()
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | `bool` | | Yes |
| `message` | `string` | | Yes |
| `data` | [`bool`](/docs/kcl/types/bool) | | Yes |
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
### Returns

View File

@ -1,15 +1,20 @@
---
title: "assertEqual"
excerpt: "Check that a numerical value equals another at runtime,"
excerpt: "Check that a numerical value equals another at runtime, otherwise raise an error."
layout: manual
---
Check that a numerical value equals another at runtime,
Check that a numerical value equals another at runtime, otherwise raise an error.
otherwise raise an error.
```js
assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
assertEqual(
left: number,
right: number,
epsilon: number,
message: string,
): ()
```
@ -17,10 +22,10 @@ assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `left` | `number` | | Yes |
| `right` | `number` | | Yes |
| `epsilon` | `number` | | Yes |
| `message` | `string` | | Yes |
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
| `epsilon` | [`number`](/docs/kcl/types/number) | | Yes |
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
### Returns

View File

@ -1,15 +1,19 @@
---
title: "assertGreaterThan"
excerpt: "Check that a numerical value is greater than another at runtime,"
excerpt: "Check that a numerical value is greater than another at runtime, otherwise raise an error."
layout: manual
---
Check that a numerical value is greater than another at runtime,
Check that a numerical value is greater than another at runtime, otherwise raise an error.
otherwise raise an error.
```js
assertGreaterThan(left: number, right: number, message: string) -> ()
assertGreaterThan(
left: number,
right: number,
message: string,
): ()
```
@ -17,9 +21,9 @@ assertGreaterThan(left: number, right: number, message: string) -> ()
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `left` | `number` | | Yes |
| `right` | `number` | | Yes |
| `message` | `string` | | Yes |
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
### Returns

View File

@ -1,15 +1,19 @@
---
title: "assertGreaterThanOrEq"
excerpt: "Check that a numerical value is greater than or equal to another at runtime,"
excerpt: "Check that a numerical value is greater than or equal to another at runtime, otherwise raise an error."
layout: manual
---
Check that a numerical value is greater than or equal to another at runtime,
Check that a numerical value is greater than or equal to another at runtime, otherwise raise an error.
otherwise raise an error.
```js
assertGreaterThanOrEq(left: number, right: number, message: string) -> ()
assertGreaterThanOrEq(
left: number,
right: number,
message: string,
): ()
```
@ -17,9 +21,9 @@ assertGreaterThanOrEq(left: number, right: number, message: string) -> ()
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `left` | `number` | | Yes |
| `right` | `number` | | Yes |
| `message` | `string` | | Yes |
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
### Returns

View File

@ -1,15 +1,19 @@
---
title: "assertLessThan"
excerpt: "Check that a numerical value is less than to another at runtime,"
excerpt: "Check that a numerical value is less than to another at runtime, otherwise raise an error."
layout: manual
---
Check that a numerical value is less than to another at runtime,
Check that a numerical value is less than to another at runtime, otherwise raise an error.
otherwise raise an error.
```js
assertLessThan(left: number, right: number, message: string) -> ()
assertLessThan(
left: number,
right: number,
message: string,
): ()
```
@ -17,9 +21,9 @@ assertLessThan(left: number, right: number, message: string) -> ()
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `left` | `number` | | Yes |
| `right` | `number` | | Yes |
| `message` | `string` | | Yes |
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
### Returns

View File

@ -1,15 +1,19 @@
---
title: "assertLessThanOrEq"
excerpt: "Check that a numerical value is less than or equal to another at runtime,"
excerpt: "Check that a numerical value is less than or equal to another at runtime, otherwise raise an error."
layout: manual
---
Check that a numerical value is less than or equal to another at runtime,
Check that a numerical value is less than or equal to another at runtime, otherwise raise an error.
otherwise raise an error.
```js
assertLessThanOrEq(left: number, right: number, message: string) -> ()
assertLessThanOrEq(
left: number,
right: number,
message: string,
): ()
```
@ -17,9 +21,9 @@ assertLessThanOrEq(left: number, right: number, message: string) -> ()
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `left` | `number` | | Yes |
| `right` | `number` | | Yes |
| `message` | `string` | | Yes |
| `left` | [`number`](/docs/kcl/types/number) | | Yes |
| `right` | [`number`](/docs/kcl/types/number) | | Yes |
| `message` | [`string`](/docs/kcl/types/string) | | Yes |
### Returns

View File

@ -9,7 +9,7 @@ Compute the arctangent of a number (in radians).
```js
atan(num: number) -> number
atan(num: number): number
```
### Tags
@ -21,11 +21,11 @@ atan(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -37,7 +37,7 @@ sketch001 = startSketchOn('XZ')
angle = toDegrees(atan(1.25)),
length = 20
}, %)
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)

View File

@ -9,7 +9,10 @@ Compute the four quadrant arctangent of Y and X (in radians).
```js
atan2(y: number, x: number) -> number
atan2(
y: number,
x: number,
): number
```
### Tags
@ -21,12 +24,12 @@ atan2(y: number, x: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `y` | `number` | | Yes |
| `x` | `number` | | Yes |
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -38,7 +41,7 @@ sketch001 = startSketchOn('XZ')
angle = toDegrees(atan2(1.25, 2)),
length = 20
}, %)
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)

View File

@ -1,15 +1,19 @@
---
title: "bezierCurve"
excerpt: "Draw a smooth, continuous, curved line segment from the current origin to"
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
bezierCurve(
data: BezierData,
sketch: Sketch,
tag?: TagDeclarator,
): Sketch
```
@ -18,18 +22,18 @@ bezierCurve(data: BezierData, sketch: Sketch, tag?: TagDeclarator) -> Sketch
| 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/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XZ')
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> bezierCurve({

View File

@ -9,7 +9,7 @@ Compute the smallest integer greater than or equal to a number.
```js
ceil(num: number) -> number
ceil(num: number): number
```
### Tags
@ -21,11 +21,11 @@ ceil(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10])
|> line(end = [ceil(7.02986), 0])
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)

File diff suppressed because one or more lines are too long

View File

@ -1,15 +1,20 @@
---
title: "circle"
excerpt: "Construct a 2-dimensional circle, of the specified radius, centered at"
excerpt: "Construct a 2-dimensional circle, of the specified radius, centered at the provided (x, y) origin point."
layout: manual
---
Construct a 2-dimensional circle, of the specified radius, centered at
Construct a 2-dimensional circle, of the specified radius, centered at the provided (x, y) origin point.
the provided (x, y) origin point.
```js
circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
circle(
sketchOrSurface: SketchOrSurface,
center: [number],
radius: number,
tag?: TagDeclarator,
): Sketch
```
@ -17,20 +22,21 @@ circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDecl
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes |
| `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
| `sketchOrSurface` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
| `center` | [`[number]`](/docs/kcl/types/number) | The center of the circle. | Yes |
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the circle. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this circle | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn("-XZ")
|> circle({ center = [0, 0], radius = 10 }, %)
|> circle(center = [0, 0], radius = 10)
example = extrude(exampleSketch, length = 5)
```
@ -44,7 +50,7 @@ exampleSketch = startSketchOn("XZ")
|> line(end = [0, 30])
|> line(end = [-30, 0])
|> close()
|> hole(circle({ center = [0, 15], radius = 5 }, %), %)
|> hole(circle(center = [0, 15], radius = 5), %)
example = extrude(exampleSketch, length = 5)
```

View File

@ -9,7 +9,13 @@ Construct a circle derived from 3 points.
```js
circleThreePoint(p1: [number], p2: [number], p3: [number], sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch
circleThreePoint(
p1: [number],
p2: [number],
p3: [number],
sketchSurfaceOrGroup: SketchOrSurface,
tag?: TagDeclarator,
): Sketch
```
@ -17,15 +23,15 @@ circleThreePoint(p1: [number], p2: [number], p3: [number], sketch_surface_or_gro
| 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 |
| `p1` | [`[number]`](/docs/kcl/types/number) | 1st point to derive the circle. | Yes |
| `p2` | [`[number]`](/docs/kcl/types/number) | 2nd point to derive the circle. | Yes |
| `p3` | [`[number]`](/docs/kcl/types/number) | 3rd point to derive the circle. | Yes |
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `0.39
We merely provide these functions for convenience and readability, as `10 * cm()` is more readable that your intent is "I want 10 centimeters" than `10 * 10`, if the project settings are in millimeters.
```js
cm() -> number
cm(): number
```
### Tags
@ -26,7 +26,7 @@ cm() -> number
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
---
title: "QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
QUARTER_TURN: number(deg) = 90deg
```

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
---
title: "THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
THREE_QUARTER_TURN: number(deg) = 270deg
```

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::HALF_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::HALF_TURN: number(deg) = 180deg
```

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::QUARTER_TURN: number(deg) = 90deg
```

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::prelude::THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -1,15 +0,0 @@
---
title: "std::prelude::ZERO"
excerpt: ""
layout: manual
---
```js
std::prelude::ZERO: number = 0
```

25
docs/kcl/consts.md Normal file
View File

@ -0,0 +1,25 @@
---
title: "KCL Constants"
excerpt: "Documentation for the KCL constants."
layout: manual
---
## Table of Contents
### `std`
- [`HALF_TURN`](/docs/kcl/consts/std-HALF_TURN)
- [`QUARTER_TURN`](/docs/kcl/consts/std-QUARTER_TURN)
- [`THREE_QUARTER_TURN`](/docs/kcl/consts/std-THREE_QUARTER_TURN)
- [`XY`](/docs/kcl/consts/std-XY)
- [`XZ`](/docs/kcl/consts/std-XZ)
- [`YZ`](/docs/kcl/consts/std-YZ)
- [`ZERO`](/docs/kcl/consts/std-ZERO)
### `std::math`
- [`E`](/docs/kcl/consts/std-math-E)
- [`PI`](/docs/kcl/consts/std-math-PI)
- [`TAU`](/docs/kcl/consts/std-math-TAU)

View File

@ -0,0 +1,15 @@
---
title: "std::HALF_TURN"
excerpt: ""
layout: manual
---
```js
std::HALF_TURN: number(deg) = 180deg
```

View File

@ -0,0 +1,15 @@
---
title: "std::QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::QUARTER_TURN: number(deg) = 90deg
```

View File

@ -0,0 +1,15 @@
---
title: "std::THREE_QUARTER_TURN"
excerpt: ""
layout: manual
---
```js
std::THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -1,5 +1,5 @@
---
title: "ZERO"
title: "std::XY"
excerpt: ""
layout: manual
---
@ -9,7 +9,7 @@ layout: manual
```js
ZERO: number = 0
std::XY
```

View File

@ -1,5 +1,5 @@
---
title: "ZERO"
title: "std::XZ"
excerpt: ""
layout: manual
---
@ -9,7 +9,7 @@ layout: manual
```js
ZERO: number = 0
std::XZ
```

View File

@ -1,5 +1,5 @@
---
title: "HALF_TURN"
title: "std::YZ"
excerpt: ""
layout: manual
---
@ -9,7 +9,7 @@ layout: manual
```js
HALF_TURN: number(deg) = 180deg
std::YZ
```

View File

@ -1,5 +1,5 @@
---
title: "HALF_TURN"
title: "std::ZERO"
excerpt: ""
layout: manual
---
@ -9,7 +9,7 @@ layout: manual
```js
HALF_TURN: number(deg) = 180deg
std::ZERO: number = 0
```

View File

@ -21,7 +21,7 @@ exampleSketch = startSketchOn("XZ")
angle = 30,
length = 2 * E ^ 2,
}, %)
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
example = extrude(exampleSketch, length = 10)

View File

@ -18,7 +18,7 @@ std::math::PI: number = 3.14159265358979323846264338327950288_
circumference = 70
exampleSketch = startSketchOn("XZ")
|> circle({ center = [0, 0], radius = circumference/ (2 * PI) }, %)
|> circle(center = [0, 0], radius = circumference/ (2 * PI))
example = extrude(exampleSketch, length = 5)
```

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@ Return the value of Eulers number `e`.
**DEPRECATED** use the constant E
```js
e() -> number
e(): number
```
### Tags
@ -22,7 +22,7 @@ e() -> number
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -31,7 +31,7 @@ e() -> number
exampleSketch = startSketchOn("XZ")
|> startProfileAt([0, 0], %)
|> angledLine({ angle = 30, length = 2 * e() ^ 2 }, %)
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
example = extrude(exampleSketch, length = 10)

View File

@ -1,15 +1,18 @@
---
title: "extrude"
excerpt: "Extend a 2-dimensional sketch through a third dimension in order to"
excerpt: "Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid."
layout: manual
---
Extend a 2-dimensional sketch through a third dimension in order to
Extend a 2-dimensional sketch through a third dimension in order to create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
create new 3-dimensional volume, or if extruded into an existing volume, cut into an existing solid.
You can provide more than one sketch to extrude, and they will all be extruded in the same direction.
```js
extrude(sketch_set: SketchSet, length: number) -> SolidSet
extrude(
sketchSet: SketchSet,
length: number,
): SolidSet
```
@ -17,8 +20,8 @@ extrude(sketch_set: SketchSet, length: number) -> SolidSet
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketch_set` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketches should be extruded | Yes |
| `length` | `number` | How far to extrude the given sketches | Yes |
| `sketchSet` | [`SketchSet`](/docs/kcl/types/SketchSet) | Which sketch or set of sketches should be extruded | Yes |
| `length` | [`number`](/docs/kcl/types/number) | How far to extrude the given sketches | Yes |
### Returns

View File

@ -9,7 +9,13 @@ Blend a transitional edge along a tagged path, smoothing the sharp edge.
Fillet is similar in function and use to a chamfer, except a chamfer will cut a sharp transition along an edge while fillet will smoothly blend the transition.
```js
fillet(solid: Solid, radius: number, tags: [EdgeReference], tolerance?: number, tag?: TagDeclarator) -> Solid
fillet(
solid: Solid,
radius: number,
tags: [EdgeReference],
tolerance?: number,
tag?: TagDeclarator,
): Solid
```
@ -18,14 +24,14 @@ fillet(solid: Solid, radius: number, tags: [EdgeReference], tolerance?: number,
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be filletted | Yes |
| `radius` | `number` | The radius of the fillet | Yes |
| `radius` | [`number`](/docs/kcl/types/number) | The radius of the fillet | Yes |
| `tags` | [`[EdgeReference]`](/docs/kcl/types/EdgeReference) | The paths you want to fillet | Yes |
| `tolerance` | `number` | The tolerance for this fillet | No |
| `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this fillet | No |
| `tolerance` | [`number`](/docs/kcl/types/number) | The tolerance for this fillet | No |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this fillet | No |
### Returns
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid)
### Examples

View File

@ -9,7 +9,7 @@ Compute the largest integer less than or equal to a number.
```js
floor(num: number) -> number
floor(num: number): number
```
### Tags
@ -21,11 +21,11 @@ floor(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -35,7 +35,7 @@ sketch001 = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10])
|> line(end = [floor(7.02986), 0])
|> yLineTo(0, %)
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)

View File

@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `12`.
We merely provide these functions for convenience and readability, as `10 * ft()` is more readable that your intent is "I want 10 feet" than `10 * 304.8`, if the project settings are in millimeters.
```js
ft() -> number
ft(): number
```
### Tags
@ -26,7 +26,7 @@ ft() -> number
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

View File

@ -9,7 +9,7 @@ Get the next adjacent edge to the edge given.
```js
getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
getNextAdjacentEdge(tag: TagIdentifier): Uuid
```
@ -17,7 +17,7 @@ getNextAdjacentEdge(tag: TagIdentifier) -> Uuid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
### Returns

View File

@ -9,7 +9,7 @@ Get the opposite edge to the edge given.
```js
getOppositeEdge(tag: TagIdentifier) -> Uuid
getOppositeEdge(tag: TagIdentifier): Uuid
```
@ -17,7 +17,7 @@ getOppositeEdge(tag: TagIdentifier) -> Uuid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
### Returns

View File

@ -9,7 +9,7 @@ Get the previous adjacent edge to the edge given.
```js
getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
getPreviousAdjacentEdge(tag: TagIdentifier): Uuid
```
@ -17,7 +17,7 @@ getPreviousAdjacentEdge(tag: TagIdentifier) -> Uuid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `tag` | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagIdentifier`](/docs/kcl/types#tag-identifier) | | Yes |
### Returns

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,10 @@ Create a helix on a cylinder.
```js
helixRevolutions(data: HelixRevolutionsData, solid: Solid) -> Solid
helixRevolutions(
data: HelixRevolutionsData,
solid: Solid,
): Solid
```
@ -18,18 +21,18 @@ helixRevolutions(data: HelixRevolutionsData, solid: Solid) -> Solid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`HelixRevolutionsData`](/docs/kcl/types/HelixRevolutionsData) | Data for helix revolutions. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | | Yes |
### Returns
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid)
### Examples
```js
part001 = startSketchOn('XY')
|> circle({ center = [5, 5], radius = 10 }, %)
|> circle(center = [5, 5], radius = 10)
|> extrude(length = 10)
|> helixRevolutions({
angleStart = 0,

View File

@ -9,7 +9,10 @@ Use a 2-dimensional sketch to cut a hole in another 2-dimensional sketch.
```js
hole(hole_sketch: SketchSet, sketch: Sketch) -> Sketch
hole(
holeSketch: SketchSet,
sketch: Sketch,
): Sketch
```
@ -17,25 +20,25 @@ hole(hole_sketch: SketchSet, sketch: Sketch) -> Sketch
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `hole_sketch` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes |
| `holeSketch` | [`SketchSet`](/docs/kcl/types/SketchSet) | A sketch or a group of sketches. | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
### Returns
[`Sketch`](/docs/kcl/types/Sketch) - A sketch is a collection of paths.
[`Sketch`](/docs/kcl/types/Sketch)
### Examples
```js
exampleSketch = startSketchOn('XY')
exampleSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 5])
|> line(end = [5, 0])
|> line(end = [0, -5])
|> close()
|> hole(circle({ center = [1, 1], radius = .25 }, %), %)
|> hole(circle({ center = [1, 4], radius = .25 }, %), %)
|> hole(circle(center = [1, 1], radius = .25), %)
|> hole(circle(center = [1, 4], radius = .25), %)
example = extrude(exampleSketch, length = 1)
```
@ -44,7 +47,7 @@ example = extrude(exampleSketch, length = 1)
```js
fn squareHoleSketch() {
squareSketch = startSketchOn('-XZ')
squareSketch = startSketchOn(-XZ)
|> startProfileAt([-1, -1], %)
|> line(end = [2, 0])
|> line(end = [0, 2])
@ -53,8 +56,8 @@ fn squareHoleSketch() {
return squareSketch
}
exampleSketch = startSketchOn('-XZ')
|> circle({ center = [0, 0], radius = 3 }, %)
exampleSketch = startSketchOn(-XZ)
|> circle(center = [0, 0], radius = 3)
|> hole(squareHoleSketch(), %)
example = extrude(exampleSketch, length = 1)
```

View File

@ -9,7 +9,10 @@ Make the inside of a 3D object hollow.
Remove volume from a 3-dimensional shape such that a wall of the provided thickness remains around the exterior of the shape.
```js
hollow(thickness: number, solid: Solid) -> Solid
hollow(
thickness: number,
solid: Solid,
): Solid
```
@ -17,12 +20,12 @@ hollow(thickness: number, solid: Solid) -> Solid
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `thickness` | `number` | | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | A solid is a collection of extrude surfaces. | Yes |
| `thickness` | [`number`](/docs/kcl/types/number) | | Yes |
| `solid` | [`Solid`](/docs/kcl/types/Solid) | | Yes |
### Returns
[`Solid`](/docs/kcl/types/Solid) - A solid is a collection of extrude surfaces.
[`Solid`](/docs/kcl/types/Solid)
### Examples
@ -67,17 +70,11 @@ case = startSketchOn('-XZ')
|> extrude(length = 65)
thing1 = startSketchOn(case, 'end')
|> circle({
center = [-size / 2, -size / 2],
radius = 25
}, %)
|> circle(center = [-size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
thing2 = startSketchOn(case, 'end')
|> circle({
center = [size / 2, -size / 2],
radius = 25
}, %)
|> circle(center = [size / 2, -size / 2], radius = 25)
|> extrude(length = 50)
hollow(0.5, case)

View File

@ -15,7 +15,10 @@ For formats lacking unit data (such as STL, OBJ, or PLY files), the default unit
Note: The import command currently only works when using the native Modeling App.
```js
import(file_path: String, options?: ImportFormat) -> ImportedGeometry
import(
filePath: String,
options?: ImportFormat,
): ImportedGeometry
```
@ -23,7 +26,7 @@ import(file_path: String, options?: ImportFormat) -> ImportedGeometry
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `file_path` | `String` | | Yes |
| `filePath` | `String` | | Yes |
| `options` | [`ImportFormat`](/docs/kcl/types/ImportFormat) | Import format specifier | No |
### Returns

View File

@ -15,7 +15,7 @@ For example, if the current project uses inches, this function will return `1`.
We merely provide these functions for convenience and readability, as `10 * inch()` is more readable that your intent is "I want 10 inches" than `10 * 25.4`, if the project settings are in millimeters.
```js
inch() -> number
inch(): number
```
### Tags
@ -26,7 +26,7 @@ inch() -> number
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

View File

@ -6,10 +6,32 @@ layout: manual
## Table of Contents
* [Types](kcl/types)
* [Modules](kcl/modules)
* [Known Issues](kcl/KNOWN-ISSUES)
* **`std`**
### Language
* [`Types`](kcl/types)
* [`Modules`](kcl/modules)
* [`Settings`](kcl/settings)
* [`Known Issues`](kcl/known-issues)
* [`Constants`](kcl/consts)
### Standard library
* **Primitive types**
* [`bool`](kcl/types/bool)
* [`number`](kcl/types/number)
* [`string`](kcl/types/string)
* [`tag`](kcl/types/tag)
* **std**
* [`HALF_TURN`](kcl/consts/std-HALF_TURN)
* [`Plane`](kcl/types/Plane)
* [`QUARTER_TURN`](kcl/consts/std-QUARTER_TURN)
* [`Sketch`](kcl/types/Sketch)
* [`Solid`](kcl/types/Solid)
* [`THREE_QUARTER_TURN`](kcl/consts/std-THREE_QUARTER_TURN)
* [`XY`](kcl/consts/std-XY)
* [`XZ`](kcl/consts/std-XZ)
* [`YZ`](kcl/consts/std-YZ)
* [`ZERO`](kcl/consts/std-ZERO)
* [`abs`](kcl/abs)
* [`acos`](kcl/acos)
* [`angleToMatchLengthX`](kcl/angleToMatchLengthX)
@ -86,7 +108,9 @@ layout: manual
* [`reduce`](kcl/reduce)
* [`rem`](kcl/rem)
* [`revolve`](kcl/revolve)
* [`rotate`](kcl/rotate)
* [`round`](kcl/round)
* [`scale`](kcl/scale)
* [`segAng`](kcl/segAng)
* [`segEnd`](kcl/segEnd)
* [`segEndX`](kcl/segEndX)
@ -106,20 +130,14 @@ layout: manual
* [`tangentialArcToRelative`](kcl/tangentialArcToRelative)
* [`toDegrees`](kcl/toDegrees)
* [`toRadians`](kcl/toRadians)
* [`translate`](kcl/translate)
* [`xLine`](kcl/xLine)
* [`xLineTo`](kcl/xLineTo)
* [`yLine`](kcl/yLine)
* [`yLineTo`](kcl/yLineTo)
* [`yd`](kcl/yd)
* **`std::math`**
* [`E`](kcl/const_std-math-E)
* [`PI`](kcl/const_std-math-PI)
* [`TAU`](kcl/const_std-math-TAU)
* **std::math**
* [`E`](kcl/consts/std-math-E)
* [`PI`](kcl/consts/std-math-PI)
* [`TAU`](kcl/consts/std-math-TAU)
* [`cos`](kcl/std-math-cos)
* [`sin`](kcl/std-math-sin)
* [`tan`](kcl/std-math-tan)
* **`std::prelude`**
* [`HALF_TURN`](kcl/const_std-prelude-HALF_TURN)
* [`QUARTER_TURN`](kcl/const_std-prelude-QUARTER_TURN)
* [`THREE_QUARTER_TURN`](kcl/const_std-prelude-THREE_QUARTER_TURN)
* [`ZERO`](kcl/const_std-prelude-ZERO)

View File

@ -11,7 +11,7 @@ Convert a number to an integer.
DEPRECATED use floor(), ceil(), or round().
```js
int(num: number) -> number
int(num: number): number
```
### Tags
@ -23,11 +23,11 @@ int(num: number) -> number
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | `number` | | Yes |
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples
@ -37,7 +37,7 @@ n = int(ceil(5 / 2))
assertEqual(n, 3, 0.0001, "5/2 = 2.5, rounded up makes 3")
// Draw n cylinders.
startSketchOn('XZ')
|> circle({ center = [0, 0], radius = 2 }, %)
|> circle(center = [0, 0], radius = 2)
|> extrude(length = 5)
|> patternTransform(
instances = n,

View File

@ -13,9 +13,7 @@ once fixed in engine will just start working here with no language changes.
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. You also cannot
currently move or transform the imported objects at all, once we have assemblies
this will work.
you cannot edit it, after v1, the engine will account for this.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
cases work currently.

View File

@ -1,15 +1,15 @@
---
title: "lastSegX"
excerpt: "Extract the 'x' axis value of the last line segment in the provided 2-d"
excerpt: "Extract the 'x' axis value of the last line segment in the provided 2-d sketch."
layout: manual
---
Extract the 'x' axis value of the last line segment in the provided 2-d
Extract the 'x' axis value of the last line segment in the provided 2-d sketch.
sketch.
```js
lastSegX(sketch: Sketch) -> number
lastSegX(sketch: Sketch): number
```
@ -21,7 +21,7 @@ lastSegX(sketch: Sketch) -> number
### Returns
`number`
[`number`](/docs/kcl/types/number)
### Examples

Some files were not shown because too many files have changed in this diff Show More