Compare commits

...

417 Commits

Author SHA1 Message Date
5599a75dbd make sure sketch can be exited (#6862) 2025-05-12 11:30:31 +00:00
3a06ae6e34 fix sketch on offset plane animations (#6858)
* fix sketch on offset plane animations

* trigger CI
2025-05-12 07:28:09 -04:00
22857d77e9 Fix bug with undo startSketchOn removing existing sketch (#6834)
* Fix bug with `undo startSketchOn` removing existing sketch

Fixes #6822, I believe. in this case the `variableName` was not being
marked as in-use, so I just logged out the AST and made sure this case
was covered. @Irev-Dev this is probably worth a check from you.

* Add a regression test

It's an E2E test because I'm being lazy, but it should probably be an
XState unit test at some point.

* check what's checked

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-05-12 16:55:39 +10:00
1a325d0b29 Fix to use correct units for array range expressions (#6837)
* Fix to use correct units for array range expressions

* Update output
2025-05-12 01:30:33 -04:00
1240b23080 Don't truncate extrude arg docs (#6854)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-12 16:48:30 +12:00
8445080d7a Some improvements to math::sqrt (#6853)
* Treat number as any rather than default

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

* Don't square root negative numbers

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-12 16:47:01 +12:00
bbe89f56a7 Fix the KCL any type and array coercion incorrectly nesting (#6816)
* Add sim test for any type

* Fix doc comments to match code

* Add array ascription tests

* Commit new test output

* Fix to not panic when type is undefined

* Fix to not panic on use of the any type

* Update test and generated output

* Fix error message after rebase

* Fix subtype of any

* Fix KCL to use new keyword args

* Fix to not nest MixedArray in HomArray

* Update output

* Remove all creation of MixedArray and use HomArray instead

* Rename MixedArray to Tuple

* Fix to coerce arrays the way tuples are done

* Restructure to appease the type signature extraction

* Fix TS unit test

* Update output after switch to HomArray

* Update docs

* Fix to remove edge case when creating points

* Update docs with broken point signature

* Fix display of tuples to not collide with arrays

* Change push to an array with type mismatch to be an error

* Add sim test for push type error

* Fix acription to more general array element type

* Fix to coerce point types

* Change array push to not error when item type differs

* Fix coercion tests

* Change to only flatten as a last resort and remove flattening tuples

* Contort code to appease doc generation

* Update docs

* Fix coerce axes

* Fix flattening test to test arrays instead of tuples

* Remove special subtype case for singleton coercion
2025-05-12 03:57:31 +00:00
86e8bcfe0b fix the null app explosion (#6851)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-12 03:51:13 +00:00
21ccf129d6 Accept type ascription within binary expressions (#6849)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-12 14:07:57 +12:00
dfc4b7d0c5 Non-fatal error on using && or || (#6845)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-12 13:46:17 +12:00
17b1120a27 Include metadata environment variables with results (#6838)
* Include metadata environment variables with results

* Share updated report after uploading each shard

* Hide raw curl progress
2025-05-11 21:40:11 -04:00
2b509a515b More docs for Plane, Pi, etc. (#6850)
* Document the units of PI

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

* Add links between lang and std references

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

* Change signature of conversion functions

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

* Split foreign imports out of modules docs

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

* More docs for Plane

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

* Update docs/kcl-std/consts/std-math-PI.md

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Update rust/kcl-lib/std/math.kcl

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-12 12:59:45 +12:00
97594b9a9e Proper type-checking where a function requires a tag identifier not just a tag (#6848)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-12 12:57:50 +12:00
c65190a158 Extend warning message to selection step in prompt-to-edit (#6840)
* Extend warning messages to all args in ML commands

* Only when it works actually

* Add warningMessage to selection mixed input
2025-05-11 17:03:58 -04:00
0621e1a53e Docs content (#6792)
* Add documentation to modules, and some constants and types

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

* Improve the language reference

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-11 19:32:33 +12:00
f36b69f4f0 Source range for pipe value used as unlabelled arg (#6787)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-11 17:43:12 +12:00
92f7a62af2 Create JUnit reports from Rust tests (#6743) 2025-05-11 00:49:55 -04:00
f73831ac27 more subtract regression tests (#6831)
updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-10 19:23:55 -04:00
09f39499e9 add subtract regression tests (#6829)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-10 13:48:38 -07:00
7ac4a9507b fix unwrap (#6825)
* fix unwrap

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

* add test

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

* updates

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

* udaptes

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-10 13:00:14 -07:00
3956958452 Force idle stream to 5min and hide setting (#6810)
* Hide "Allow orbit in sketch mode" setting from the app

The ability to orbit while in sketch mode is not well-tested or
well-used, so we should pull it from the app. The easiest way to do that
is leave the setting in the WASM definition, but configure the setting
to be uneditable from the interface.

* pierremtb/adhoc/force-idle-stream-and-hide

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-05-10 15:54:58 -04:00
0fe866ad8b Update utility sink sample (#6798)
* upadte utility sink sample

* remove old screenshot
2025-05-10 19:52:55 +00:00
cca498be04 Fix ENOENT error when opening the app with a path on Linux (#6813)
* Fix ENOENT error when opening the app with a path on Linux
Fixes #6796

* Clean up
2025-05-10 15:46:30 -04:00
max
039cb38d56 Fix deletion of unassigned standalone edge treatments (#6815)
* oops, make it nicer for no reason

* tests

* deleteTopLevelStatement

* little swap

* astMod edits

* typos

* add playwright test for chamfers

* scene.settled instead of page.waitForTimeout

* unfuck circular dep - move locateExtrudeDeclarator

* locateExtrudeDeclarator > locateVariableWithCallOrPipe

* fmt

* edit the comment
2025-05-10 16:53:05 +00:00
4fb7065ddf Fix sign error. (#6821)
* Fix sign error.

* Update kcl-samples simulation test output

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-10 08:45:05 -07:00
39f512d32d profile start constrain overlays (#6795)
* constrain profile start

* add test

* make sure it works on segment drag too, fix tests

* remove old log

* some tests fixes

* Bump more segment counters

* Two more fixes

* Two more test fixes

* small test fix

* moretest fixes

* another test

---------

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-10 12:29:41 +10:00
85469f2d7d Hide "Allow orbit in sketch mode" setting from the app (#6803)
The ability to orbit while in sketch mode is not well-tested or
well-used, so we should pull it from the app. The easiest way to do that
is leave the setting in the WASM definition, but configure the setting
to be uneditable from the interface.
2025-05-09 22:58:28 +00:00
3e24e2c9e8 Enable hotkeys for toolbar items within dropdowns (#6765)
* Remove gnarly fake union hotkeys

* Enable hotkey for items buried in ActionButtonDropdown

I'm kinda over `useHotkeys` as a hook

* Add hotkeys for other sketch tools

* Fix lint and tsc

* Fix duplicate locator

* The circular dependecies got reordered somehow

* Update src/lib/toolbar.ts
2025-05-09 22:56:11 +00:00
2d9f6c7b2a Fix rendered image in subtract CSG sim test (#6812) 2025-05-09 22:27:27 +00:00
7d6427ab64 Add cursor-not-allowed to onboarding backdrops that block clicks (#6789)
* Add `cursor-not-allowed` to onboarding backdrops that block clicks

Some follow-up feedback after #6714 from @jacebrowning, so that users
know why they can't click around.

* Make anything in the onboarding card `cursor-auto`
2025-05-09 13:28:45 -04:00
4abbe0d57a Result of npm prune (#6807)
pierremtb/adhoc/npm-prune
2025-05-09 17:07:06 +00:00
a631ff689f Remove unnecessary checks for execution completion from onboarding test (#6804)
We don't care if the axial fan loads under 15s on a cheap CI machine, at
least not in this test.
2025-05-09 17:01:42 +00:00
e1d401adfe Remove snapshottoken variable and playwright-secrets.env file (#6801)
* Remove snapshottoken
Fixes #6800

* Add placeholder in .env.development

* Clean up language

* Update CONTRIBUTING.md

Co-authored-by: Jace Browning <jacebrowning@gmail.com>

* Add dotenv to secrets for local testing

* Lint

* Reorg things

* Quick fix

* Last one for windows

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-05-09 12:32:35 -04:00
6f49c88382 Remove dev.zoo.dev from contributing (#6799) 2025-05-09 10:20:22 -04:00
374d07b995 Turn on Billing UI in releases (#6788)
* Turn on Billing UI in releases

* Update most snapshots but one, and new masks
2025-05-09 09:04:45 -04:00
3481252082 fix subtract test (#6791)
* fix subtract test

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

* fix subtract test

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

* fixups

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-08 20:28:41 -07:00
035f3b6aed Update known-issues.md (#6790) 2025-05-09 03:21:25 +00:00
923feadfa5 Suggest a list of possible arg labels when an argument is unlabelled (#6755)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-09 14:28:04 +12:00
1ea66d6f23 [Fix]: Always show stack trace on the page if an Error shows up (#6785)
* fix: show stack traces

* fix: update GH with report a bug
2025-05-08 21:17:34 -05:00
3b7b4f85a1 Update onboarding to V1 browser and desktop flows (#6714)
* Remove unused `telemetryLoader`

* Remove onboarding redirect behavior

* Allow subRoute to be passed to navigateToProject

* Replace warning dialog routes with toasts

* Wire up new utilities and toasts to UI components

* Add home sidebar buttons for tutorial flow

* Rename menu item

* Add flex-1 so home-layout fills available space

* Remove onboarding avatar tests, they are becoming irrelevant

* Consolidate onboarding tests to one longer one

and update it to not use pixel color checks, and use fixtures.

* Shorten warning toast button text

* tsc, lint, and circular deps

* Update circular dep file

* Fix mistakes made in circular update tweaking

* One more dumb created circular dep

* Update src/routes/Onboarding/utils.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Fix narrow screen home layout breaking

* fix: kevin, navigation routes fixed

* fix: filename parsing is correct now for onboarding with the last file sep

* Fix e2e test state checks that are diff on Linux

* Create onboarding project entirely through systemIOMachine

* Fix Windows path construction

* Make utility to verify a string is an onboarding value

* Little biome formatting suggestion fix

* Units onboarding step was not using OnboardingButtons

* Add type checking of next and previous status, fix useNextClick

* Update `OnboardingStatus` type on WASM side

* Make onboarding different on browser and web, placeholder component

* Show proof of concept with custom content per route

* Make text type args not insta dismiss when you click anywhere

* Make some utility hooks for the onboarding

* Update requestedProjectName along with requestedProjectName

* Build out a rough draft of desktop onboarding

* Remove unused onboarding route files

* Build out rough draft of browser onboarding content

* @jgomez720 browser flow feedback

* @jgomez420 desktop feedback

* tsc and lints

* Tweaks

* Import is dead, long live Add files

* What's up with my inability to type "highlight"?

* Codespell and String casting

* Update browser sample to be axial fan

* lint and tsc

* codespell again

* Remove unused nightmare function `useDemoCode`

* Add a few unit tests

* Update desktop to use bulk file creation from #6747

* Oops overwrote main.kcl on the modify with text-to-cad step

* Undo the dumb use of `sep` that I introduced

* Fix up project test

which was fragile to the number of steps in the onboarding smh

* Fix up onboarding flow test

* typo

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
2025-05-09 00:37:21 +00:00
9853353512 Update text-to-cad experimental label (#6786)
update text-to-cad label
2025-05-08 22:06:01 +00:00
7b8585f3c3 Add @web tag to new web-only tests for later CI use (#6784)
pierremtb/adhoc/add-web-tag-for-later
2025-05-08 17:58:05 -04:00
fc3ce4cda8 Release KCL 68 (#6783) 2025-05-08 20:41:26 +00:00
a7f5c56ba1 Error on "Open in desktop" click if URL is too long on Windows (#6768)
* pierremtb/issue6200-toast-error-if-windows-and-length-over-2046

* Add test for web
2025-05-08 16:22:36 -04:00
max
c8747bd55a Extend point-and-click edit flow to non-pipe Chamfer and Fillet (#6767)
* enable non-piped fillets and chamfers

* reorder chamferAstMod

* tsc

* editEdgeTreatment + refactor + hookup

* remove unused stuff

* test

* typos

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* else else else

* Apply suggestions from code review

pierre edits

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>

* const

* parameterName

* fmt

* efficiency !

* graphite being helpful

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-05-08 20:16:36 +00:00
e2fd3948f5 [Feature] Create assembly samples from home page (#6747)
* fix: how?

* fix: 0 byte thumbnail png loading bug

* fix: adding navigate to single file back

* fix: cargo fmt

* fix: sorting files to match manifest and unit test

* fix: restoring back to main

* fix: cargo fmt

* fix: ope, I forgot I deleted some code that renamed single files to the samples name to track easier within the file tree

* fix: ope

* Update src/lib/commandBarConfigs/applicationCommandConfig.ts

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

* fix: unique name for project, ope

* fix: filtered samples for web and skeleton create a sample command

* fix: Create A Sample specifically desktop home page instead of overloading the add to file

* fix: hiding source

* fix: gotcha on add to file with existing project default args and assemblies

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-05-08 19:41:29 +00:00
e960d4d8a4 BREAKING: Change array functions to call user function with keyword args (#6779)
* Change array functions to call user function with keyword args

* Fix KCL to use keyword params

* Remove unneeded positional call code

* Update docs

* Update output
2025-05-08 19:10:47 +00:00
1ccf8d4dd4 Change display of mixed array to be clear what it is (#6757) 2025-05-08 14:47:15 -04:00
b65ea8e0a9 Change pattern functions to call user function with keyword args (#6772)
* Change pattern functions to call user function with keyword args

* Fix KCL code to use unlabeled syntax

* Update generated output
2025-05-08 13:43:50 -05:00
90cb26c6d9 Fix just lint to check all targets (#6777) 2025-05-08 11:28:33 -07:00
max
3562076b83 Removes "fillets cannot touch" warning message (#6771)
rm warningMessage
2025-05-08 20:11:01 +02:00
6230747b51 Remove test that can never run in our current setup (#6774)
Remove test that can never run with our current setup
2025-05-08 17:02:41 +00:00
479179dd9b #6734 Clean up unused code (#6736)
* remove unused code in modelingMachine

* remove unused actions in featureTreeMachine

* video.pause is not async

* remove unused param in Toolbar

* remove unused rectangleOrigin from getRectangleCallExpressions

* fmt

* parseProjectRoute is not async anymore

* prefix unused params with underscore

* insertNewStartProfileAt/sketchEntryNodePath param is not used

* remove unused constraintType parameter from getRemoveConstraintsTransform

* underscore unused params

* remove unused scale param in segment.ts

* remove unused for in sceneInfra

* remove unused sketchEntryNodePath from sceneEntitiesManager methods

* remove unused shouldTearDown param

* remove unused planeNodePath param from setup draft methods

* remove unused ast param
2025-05-08 06:58:30 -04:00
67f9dba77b #6686 Fix Unable to double click to edit sketch with specific set of actions (#6766)
* Canceling sketch mode into 'undo startSketchOn' should work from all sketch states, not just in Line

* add test
2025-05-08 05:50:25 -04:00
89c345649d dont bust cache on external file change (#6756)
* dont bust cache on external file change

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

* dont bust cache on external file change

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

* dont bust cache on external file change

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

* add to the comment

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-08 05:33:32 -04:00
0550eef701 Fix the settings docs links (#6763)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-08 16:35:11 +12:00
1c21198499 Fix trackball camera by weaving through EngineStream (#6760)
* Fix trackball camera by weaving through EngineStream

Fixes #6472. Just a missing setting moved in #5312, which wasn't caught
because testing that the orbit maneuver is actually performing a
"trackball-like" movement is nonexistent. I don't know how to test that
reliably, but typing this object provides the red squiggles to reveal
the missing property.

* Update src/components/EngineStream.tsx

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-05-07 23:43:08 -04:00
8ac232414d Truncate "text" arg value summaries by default (#6754)
Splitting out some work I had in #6254 that wasn't directly related to
onboarding into its own tiny PR.
2025-05-07 22:22:04 -04:00
91e306f447 Release KCL 67 (#6751)
Breaking changes:

 - Fully removed positional arguments from function calls. Keyword arguments are now the only way to call a function.

Added:

 - Warn on usage of the unknown numeric suffix (#6690)

Fixed:

 - Fix units bug with involuteCircular (#6711)
 - Importing 3D files on Windows (#6697)
2025-05-07 17:54:45 -07:00
f01957edc7 Docs: Links and desciptions for number types (#6752)
Links and desciptions for number types

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-07 16:05:57 -07:00
e9f6ebb6d1 Bump modeling cmds (#6746)
* fixes

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

* bump modeling-cmds

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-05-07 21:10:18 +00:00
2fee3a424c More docs fixes (#6733)
* Fix various docs errors around std module

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

* remove KCL from lang docs titles and move settings docs

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

* Include functions declared in Rust in module docs

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-08 08:26:56 +12:00
43d5a72514 Migrate Text-to-CAD (edit) to multi-file endpoint (#6066)
* start of migrate to multi file endpoint

* get some relative path stuff sorted

* blobifying files, and making selections work with imports working

* add write to disk

* warn about big projects

* update known circular

* update snapshot

* remove log

* tweak selection filters

* Update src/components/ModelingMachineProvider.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* fmt

* fix one thing

* typo

* raw dog form data like a fucking peasant

* remove fake data

* fmt

* steal Kevin's stuff

* good progress

* clean up

* fix writing to files when response returns

* comment the terriable code

* push fix of sorts

* better fix

* spot of clean up

* fix: Needed to support the bad request flow, the toast will hang forever, the return control flows don't dismiss a forever toast

* fix: handling more error flows by dismissing the toast

* chore: leaving a comment for a confusing workflow

* fix: trying to clean up some async logic

* fix: trying to fix a few things at once...

* fix: fixing toast success

* fix: how did this desync?

* fix: removing useless logic, we write to disk ahead of time, the continue is to say ya no problem

* fix: typo

* Change back to `spawnChild`, forego `actors` by reference

* fix: updating PR comments

* fix: found a bug with paths from rust! it is actually OS paths!

* fix: updated type still is failing tsc

* fix: the type of the machine was wrong, we always set it to at least ''

* fix: idk man

* Fix happy path test (button labels)

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-05-07 17:54:40 +00:00
f938364d54 Better, faster typo checker (#6716)
* Fix typo 'horizonal'

* Fix typos

* Fix more typos

* Fix more typos

* Update CI action

* Fix typos

* Update src/lang/queryAst.test.ts

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

* Update src/lang/queryAst.test.ts

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

* Update typos

* Update snap

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-05-07 12:48:23 -05:00
998dbdc6ff Fix: thumbnail.png would not be created in a few scenarios, the commandType wasn't populated in some workflows. (#6744)
* fix: moving screenshot logic to after KCL runtime. More robust

* fix: removing toast debugging

* fix: cleaning up the old logic
2025-05-07 12:47:35 -05:00
2b3dfaf023 wip: request (and store) debug data in the connection (#6698)
Add in new Debug stubs to the connection
2025-05-07 12:10:40 -04:00
f8a33a63ac Make 'npm run test:rust' work out-of-the-box (#6721)
* Make 'npm run test:rust' work out-of-the-box

* Simplify instructions and remove stale

* Update to use correct value from the documentation

See https://doc.rust-lang.org/std/backtrace/index.html
2025-05-07 15:35:49 +00:00
af50422544 Small touch up to default planes suffix (#6738)
pierremtb/adhoc/planes-suffix-touchup
2025-05-07 15:28:32 +00:00
6e21c486e8 Remove fixme on foreign import assembly test (#6735)
pierremtb/adhoc/remove-fixme-foreign-import-test
2025-05-07 09:56:03 -04:00
c6ee10cd50 Put XY back into default plane feature tree (#6731)
* put xy back into default plane feature tree

* color code

* Update src/components/ModelingSidebar/ModelingPanes/FeatureTreePane.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-07 14:02:52 +10:00
6170319428 Nuke the billing poller (#6732) 2025-05-07 03:29:17 +00:00
e373d285fe test the wasm side (#6726)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-07 03:04:34 +00:00
17c326e654 fix sketch on boolean test (#6730) 2025-05-07 11:49:53 +10:00
b0b1198d2e Reducing polling interval (#6729)
5s is way too fast, let's try 60s.
2025-05-07 01:24:12 +00:00
134ec63610 Add subtitle to docs and fix primitive type links (#6724)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 15:33:23 -07:00
cc904d258b Fix just command to update samples PNG files in screenshots dir (#6725)
* Fix just command to update samples PNG files in screenshots dir

* Update output
2025-05-06 22:26:44 +00:00
d187a29e55 Fix sketchOnFace point&click for booleans (#6713)
* fix bool sketchOnFace

* fix chamfer test

* add test

* Kurt composite attempt (#6722)

* composite attempt

* Add forward edge to CSG artifacts in artifact graph

* Fix comment

* Move the doc comments above the attributes

* Fix to update the correct field of Path

* Update output

---------

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

* use rust defined composite solid edges instead

* Update src/hooks/useEngineConnectionSubscriptions.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Revert PNG screenshots

* Fix TS formatting

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-05-07 08:25:12 +10:00
996517f5c4 Multi-profile sweeps and more robust edit flows in point-and-click (#6437) 2025-05-06 17:57:27 -04:00
8fb1563f2d Billing UI (Nightly & Dev only) and Jest component unit testing (#6640)
A bajillion commits hi

* all the shit i'll git reset origin/main && git add -p . later

* fmt

* wip

* fmt

* rebase; fmt; tsc; lint;

* fmt

* Add jest tests

* fmt

* ok

* add nightly checks

* More is_nightly checks

* be happy codespell

* Make vitest ignore my shit

* nightly OR debug; try vitest fixing again

* Add this back

* fix

* Update src/components/LowerRightControls.tsx

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

* Update src/components/LowerRightControls.tsx

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

* Update src/components/LowerRightControls.tsx

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

* Update src/components/BillingDialog.tsx

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

* Update tailwind.config.js

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

* Update tailwind.config.js

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

* Update src/components/BillingRemaining.tsx

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

* Update src/components/BillingRemaining.tsx

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

* Update src/components/CustomIcon.tsx

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

* Update src/components/CustomIcon.tsx

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

* Update src/components/CustomIcon.tsx

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

* Update src/components/CustomIcon.tsx

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

* Update src/components/BillingRemaining.tsx

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

* Update src/components/BillingRemaining.tsx

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

* fixes

* tid bits

* Fix tests

* color

* Update src/components/BillingRemaining.tsx

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

* fix someone else's problem

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-05-06 15:07:22 -04:00
7b0ea5078c Fix tsc (#6717)
fix tsc
2025-05-06 15:06:47 -04:00
a04f7e9923 6458 Browser text-to-CAD should overwrite project and zoom to fit new model (#6626)
change 'Copy To Clipboard' -> 'Replace current file' for textToCAD in browser
2025-05-06 20:17:46 +02:00
e356cd34e3 6442 "Zoom to fit" when kcl file is shared on web (#6619)
* submit zoom_to_fit when kcl file is created on web

* add test for zoom to fit on shared model on web - only works with a hack so far

* resolve circular deps

* fix Zoom to fit to shared model on web, test still not passing without timeout

* Clean up zoom_to_fit for web sharing, stabilize test

* fmt

* small import refactor

* fmt

* Make Zoom to fit test web-only
2025-05-06 19:13:11 +02:00
941eacd559 [BUG]: split('/') caused bug on windows (#6697)
* fix: trying to figure out this pathing issue

* fix: found the bug

* fix: adding linter rule

* fix: rule for join('/') as well

* fix: removing useless string template

* fix: removing useless string template

* fix: ???? What ????

* fix: remove unused import

* fix: circular dep was added when I cleaned up the path logic, fixed the circular dep by passing args from the parent function
2025-05-06 16:48:45 +00:00
e06a09ed42 Fix "Cannot read properties of undefined (reading '0')" error (#6715)
pierremtb/adhoc/cannot-read-properties-undefined-0-on-hover
2025-05-06 12:06:10 -04:00
9fcc792b7e Update codespell ignore (#6702)
Adds these ignored dirs:

- ./test-results
- ./playwright-report
- ./kcl-book/book
2025-05-06 13:12:23 +00:00
1841e63021 Misc docs polishing (#6712)
* Fake modules for Rust std lib functions

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

* Include the missing @ in Rust std lib fns

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

* Move revolve and mirror2d to better modules

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

* Use docs from KCL mods for type summaries

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

* Use type docs to describe types from KCL std lib

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 16:09:59 +12:00
1e056cfd8a Display numeric units in the variables pane (#6683) 2025-05-06 03:40:18 +00:00
32db31e6c3 Increase cargo test retries (#6704) 2025-05-06 03:15:02 +00:00
9c246d6621 Fix units bug with involuteCircular (#6711)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 14:58:53 +12:00
9c52f5b19a Add tags to Rust std lib functions (#6701)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 14:14:11 +12:00
0464de33b1 Update the docs script (#6709)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 01:41:24 +00:00
1ed6bb8a7c change to no longer parallel for edges (#6705)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-06 01:06:20 +00:00
8f72920764 Fix app settings location not changing betwen nightly and release (#6656)
App settings location is not changing betwen nightly and release
Fixes #6655
2025-05-05 19:23:34 -04:00
574d6dae7f Add modules to docs (#6699)
* Support modules in docs

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

* shuffle around directories

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 11:02:55 +12:00
cf2e9d4b91 Add kclVersion as a field of the setting attribute (#6689)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-06 08:44:03 +12:00
7ab879a94f Show "experimental" badges around ML functionality (#6648)
* Make "experimental" a valid status for toolbar and commands

* Wire up status through createMachineCommand

* Add beaker icon

* Show UI elements if status is experimental

* Make ML operations experimental, powered by a flag

* Update command descriptions

* Add tooltip to home page Text-to-CAD button

* Splelnig erorrs

* 🧹lints

* Oopsie daisy Add KCL file isn't experimental

* Add warning message element to text area arg input

* Update message to common named constant
2025-05-05 15:36:22 +00:00
21da3c6482 allow var rename with tool equipped (#6693) 2025-05-05 08:13:13 -04:00
5f836358c0 Warn on usage of the unknown numeric suffix (#6690)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-05 13:17:55 +12:00
f407762259 Remove unused build scripts (#6673) 2025-05-03 12:07:54 -04:00
dea20861a0 Fix subtract2d icon in the Feature Tree (#6682) 2025-05-03 07:07:46 -04:00
bc818f10c3 Remove last remnants of legacy positional call (#6678)
* Remove last remnants of legacy positional call

* Update docs

* Fix segAng()

* Fix more docs

* Update docs again
2025-05-02 20:07:31 -05:00
19f5031ef7 Release KCL 66 (#6679)
Breaking changes:

 - All functions (even functions defined by users) must use keyword arguments, not positional arguments
2025-05-02 21:55:58 +00:00
b71eb4fb89 Simplify some test code (#6669) 2025-05-02 21:39:20 +00:00
c327c73087 Catch import scene selection on transforms and point to the feature tree (#6674)
* Catch import scene selection on transforms and point to the feature tree
Fixes #6667

* Add test for toast on clone, bringing back forgotten test
2025-05-02 17:25:33 -04:00
4fe8741ea7 Remove CallExpression support (#6639)
Users MUST use keyword call syntax now.

Closes https://github.com/KittyCAD/modeling-app/issues/4600
2025-05-02 16:08:12 -05:00
75916d4300 Fix resetting onboarding from settings in web after #6564 (#6675)
Fix resetting onboarding in web after #6564

Oversight on my part while refactoring the onboarding system in #6564.
The new centralized `acceptOnboarding` workflow constructs a relative
path, so we have to get out of the settings before invoking it.
2025-05-02 16:48:38 -04:00
e65a6b6a38 Remove reminder message in import (#6668)
Fixes #6666
2025-05-02 19:58:06 +00:00
86a83cadd3 Make onboarding optional, able to be ignored on desktop (take 2) (#6628)
* Remove unused `telemetryLoader`

* Remove onboarding redirect behavior

* Allow subRoute to be passed to navigateToProject

* Replace warning dialog routes with toasts

* Wire up new utilities and toasts to UI components

* Add home sidebar buttons for tutorial flow

* Rename menu item

* Add flex-1 so home-layout fills available space

* Remove onboarding avatar tests, they are becoming irrelevant

* Consolidate onboarding tests to one longer one

and update it to not use pixel color checks, and use fixtures.

* Shorten warning toast button text

* tsc, lint, and circular deps

* Update circular dep file

* Fix mistakes made in circular update tweaking

* One more dumb created circular dep

* Update src/routes/Onboarding/utils.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Fix narrow screen home layout breaking

* fix: kevin, navigation routes fixed

* fix: filename parsing is correct now for onboarding with the last file sep

* Fix e2e test state checks that are diff on Linux

* Create onboarding project entirely through systemIOMachine

* Fix Windows path construction

* Make utility to verify a string is an onboarding value

* Little biome formatting suggestion fix

* Units onboarding step was not using OnboardingButtons

* Add type checking of next and previous status, fix useNextClick

* Thanks Graphite Diamond, I should use that new util

* Remove TODO comment

* Fix botched merge because IS_PLAYWRIGHT moved or something

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
2025-05-02 15:54:49 -04:00
00553c34ab Enable Boolean op deletion from the feature tree (#6637)
* Can't Delete Union From Feature Tree
Fixes #6584. Works locally but the new tests don't appear to work yet

* Change tests to right-click > Delete
2025-05-02 15:34:21 -04:00
ace9a59a45 fix cache and imports (#6647)
* updates

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

* fix clippy

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-02 17:41:14 +00:00
09ebb517d9 Fix link to types.md in docs (#6653)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-02 09:06:43 -07:00
1c697d30ee Fix to not add extra spaces when formatting call (#6652) 2025-05-02 08:16:07 -05:00
c2dd4d1d2e Same hotkey for center rect and center circle (#6642)
Removed hotkey on center rectangle, seems less common than corner rectangle. Happy to be chalenged. Fixes #6634.
2025-05-02 04:59:33 -04:00
6866c9d418 Fix bad links in docs code blocks (#6649)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-02 16:00:27 +12:00
819ee23565 Fix to cache correct PathToNode in artifact graph (#6632)
* Add NodePath to artifact graph

Since this is cached, this should make PathToNode computation correct
even when code is formatted, whitespace changes, and source ranges
are different.

* Remove dead code

* Add unit tests

* Add tests for PathToNode conversion

* Remove unused parameter

* Add missing PathToNode cases

* Fix to handle unlabeled arg

* Cherry pick unlabeled arg fix

* Change PathToNode comment to match TS implementation
2025-05-01 23:55:12 -04:00
02a37e207f Rust ci uses dev (#6643)
* point rust tests at dev too

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

* point python tests at dev

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-02 00:13:16 +00:00
7356af556a add million lint in dev mode (#6162)
add million lint

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-05-01 22:35:55 +00:00
88288c3979 Fix layout shift on home page, fix narrow screen layout (#6631)
* Fix layout shift on home page, fix narrow screen layout

* LINTS
2025-05-01 21:41:13 +00:00
763b05e2e6 Fix the generate docs action (#6638)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-01 21:28:47 +00:00
39351aed58 Wrong case in no-projects copy on homepage (#6636)
Fixes #6635
2025-05-01 18:51:12 +00:00
e8e7c22b95 #6457 Disable sharing for multi-file AST (#6583)
* disable ShareButton if AST uses import statement

* remove unused code

* add e2e test for ShareButton disabled in multi-file projects
2025-05-01 14:01:08 -04:00
ad975152c1 Update readme logo (#6573)
* pierremtb/adhoc/readme-logo-update

* Change to just cropping
2025-05-01 13:43:09 -04:00
ed406734a7 [Feature]: Initialize engine with view_isometric as a user. (#6604)
* feature: initialize system to view_isometric, playwright(e2e) does zoom_to_fit

* fix: PR fixes

* fix: removing testing code

* fix: I definitely bricked my .spacemacs config and it is using the wrong eslint when I save files :(

* fix: typo

* fix: typoos

* fix: fuking hack

* chore: move exported var from e2e to src then reimport

* fix: got em

* fix: remove console log

* fix: how did this get in that file?? moved it

* fix: location for scene empty check zzz:

* fix: removed debugging code

* fix: forgot the hack for the load view without geometry workflow

* fix: copy
2025-05-01 13:42:44 -04:00
89bae66257 KCL: User-defined KCL functions in examples etc now use keywords (#6603)
Preparing for the removal of positional functions from the language. The first big step is to change all our KCL code examples, test code, public samples etc to all use keyword functions.

Apologies for how large this PR is. Most of it is:

- Changing example KCL that defined its own functions, so the functions now use keyword arguments rather than positional arguments. E.g. change `cube([20, 20])` to be `cube(center = [20, 20])`.
- Some parts of the code assumed positional code and didn't handle keyword calls, e.g. the linter would only check for positional calls to startSketchOn. Now they should work with either positional or keyword.
- Update all the artifacts

This does _not_ remove support for positional calls. That will be in a follow-up PR.
2025-05-01 12:36:51 -04:00
16f5d9c284 Docs improvements (#6615)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-05-01 08:56:27 -07:00
00148d84d8 Ignore the new Debug message (#6627)
Ignore the new Debug message
2025-05-01 08:55:52 -07:00
390cedf79f Update dependabot config (#6616)
Update dependabot config from KittyCAD/ciso
2025-05-01 15:32:02 +02:00
b686c79b49 More lsp endpoints we were missing (#6612)
* add prepare rename

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

* add document color

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-05-01 02:47:36 +00:00
2d77aa0d36 Revert "Make onboarding optional, able to be ignored on desktop" (#6610)
Revert "Make onboarding optional, able to be ignored on desktop (#6564)"

This reverts commit 820082d7f2.
2025-04-30 21:58:11 -04:00
012102fe86 enhance the signature help (#6606)
update with test

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-30 20:58:46 +00:00
1a6b147107 Fix to not double import math in the prelude (#6605) 2025-04-30 19:49:55 +00:00
2978b34b7b Skip TAB-disabled tests locally by default (#6601) 2025-04-30 15:32:37 -04:00
dee77e814a remove rust bw compatible settings (#6085)
regenerate the settings docs



cleanup

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-30 19:00:37 +00:00
820082d7f2 Make onboarding optional, able to be ignored on desktop (#6564)
* Remove unused `telemetryLoader`

* Remove onboarding redirect behavior

* Allow subRoute to be passed to navigateToProject

* Replace warning dialog routes with toasts

* Wire up new utilities and toasts to UI components

* Add home sidebar buttons for tutorial flow

* Rename menu item

* Add flex-1 so home-layout fills available space

* Remove onboarding avatar tests, they are becoming irrelevant

* Consolidate onboarding tests to one longer one

and update it to not use pixel color checks, and use fixtures.

* Shorten warning toast button text

* tsc, lint, and circular deps

* Update circular dep file

* Fix mistakes made in circular update tweaking

* One more dumb created circular dep

* Update src/routes/Onboarding/utils.tsx

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Fix narrow screen home layout breaking

* fix: kevin, navigation routes fixed

* fix: filename parsing is correct now for onboarding with the last file sep

* Fix e2e test state checks that are diff on Linux

* Create onboarding project entirely through systemIOMachine

* Fix Windows path construction

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Kevin Nadro <kevin@zoo.dev>
2025-04-30 14:43:51 -04:00
525f213f1d Assemblies: Make Clone available in releases (#6538)
* Assemblies: Make Clone available in releases
Fixes #6537

* Lint
2025-04-30 14:10:52 -04:00
58a81da039 Update Insert, Transform, and Clone codemods to match new import behavior (#6577)
* Fix operations to reflect concurrent module import behavior

* Add new generated output

* Fix root module import tracking

* Rename test so that it's easier to filter

* Update output ops

* Fix clippy

* Update output after rebase

* Update multi-axis-robot flowchart output

* Disable e2e tests until future PR

* WIP: Update Insert and Transform codemods to match new import behavior
Fixes #6570

* Fix operations to reflect concurrent module import behavior

* Add new generated output

* Fix root module import tracking

* Rename test so that it's easier to filter

* Update output ops

* Fix clippy

* Update output after rebase

* Disable e2e tests until future PR

* Update one of the tests

* Somewhat working very ugly translate

* Working translate and rotate

* Fix deletion

* Clean up things and disable tests deleting the *first* import due to unclear issue

* Fix Clone

* Clean up ahead of review

* Support cases with translate and rotate in two different pipes (but not for deletion)

* Fix generated output; probably from recent merge

* Find all pipes and look for last in most cases, adding fallbacks to set translate/rotate on the right ones

* More fixups

* Delete unused snap file

* Update src/lang/queryAst.ts

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

* Change lint ignore to be more specific

* Add test that checks we can still translate, rotate, and delete weird import code

* Clean up

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-30 13:07:39 -04:00
0002295cdf Fix operations to reflect concurrent module import behavior (#6568)
* Fix operations to reflect concurrent module import behavior

* Add new generated output

* Fix root module import tracking

* Rename test so that it's easier to filter

* Update output ops

* Fix clippy

* Update output after rebase

* Disable e2e tests until future PR

* Fix generated output; probably from recent merge

* Delete unused snap file
2025-04-30 16:26:46 +00:00
c050739f41 Some improvements to the boxed signatures in the docs (#6593)
* Show a more reasonable name in function docs

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

* Fix buggy docs for union types

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

* Make types in the docs signatures into links

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-30 16:03:22 +00:00
ccd5b0272d Add math functions back to the prelude (#6595)
* Add math functions back to the prelude

* Update output

* Update docs
2025-04-30 11:07:05 -04:00
f1fdf48834 tidy up modeling diagram (#6594)
* neaten modeling diagram

* moar
2025-04-30 10:10:30 +02:00
bae875382c Replace plane strings with literals (#6592)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-30 05:13:11 +00:00
14ce66bcc1 Fix to have stable sorting for end cap artifacts (#6589)
* Fix to have stable sorting for end cap artifacts

* Update output
2025-04-30 04:34:35 +00:00
644c561815 Declare std::math in KCL (BREAKING) (#6588)
Declare std::math in KCL

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-30 03:59:19 +00:00
5f31f3a6b3 Lint suggestion variables on non-camelCase (#6590)
* initial

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-04-30 15:41:40 +12:00
a0afe9dd0e bump kcl and friends in prep for release (#6591)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-30 15:39:13 +12:00
9c29756a38 lint default planes and add a suggestion (#6587)
lint default planes and other plane cleanup

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-30 02:11:02 +00:00
bf63b21d74 [BUG] circle and threePointArc and other overlay fixes (#6409)
* fix length constrainting

* conflicet

* fix circle center constraints

* fix up circle remove constraints more and add test

* fix three point arc overlays and add test for it

* fixes

* console log

* fix tangential arc stuff

* fmt

* fix unit test

* fix console error when selectiong arc
2025-04-30 02:08:45 +00:00
0ea0d1703e Remove deprecated syntax (#6561)
* Remove deprecated syntax

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

* fix one test

* fix sketch on revolved face test

* fix test: empty-scene default-planes act as expected

* fix up more tests

* another fix

* remove another const

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
2025-04-30 13:12:40 +12:00
29b8a442c2 Codemirror lsp enhance (#6580)
* codemirror side

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

* codemirror actions

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

* codemirror actions

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

* code mirror now shows lint suggestions

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

* fix hanging params with test

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

* updates for signature help

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

* fix clone

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

* add tests

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

* add tests

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

* clippy

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

* clippy

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

* updates

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

* Update packages/codemirror-lsp-client/src/plugin/lsp.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* z-index

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

* playwright tests

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: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-04-29 20:57:02 -04:00
844f229b5a Remove trig functions from prelude and change their unit handling (BREAKING) (#6565)
Remove trig functions from prelude and change their unit handling

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-30 12:40:11 +12:00
fa51b4bbbc Post-kwargs cleanup (#6571)
* Remove dead code
* Stop creating CallExpression and instead create CallExpressionKw
2025-04-29 16:05:45 -05:00
1fa6e1eccc Name shards consistently (#6582) 2025-04-29 16:39:08 -04:00
44b810ee0a Partition nextest runs (#6574)
* Partition nextest runs

* move name back to 'cargo test'

* Fix duplicate name

There were two jobs both named `build-test-artifacts`. Changed the latter
to `run-test-artifacts`

* cd into rust/ before running nextest

* Get token when running the tests

* Try getting archive into correct dir via different method

* Bump shards to 6

* Replace llvm-cov with nextest

* Adjust job name

* Remove unnecessary comments

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-04-29 16:28:13 -04:00
a9998be176 Remove unneeded derive Deserialize (#6579)
This revealed that one of our variants is never constructed.
2025-04-29 12:17:41 -07:00
5e200aebcc [Feature]: Load external model becomes Add file to project, global application add file to project with home page update. (#6506)
* chore: saving off skeleton

* fix: saving skeleton

* chore: skeleton for loading projects from project directory path

* chore: cleaning up useless state transition to be an on event direct to action state

* fix: new structure for web vs desktop vs react machine provider code

* chore: saving off skeleton

* fix: skeleton logic for react? going to move it from a string to obj.string

* fix: trying to prevent error element unmount on global react components. This is bricking JS state

* fix: we are so back

* chore: implemented navigating to specfic KCL file

* chore: implementing renaming project

* chore: deleting project

* fix: auto fixes

* fix: old debug/testing file oops

* chore: generic create new file

* chore: skeleton for web create file provide

* chore: basic machine vitest... need to figure out how to get window.electron implemented in vitest?

* chore: save off progress before deleting other project implementation, a few missing features still

* chore: trying a different init skeleton? most likely will migrate

* chore: first attempt of purging projects context provider

* chore: enabling toast for some machine state

* chore: enabling more toast success and error

* chore: writing read write state to the system io based on the project path

* fix: tsc fixes

* fix: use file system watcher, navigate to project after creation via the requestProjectName

* chore: open project command, hooks vs snapshot context helpers

* chore: implemented open and create project for e2e testing. They are hard coded in poor spot for now.

* fix: codespell fixes

* chore: implementing more project commands

* chore: PR improvements for root.tsx

* chore: leaving comment about new Router.tsx layout

* fix: removing debugging code

* fix: rewriting component for readability

* fix: improving web initialization

* chore: implementing import file from url which is not actually that?

* fix: clearing search params on import file from url

* fix: fixed two e2e tests, forgot needsReview when making new command

* fix: fixing some import from url business logic to pass e2e tests

* chore: script for diffing circular deps +/-

* fix: formatting

* fix: massive fix for circular depsga!

* fix: trying to fix some errors and auto fmt

* fix: updating deps

* fix: removing debugging code

* fix: big clean up

* fix: more deletion

* fix: tsc cleanup

* fix: TSC TSC TSC TSC!

* fix: typo fix

* fix: clear query params on web only, desktop not required

* fix: removing unused code

* fmt

* Bring back `trap` removed in merge

* Use explicit types instead of `any`s on arg configs

* Add project commands directly to command palette

* fix: deleting debugging code, from PR review

* fix: this got added back(?)

* fix: using referred type

* fix: more PR clean up

* fix: big block comment for xstate architecture decision

* fix: more pr comment fixes

* fix: saving off logic, need a big cleanup because I hacked it together to get a POC

* fix: extra business?

* fix: merge conflict just added them back why dude

* fix: more PR comments

* fix: big ciruclar deps fix, commandBarActor in appActor

* chore: writing e2e test, still need to fix 3 bugs

* chore: adding more scenarios

* fix: formatting

* fix: fixing tsc errors

* chore: deleting the old text to cad and using the new application level one, almost there

* fix: prompt to edit works

* fix: large push to get 1 text to cad command... the usage is a little buggy with delete and navigate within /file

* fix: settings for highlight edges now works

* chore: adding another e2e test

* fix: cleaning up e2e tests and writing more of them

* fix: tsc type

* chore: more e2e improvements, unique project name  in text to cad

* chore: e2e tests should be good to go

* fix: gotcha comment

* fix: enabled web t2c, codespell fixes

* fix: fixing merge conflcits??

* feat: implemented load external for kcl samples

* feat: load external model from disk

* fix: trying to delete old stuff

* fix: all command trigger locations now have defaults for current project

* fix: gotcha comment for the future

* chore: hiding import file from url command, two separate commands for 3d and kcl file adding

* chore: commands are now add file to project, 3rd iteration

* fix: t2c in file menu fixed

* chore: updating file menu for new global actions

* fix: auto fixes

* fix: the command bar arg flow for web add kcl file seems backwards?

* chore: updated home layout, added create from kcl sample button

* chore: remapping some menu actions

* fix: fixing open dialog copy

* fix: an e2e test

* fix: fixed e2e tests

* fix: fixed e2e tests

* fix: auto fixes

* fix: pr clean up

* fix: removing console log

* fix: PR updates

* fix: the reviewed stage boolean required the expected state to change. Also I progressed the command bar too soon

* fix: no idea how this passed locally yesterday? I removed the {dir} unused but I need the function's logic but not the return value...

* fix: should be good to go?

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-29 13:04:45 -05:00
e0cd3efc64 fix edge cuts & clone (#6572)
* fix edge cuts & clone

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

* updates

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

* fix edge_id

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

* code comemnt

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-29 16:51:52 +00:00
77e3efde9a Deterministic parallelized snaps (#6527)
* initial pass

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>

changes

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

more updates

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

more updates

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

serde variant name

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>

some sort

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

some sort

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

some sort

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

some sort

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

some sort

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

some sort

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

some sort

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

some sort

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

some sort

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

some sort

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>

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>

sort the edges

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

fixes

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

u[dates

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

u[dates

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>

cleanups

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>

add bs-to-kcl

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>

* updates

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>

* updates

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-29 13:38:52 +00:00
a173a82d59 Remove skips to align with new way of opting-in tests (#6560) 2025-04-29 08:50:19 -04:00
4d2bc18c2f Fix lint after #6558 (#6562) 2025-04-29 15:23:50 +10:00
aca5fdb521 Remove some deprecated functions from std (#6531)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-28 20:24:18 -04:00
8867258e47 Notify TAB API to share a summary report on PRs (#6544)
* Notify TAB API to share a summary report on PRs

* wip: break a test

* Revert "wip: break a test"

This reverts commit 80c3793cbd.
2025-04-28 19:30:42 -04:00
f6cb725268 [bug]: Chokidar + reading projects spams multiple times (#6558)
fix: do not double or triple load reading folders from disk due to file system watcher when deleting
2025-04-28 19:15:20 -04:00
1bd570ceb9 Remove unnecessary docs (#6559)
These aren't used anymore
2025-04-28 22:42:01 +00:00
1c87298b44 Migrate more functions to use kwargs (#6551)
These little helper functions (legAng, segLen etc) were already using keyword arguments, but when the frontend created AST nodes, it was creating them as CallExpression not CallExpressionKw. We have backwards-compatibility so it's fine, but we should not be relying on that anymore.

This PR should not have any user-observable change.
2025-04-28 22:21:37 +00:00
3a23ec1bee Create std::units module (#6528)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-29 08:41:31 +12:00
d96a4d3337 Improvements to axis handling (#6530)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-29 08:29:22 +12:00
94452cce88 ability to set suggestions on lints (#6535)
* fix the lint tests which were not compiling

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

* updates

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

* apply sugggestions for offsetplanes

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

* updates

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

* diagnostics and suggestions for offset planes

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-29 07:07:10 +12:00
2e754f2a11 BREAKING: Change to disallow indexing KCL records/objects with strings (#6529)
* Change to disallow indexing records/objects with strings

* Update output

* Remove outdated sim test

* Fix tests
2025-04-28 12:08:47 -04:00
719136937e #4852 Add test for delete line segments in sketch mode using keyboard (#6543)
* wip hack to delete line segments

* unrelated: clean up console

* better check if current selection is segment before deletion

* lint

* add test for delete segment with key
2025-04-28 11:32:55 -04:00
e207552255 Home: Update read blog icon to glasses (#6541) 2025-04-28 14:47:15 +00:00
1835e49191 Remove docs for deleted KCL functions (#6540)
These functions were removed as part of our big 1.0 kwargs work,
so their docs page should have been deleted, but we forgot to.
2025-04-28 14:43:24 +00:00
145c28bbd5 Remove unused Arc button from toolbar (#6539) 2025-04-28 14:32:43 +00:00
a58a3361b6 #4852 Delete line segments in sketch mode using keyboard (#6407)
* wip hack to delete line segments

* unrelated: clean up console

* better check if current selection is segment before deletion

* lint
2025-04-28 10:27:11 -04:00
efba773635 Move operations on solids to be declared in KCL (#6462)
* Declare chamfer in KCL

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

* Ignore more in the simulation tests

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

* Declare fillet in KCL

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

* Move shell and hollow to KCL

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-28 14:20:38 +12:00
4439229ad2 turn back on the test i tturned off (#6522)
* random other cahnges

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

* turn back on test

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

* docs

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

* lots of enhancements

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>

* mesh test

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

* mesh test

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

* check panics

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

* updates

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

* check panics

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

* check panics

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

* cleanup

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

* if running in vitest make single threadedd

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

* check if running in vitest

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

* console logs

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-27 23:54:32 +00:00
0dcb8baf64 Post-kwargs cleanup (#6524)
Remove unused positional argument code.
2025-04-27 07:59:32 -07:00
921adcb3eb bump kcl lib nad friends (#6521)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-27 02:13:51 -04:00
24465cf463 Parallelize the artifact graph only time suck (#6482)
* parallelize the artifact only time suck

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

updates

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

make wasm safe

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

updates

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

* artifact graph things

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-04-27 04:21:26 +00:00
d0b0365f75 Delete unused copilot tests (#6518)
Delete unused tests
2025-04-26 23:47:43 +00:00
0f88598dc0 BREAKING: Migrate math functions to keyword args (#6491) 2025-04-26 23:33:41 +00:00
d7e80b3cc7 Assemblies: Point-and-click Clone (#6478)
* WIP: Assemblies: Point-and-click Clone
Fixes #6209

* Make assemblies commands available for release
Fixes #6497

* Break insert out of the group, new icon, add Clone disabled

* Add rotate thanks to @franknoirot

* Update relevant snapshots

* Fix pathToNode

* Add clone to stdlibmap

* Cleaned more things

* Add custom icon

* Add variable name for clone

* Add e2e test for import and translated import

* Remove stale comment

* Add test for selection based extrude clone

* First batch of suggestions from @lee-at-zoo-corp, tysm!

* Clean up test names

* Second batch of @lee-at-zoo-corp's suggestion for modelingMachine error handling
2025-04-26 22:26:39 +00:00
25bb95a66e Fix just command to match test function rename (#6517) 2025-04-26 15:23:27 -07:00
6e115c19d5 KCL: Migrate hole to kwargs (#6382)
Previously:

`|> hole(circle(radius = 2, center = p), %)`

Now:

`|> subtract2d(tool = circle(radius = 2, center = p))`
2025-04-26 15:31:51 -05:00
5a18f551aa Adjust sharding to account for more tests being run (#6509) 2025-04-26 19:45:52 +00:00
0426967bf7 Rework home layout to have a sidebar (#6423)
* chore: saving off skeleton

* fix: saving skeleton

* chore: skeleton for loading projects from project directory path

* chore: cleaning up useless state transition to be an on event direct to action state

* fix: new structure for web vs desktop vs react machine provider code

* chore: saving off skeleton

* fix: skeleton logic for react? going to move it from a string to obj.string

* fix: trying to prevent error element unmount on global react components. This is bricking JS state

* fix: we are so back

* chore: implemented navigating to specfic KCL file

* chore: implementing renaming project

* chore: deleting project

* fix: auto fixes

* fix: old debug/testing file oops

* chore: generic create new file

* chore: skeleton for web create file provide

* chore: basic machine vitest... need to figure out how to get window.electron implemented in vitest?

* chore: save off progress before deleting other project implementation, a few missing features still

* chore: trying a different init skeleton? most likely will migrate

* chore: first attempt of purging projects context provider

* chore: enabling toast for some machine state

* chore: enabling more toast success and error

* chore: writing read write state to the system io based on the project path

* fix: tsc fixes

* fix: use file system watcher, navigate to project after creation via the requestProjectName

* chore: open project command, hooks vs snapshot context helpers

* chore: implemented open and create project for e2e testing. They are hard coded in poor spot for now.

* fix: codespell fixes

* chore: implementing more project commands

* chore: PR improvements for root.tsx

* chore: leaving comment about new Router.tsx layout

* fix: removing debugging code

* fix: rewriting component for readability

* fix: improving web initialization

* chore: implementing import file from url which is not actually that?

* fix: clearing search params on import file from url

* fix: fixed two e2e tests, forgot needsReview when making new command

* fix: fixing some import from url business logic to pass e2e tests

* chore: script for diffing circular deps +/-

* fix: formatting

* fix: massive fix for circular depsga!

* fix: trying to fix some errors and auto fmt

* fix: updating deps

* fix: removing debugging code

* fix: big clean up

* fix: more deletion

* fix: tsc cleanup

* fix: TSC TSC TSC TSC!

* fix: typo fix

* fix: clear query params on web only, desktop not required

* fix: removing unused code

* fmt

* Bring back `trap` removed in merge

* Use explicit types instead of `any`s on arg configs

* Add project commands directly to command palette

* fix: deleting debugging code, from PR review

* fix: this got added back(?)

* fix: using referred type

* fix: more PR clean up

* fix: big block comment for xstate architecture decision

* fix: more pr comment fixes

* fix: saving off logic, need a big cleanup because I hacked it together to get a POC

* fix: extra business?

* fix: merge conflict just added them back why dude

* fix: more PR comments

* fix: big ciruclar deps fix, commandBarActor in appActor

* chore: writing e2e test, still need to fix 3 bugs

* chore: adding more scenarios

* fix: formatting

* fix: fixing tsc errors

* chore: deleting the old text to cad and using the new application level one, almost there

* fix: prompt to edit works

* fix: large push to get 1 text to cad command... the usage is a little buggy with delete and navigate within /file

* fix: settings for highlight edges now works

* chore: adding another e2e test

* fix: cleaning up e2e tests and writing more of them

* fix: tsc type

* chore: more e2e improvements, unique project name  in text to cad

* chore: e2e tests should be good to go

* fix: gotcha comment

* fix: enabled web t2c, codespell fixes

* fix: fixing merge conflcits??

* fix: t2c is back

* Rework home layout to have a sidebar

fmt I think

* Add two links to the bottom of the sidebar

Mostly to visually anchor it

* Tweak some style things

* update test util whose locator needs to change

* tsc and fmt

* Stupid heading change broke the dang E2E tests

* Make that heading locator a part of the home page fixture

* pierremtb/new-snaps-for-frank (#6516)

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>

---------

Co-authored-by: Kevin Nadro <kevin@zoo.dev>
Co-authored-by: Kevin Nadro <nadr0@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-26 15:55:01 +00:00
9d893d8f0b Remove syntax not supported on all platforms (#6513)
* Remove syntax not supported on all platforms

https://github.com/KittyCAD/modeling-app/actions/runs/14677571075/job/41196471368

* Update dependencies
2025-04-26 05:39:56 +00:00
8de648f0db getCommonEdge as default way of filleting (#6043)
* Common edge faces into artifact graph

* clean up

* kingdom of tags

* add tests

* hook up tags with edge treatments

* update unit tests

* update e2e

* clean up

* more fix up after main merge

* fmt

* revolve fix

* fix new circular dependency

* fix revolve

* remove numbers from circ deps, makes diffs bad

* sim test updates

* try and get tests working

* update

* Fix tsc error

---------

Co-authored-by: max-mrgrsk <156543465+max-mrgrsk@users.noreply.github.com>
Co-authored-by: max <margorskyi@gmail.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-26 04:00:28 +00:00
50f8131d83 Kwargs: map and reduce (#6480)
Migrate array's `map`, `reduce` and `push` functions to use keyword arguments.
2025-04-25 19:09:03 -05:00
5a4f8bd522 [Feature]: Enable Text-to-CAD at the application level (#6501)
* chore: saving off skeleton

* fix: saving skeleton

* chore: skeleton for loading projects from project directory path

* chore: cleaning up useless state transition to be an on event direct to action state

* fix: new structure for web vs desktop vs react machine provider code

* chore: saving off skeleton

* fix: skeleton logic for react? going to move it from a string to obj.string

* fix: trying to prevent error element unmount on global react components. This is bricking JS state

* fix: we are so back

* chore: implemented navigating to specfic KCL file

* chore: implementing renaming project

* chore: deleting project

* fix: auto fixes

* fix: old debug/testing file oops

* chore: generic create new file

* chore: skeleton for web create file provide

* chore: basic machine vitest... need to figure out how to get window.electron implemented in vitest?

* chore: save off progress before deleting other project implementation, a few missing features still

* chore: trying a different init skeleton? most likely will migrate

* chore: first attempt of purging projects context provider

* chore: enabling toast for some machine state

* chore: enabling more toast success and error

* chore: writing read write state to the system io based on the project path

* fix: tsc fixes

* fix: use file system watcher, navigate to project after creation via the requestProjectName

* chore: open project command, hooks vs snapshot context helpers

* chore: implemented open and create project for e2e testing. They are hard coded in poor spot for now.

* fix: codespell fixes

* chore: implementing more project commands

* chore: PR improvements for root.tsx

* chore: leaving comment about new Router.tsx layout

* fix: removing debugging code

* fix: rewriting component for readability

* fix: improving web initialization

* chore: implementing import file from url which is not actually that?

* fix: clearing search params on import file from url

* fix: fixed two e2e tests, forgot needsReview when making new command

* fix: fixing some import from url business logic to pass e2e tests

* chore: script for diffing circular deps +/-

* fix: formatting

* fix: massive fix for circular depsga!

* fix: trying to fix some errors and auto fmt

* fix: updating deps

* fix: removing debugging code

* fix: big clean up

* fix: more deletion

* fix: tsc cleanup

* fix: TSC TSC TSC TSC!

* fix: typo fix

* fix: clear query params on web only, desktop not required

* fix: removing unused code

* fmt

* Bring back `trap` removed in merge

* Use explicit types instead of `any`s on arg configs

* Add project commands directly to command palette

* fix: deleting debugging code, from PR review

* fix: this got added back(?)

* fix: using referred type

* fix: more PR clean up

* fix: big block comment for xstate architecture decision

* fix: more pr comment fixes

* fix: saving off logic, need a big cleanup because I hacked it together to get a POC

* fix: extra business?

* fix: merge conflict just added them back why dude

* fix: more PR comments

* fix: big ciruclar deps fix, commandBarActor in appActor

* chore: writing e2e test, still need to fix 3 bugs

* chore: adding more scenarios

* fix: formatting

* fix: fixing tsc errors

* chore: deleting the old text to cad and using the new application level one, almost there

* fix: prompt to edit works

* fix: large push to get 1 text to cad command... the usage is a little buggy with delete and navigate within /file

* fix: settings for highlight edges now works

* chore: adding another e2e test

* fix: cleaning up e2e tests and writing more of them

* fix: tsc type

* chore: more e2e improvements, unique project name  in text to cad

* chore: e2e tests should be good to go

* fix: gotcha comment

* fix: enabled web t2c, codespell fixes

* fix: fixing merge conflcits??

* fix: t2c is back

* Remove spaces in command bar test

* fmt

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
Co-authored-by: lee-at-zoo-corp <lee@zoo.dev>
2025-04-25 19:04:47 -04:00
f8e53d941d Change so that var definitions can be a module's return value (#6504)
* Change so that var definitions can be a module's return value

* Change car wheel assembly to use the new return mechanism

* Add sim test

* Update output

* Update module docs

* Add safety check to only work with modules

* Fix to use updated keyword args
2025-04-25 21:55:54 +00:00
717a2039cb Restore quoting of union greps (#6510) 2025-04-25 21:21:41 +00:00
6e7c44fca7 Migrate from unmaintained tempdir to tempfile (#6476) 2025-04-25 17:19:04 -04:00
ffbe20b586 Kwargs: startProfileAt (#6424)
Previous:

```
startProfileAt([x, y], %)
startProfileAt([x, y], sketch001)
```

New:
```
startProfile(%, at = [x, y])
startProfile(sketch001, at = [x, y])
```
2025-04-25 21:01:35 +00:00
9547e95e9d Feature tree loading indicator is too big and requires scroll to see (#6508)
Fixes #6477
2025-04-25 19:58:33 +00:00
a1f31f4348 Update test to check for the correct units toast message (#6505) 2025-04-25 14:19:54 -04:00
604e244395 Make assemblies commands available for release (#6498)
* Make assemblies commands available for release
Fixes #6497

* Break insert out of the group, new icon, add Clone disabled

* Add rotate thanks to @franknoirot

* Update relevant snapshots

* Trigger CI
2025-04-25 16:49:11 +00:00
fe22a67cf6 #5184 Ability to toggle default planes visibility (#6333)
* add first version of DefaultPlanes to FeatureTreePane

* fix lint issues

* don't show default planes UI in sketch mode

* lint

* toggling default planes: implementation in xstate

* revert malformed modelingMachine.ts

* lint

* save and restore default plane visibility when returning to modeling mode

* fmt

* tsc

* introduce new cleanup state with actor when exiting sketch mode

* temp remove restore default plane visibility - causes error on starting up a project

* set selection filter after executeAst - this is a wip hacky fix

* remove unused early return: this also caused plane selection to only work with double click

* lint

* no need to set selection filter to curves only, we want faces to be selectable in modeling mode, even though this means default planes are also selectable

* tightening types for visibility map

* lint

* cleanups

* fix border issue when visibility toggle is not active and props.visible === true

* ui updates on FeatureTreePane/default planes

* no pointer cursor for unselectable default planes

* show default planes initially even for non-empty projects

* dont show default planes initially when project is not empty

* fix test: Only show axis planes when there are no errors

* fixes for sketch tests

* better initialize for planes

* lint

* fix uneccessary 'reset camera position' in sketch entry

* revert hiding/showing content depending on artifact graph for tests

* only show default planes when there are no errors

* disable Restore default plane visibility, was causing temporary flashing of default planes when exiting sketch mode

* Always show default plane visibility toggles, regardless of being on/off

* revert modelingMachine to original idle states to avoid 'zoom_to_fit' test regression - probably racing condition

* fmt
2025-04-25 18:21:19 +02:00
885d2afaa3 Make boolean commands available for release (#6500)
* Make boolean commands available for release
Fixes #6499

* Update src/lib/commandBarConfigs/modelingCommandConfig.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-04-25 15:18:17 +00:00
be4a32a59e Switch to dynamically disabling broken tests (#6492)
* Switch to dynamically disabling broken tests

* Remove stale comment

* Fix nested tests
2025-04-25 10:49:22 -04:00
c501d3bfbf Fix whole module import deletion in feature tree (#6456)
* Fix whole module import deletion in feature tree
Fixes #6447

* Delete both

* Fix tests

* Lint

* Clean up for review

* Update src/lang/modifyAst.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* Add extra error case

* Update e2e/playwright/point-click-assemblies.spec.ts

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-04-25 16:45:51 +02:00
0ef1483e11 Stabilize test by allowing more time before clicking object (#6495)
stabilize test by allowing more time before clicking object
2025-04-25 08:55:32 -04:00
bbaaf86e4d pre commit fmt (#6470)
* setup

* remove pre-push

* undo weird fmt
2025-04-25 04:58:58 -04:00
6a0e10f8ab Test all platforms hourly (#6494) 2025-04-25 04:58:13 -04:00
5c0ca52291 Foreign imports go thru parallelization too (#6488)
* start of parallelizing forign imports

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

* clippy

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

* remove_printlns

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

* remove shit that doesnt work

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

* remove shit that doesnt work

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

* put back

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

* put back

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

* put back

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

* multiple

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

* updates

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

* remove println

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

* updates

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

* clone docs

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

* add whole module import docs

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

* add whole module import docs

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-04-25 03:25:02 +00:00
bff13f6bfe Opt-in tests that cover Windows-specific capabilities (#6489)
* Opt-in tests that cover Windows-specific capabilities

* Remove unnecessary quotes
2025-04-25 00:50:26 +00:00
6001b71f06 Add Open in New Window and reexecution on import change (#6379)
* Quick prototype: open in new window in file tree

* WIP: refresh on imported file change

* Fix up reexecution

* Clean up

* Add test 'Assembly gets reexecuted when imported models are updated externally'

* Clean up
2025-04-25 09:02:18 +10:00
bd1e68a4c8 turn on fillets UI in prod (#6474)
* turn on fillets

* delete status property re-Pierre

---------

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-24 17:22:28 -04:00
8589f8fc5f Opt-in tests that cover macOS-specific capabilities (#6486) 2025-04-24 17:15:11 -04:00
6641e1178b bump three point arc to be the default (#6464)
* bump three point arc up

* Update tests to select tangential arc from dropdown

* Fix another test that used tangential arc

* Fix up snapshot tests' use of Tangential Arc

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-25 06:40:33 +10:00
6e0f1e71b2 add a test for coercing a nested array (#6326)
* add a test for coercing a nested array

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

* fix test

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

* add console log

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

* add console log

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

* add test for what we get back on no_outputs error

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

* remove my log

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

* move test

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Paul Tagliamonte <paul@zoo.dev>
2025-04-24 19:37:44 +00:00
0e945b6457 properly close the context (#6485)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-24 19:37:22 +00:00
19155a9132 Fix logout issue on desktop (#6450)
* WIP: Fix logout issue on desktop
Fixes #5640

* Fix test with addInitScript
2025-04-24 15:29:17 -04:00
305d613d40 Nadro/adhoc/system io machine (#6352)
* chore: saving off skeleton

* fix: saving skeleton

* chore: skeleton for loading projects from project directory path

* chore: cleaning up useless state transition to be an on event direct to action state

* fix: new structure for web vs desktop vs react machine provider code

* chore: saving off skeleton

* fix: skeleton logic for react? going to move it from a string to obj.string

* fix: trying to prevent error element unmount on global react components. This is bricking JS state

* fix: we are so back

* chore: implemented navigating to specfic KCL file

* chore: implementing renaming project

* chore: deleting project

* fix: auto fixes

* fix: old debug/testing file oops

* chore: generic create new file

* chore: skeleton for web create file provide

* chore: basic machine vitest... need to figure out how to get window.electron implemented in vitest?

* chore: save off progress before deleting other project implementation, a few missing features still

* chore: trying a different init skeleton? most likely will migrate

* chore: first attempt of purging projects context provider

* chore: enabling toast for some machine state

* chore: enabling more toast success and error

* chore: writing read write state to the system io based on the project path

* fix: tsc fixes

* fix: use file system watcher, navigate to project after creation via the requestProjectName

* chore: open project command, hooks vs snapshot context helpers

* chore: implemented open and create project for e2e testing. They are hard coded in poor spot for now.

* fix: codespell fixes

* chore: implementing more project commands

* chore: PR improvements for root.tsx

* chore: leaving comment about new Router.tsx layout

* fix: removing debugging code

* fix: rewriting component for readability

* fix: improving web initialization

* chore: implementing import file from url which is not actually that?

* fix: clearing search params on import file from url

* fix: fixed two e2e tests, forgot needsReview when making new command

* fix: fixing some import from url business logic to pass e2e tests

* chore: script for diffing circular deps +/-

* fix: formatting

* fix: massive fix for circular depsga!

* fix: trying to fix some errors and auto fmt

* fix: updating deps

* fix: removing debugging code

* fix: big clean up

* fix: more deletion

* fix: tsc cleanup

* fix: TSC TSC TSC TSC!

* fix: typo fix

* fix: clear query params on web only, desktop not required

* fix: removing unused code

* fmt

* Bring back `trap` removed in merge

* Use explicit types instead of `any`s on arg configs

* Add project commands directly to command palette

* fix: deleting debugging code, from PR review

* fix: this got added back(?)

* fix: using referred type

* fix: more PR clean up

* fix: big block comment for xstate architecture decision

* fix: more pr comment fixes

* fix: merge conflict just added them back why dude

* fix: more PR comments

* fix: big ciruclar deps fix, commandBarActor in appActor

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-24 13:32:49 -05:00
95f2caacab Fix testing-selections test / clicking on empty space (#6481)
fix clicking on empty space which happened to click on UI, causing the test to fail
2025-04-24 17:46:07 +00:00
8f61ee1d2f Change getOppositeEdge, getNextAdjacentEdge, and getPreviousAdjacentEdge to keyword args (#6469)
* Change getOppositeEdge, getNextAdjacentEdge, and getPreviousAdjacentEdge to keyword args

* Update generated docs
2025-04-24 12:39:37 -04:00
b02dbd4fe6 Kwargs: leg helpers (#6459)
legLen, legAngX, legAngY moved to keyword arguments
2025-04-24 09:53:19 -05:00
668f6671a9 BREAKING: Remove angleToMatchLengthX and angleToMatchLengthY (#6451)
* Remove angleToMatchLengthX and angleToMatchLengthY from constraint code generation

* Change KCL stdlib functions to be deprecated

* Remove references from TS tests

* Remove angleToMatchLengthX and angleToMatchLengthY

* Update docs

* Fix file paths
2025-04-24 14:33:27 +00:00
f6387eb7e9 fmt (#6473) 2025-04-24 13:10:06 +00:00
83a87b046f Declare std::offsetPlane in KCL (#6344)
* Declare std::offsetPlane in KCL

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

* Use two axes to define planes in KCL

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-24 22:01:27 +12:00
20c2ce3bac Shorten tronapp setup fail (#6362)
* shorten tron app setup fail

* fmt

* more tweaks to tronapp setup

* bump initial timeout back to 120s

* Update e2e/playwright/zoo-test.ts

---------

Co-authored-by: Zookeeper Lee <lee@zoo.dev>
2025-04-24 06:35:57 +00:00
2956f9ed55 YOU FOOLS I WON THE CONTEST (#6328)
* dodec

* fmt

* comment

* Update kcl-samples simulation test output

* Update kcl-samples simulation test output

* Fix so that just commands regenerate ast output

* overwrite

* Update just command to include manifest

* Update generated output

* merge main post

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-24 06:08:45 +00:00
510d74f2c7 Add clone (#5462)
* 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 the extrude idds

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

updates

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

fix sample

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

better docs

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

fix the start and end tag

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

better docs

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

updates

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

new tests

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

codespell

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 examples

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

* fix some stuff

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>

* add another test for fillet

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

* Update rust/kcl-lib/src/std/clone.rs

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

* fixes

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

* add sweep test

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

* revolve test;

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

* Update rust/kcl-lib/src/std/clone.rs

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

* add another test for fillet

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

* allow cloning an imported geometry;

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

* allow for imported geometry

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

* updates

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

* update docs

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-24 04:26:09 +00:00
457ab28f74 Appearance import fixes (#6466)
* fix appearance imports

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

* fix appearance

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-24 00:43:16 +00:00
1502f923ee KCL bugfix: CallExpressionKw was not usable as math operand (#6460)
Closes https://github.com/KittyCAD/modeling-app/issues/4992
2025-04-23 21:21:57 +00:00
f03a684eec Modeling view appearance final tweaks (#6425)
* Remove bug button from LowerRightControls

There is a "report a bug" button in the help menus, both native and
lower-right corner. This is overkill, and users are not using coredump
well.

* Remove coredump from refresh UI button

* Add a "Refresh app" command to palette

* Update snapshots

* Rework "Refresh and report bug" menu item to "Report a bug"

* Add refresh button to sidebar

* Convert upper-right refresh button to Share

* Tweak styles of command button

* Make anonymous user icon same size as known user image

* Remove ModelStateIndicator

* Use hotkeyDisplay for the sidebar too

* Update snapshots

* Remove tooltip from command bar open button

* tsc, lint, and fmt
2025-04-23 15:20:45 -04:00
45e17c50e7 docs: Add docs for creating simulation tests (#6453) 2025-04-23 11:59:07 -07:00
6bf74379a7 Kwargs: hollow (#6438) 2025-04-23 18:35:33 +00:00
01c6fd53fa Fix Cargo.lock (#6452) 2025-04-23 17:39:35 +00:00
f8306c0275 Try running with 8 macOS cores again (#6420)
* Revert "Disable all macOS testing for now (#6395)"

This reverts commit fbc3251c3f.

* Try running with 8 macOS cores again
2025-04-23 13:10:09 -04:00
900ef9e18d Release KCL 63 (#6446) 2025-04-23 12:35:16 -04:00
a46186573c Kwargs: profileStart/x/y (#6439) 2025-04-23 15:21:58 +00:00
90f6c1bb04 Fix Back button on SignIn page & Add Cancel button (#6415)
* Back button on SignIn page leads to Home page
Fixes #6413

* Add regression test for the bug, and for new cancel button

* Full sign in e2e test

* Good bot

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-04-23 15:12:33 +00:00
41d946b339 Remove Spline and Text tools from sketch mode toolbar (#6427)
* Remove Spline and Text tool from sketch toolbar

* Update sketch-related snapshots

* Update snapshots
2025-04-23 13:06:51 +00:00
b7385d5f25 Turn on units of measure (BREAKING CHANGE) (#6343)
* Turn on uom checks

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

* Convert all lengths to mm for engine calls

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

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-22 22:58:35 +00:00
3d22f6cd66 Only save one version of tag info per epoch (#6429)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-23 09:22:52 +12:00
9730e3f5b3 KCL: Rephrase confusing error msg (#6436)
Before:

  × undefined value: memory item key `foo` is not defined

Now:

  × undefined value: `foo` is not defined
2025-04-22 20:24:53 +00:00
29d6b22d63 Restore tests that use Text-to-CAD (#6284) 2025-04-22 14:55:10 -04:00
f99e44e371 Kwargs: assert functions (#6406)
Closes https://github.com/KittyCAD/modeling-app/issues/6408
2025-04-22 17:44:52 +00:00
8be36d3d16 Update known-issues.md (#6428)
* Update known-issues.md

* Update known-issues.md

Little more description.

---------

Co-authored-by: Josh Gomez <114548659+jgomez720@users.noreply.github.com>
2025-04-22 17:18:35 +00:00
bc1742af48 Remove bold mono font (#6414)
* Remove all use of bold mono font
A few mono font points are left, mostly for numbers which look better in
monospace.

* Update snapshots
2025-04-22 15:17:47 +00:00
e4080cc184 Allow snapshot tests to report status (#6430) 2025-04-22 10:39:21 -04:00
18de6ccb59 #6417 Fix svg attribute names, add new eslint rule (#6418)
* fix svg attribute names, add new eslint rule

* tabs -> spaces
2025-04-22 09:15:38 -04:00
f00ea4cf5e Use TAB API to determine when merges are blocked (#6405)
* Use TAB API to determine when merges are blocked

* Enable a test that is known to fail
2025-04-22 09:02:02 -04:00
c5539be814 Warn if settings (or other inner attributes) are not at the top of a file (#6426)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-22 14:43:09 +12:00
f5d6a12d8c Remove unused KCL file (#6383) 2025-04-21 23:59:30 +00:00
e4e18dfd4b Coerce the result of a function call to the function's return type (#6309)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-22 11:00:53 +12:00
30ee547ce4 More consistency in 'Create project' and 'Share part via Zoo link' buttons and commands (#6378)
Polish: More consistency in 'Create project' and 'Share part via Zoo link' buttons and commands
2025-04-21 15:08:51 -04:00
f8ca6ad746 BREAKING: Change polygon to keyword args (#6385)
* Change polygon to keyword args

* Update docs

* Update generated output

* Update docs to mention the default for inscribed

* Appease clippy

* Remove tag parameter

* Update docs since removing tag

* Remove inscribed from autocomplete snippet since the default is true
2025-04-21 18:29:32 +00:00
7a90d029e1 Update onboarding interactive numbers test to use editor fixture, take 2 (#6399)
Update onboarding interactive numbers test to use editor fixture

Trying to bring it down from the leaderboard of failed tests.

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-21 14:34:20 +00:00
2900858171 Bump the minor group across 1 directory with 8 updates (#6411)
Bumps the minor group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@csstools/postcss-oklab-function](https://github.com/csstools/postcss-plugins/tree/HEAD/plugins/postcss-oklab-function) | `4.0.8` | `4.0.9` |
| [@playwright/test](https://github.com/microsoft/playwright) | `1.51.1` | `1.52.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.14.0` | `22.14.1` |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `4.3.4` | `4.4.1` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.29.1` | `8.30.1` |
| [rollup](https://github.com/rollup/rollup) | `4.39.0` | `4.40.0` |



Updates `@csstools/postcss-oklab-function` from 4.0.8 to 4.0.9
- [Changelog](https://github.com/csstools/postcss-plugins/blob/main/plugins/postcss-oklab-function/CHANGELOG.md)
- [Commits](https://github.com/csstools/postcss-plugins/commits/HEAD/plugins/postcss-oklab-function)

Updates `@playwright/test` from 1.51.1 to 1.52.0
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.51.1...v1.52.0)

Updates `@types/node` from 22.14.0 to 22.14.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@vitejs/plugin-react` from 4.3.4 to 4.4.1
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@4.4.1/packages/plugin-react)

Updates `typescript-eslint` from 8.29.1 to 8.30.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.30.1/packages/typescript-eslint)

Updates `rollup` from 4.39.0 to 4.40.0
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.39.0...v4.40.0)

Updates `@typescript-eslint/eslint-plugin` from 8.29.1 to 8.30.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.30.1/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.29.1 to 8.30.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.30.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@csstools/postcss-oklab-function"
  dependency-version: 4.0.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: "@playwright/test"
  dependency-version: 1.52.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@types/node"
  dependency-version: 22.14.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: minor
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 4.4.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: typescript-eslint
  dependency-version: 8.30.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: rollup
  dependency-version: 4.40.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.30.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.30.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-21 12:42:14 +00:00
0dee219e46 Check for local name clash with existing variables in Insert flow (#6375)
Check for local name alias clashes with extisting var in Insert flow
Fixes #6230
2025-04-21 10:35:43 +00:00
790613e708 KCL: Convert bezierCurve to use keyword args (#6381) 2025-04-20 20:10:27 -05:00
0a35722595 Silence snapshot failures for now (#6403) 2025-04-19 10:59:53 +00:00
f30fc376ee Allow deletion of only item in AST (#6335)
* Update test to check for deletion of only operation

* Allow updateEditorWithAstAndWriteToFile to clear AST

* Update src/lang/codeManager.ts

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

* Weave `isDeleting` through to `deleteSelectionPromise`

* fmt

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-19 05:27:23 -04:00
8c1a95833d clean up sketch mode cmd (#6397) 2025-04-18 21:15:19 -04:00
4f1ba1be01 Fix error message whitelist to use updated message (#6404) 2025-04-18 23:27:34 +00:00
90acc00369 Kwargs migration: arc/arcTo (#6334) 2025-04-18 17:40:44 -05:00
e4fe8a4440 Fix CSG commands to be included in the artifact graph (#6391)
* Fix CSG commands to be included in the artifact graph

* Update output
2025-04-18 22:35:17 +00:00
fbc3251c3f Disable all macOS testing for now (#6395) 2025-04-18 21:37:33 +00:00
a0f3f0f50e Fix KCLError to have a real message (#6396)
* Fix KCLError to have a real message

* Remove unneeded error exception
2025-04-18 17:13:09 -04:00
dad0d5488f Support any installation path for rust toolchain (#6380) 2025-04-18 20:28:38 +00:00
77773fb052 ci: Add error to console exception (#6392)
* Add error to console exception

* Ignore in codespell

* Increase retry on snapshots

* Fixme's all around

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-18 15:51:13 -04:00
1240ca6f21 Revert "Update onboarding interactive numbers test to use editor fixture" (#6393)
Revert "Update onboarding interactive numbers test to use editor fixture (#6356)"

This reverts commit c77bb92da9.
2025-04-18 14:57:40 -04:00
ce3a6ad286 Revert "Remove all use of bold mono font" (#6394)
Revert "Remove all use of bold mono font (#6373)"

This reverts commit 03c4121ab7.
2025-04-18 14:57:10 -04:00
a20f420a55 Add fixmes to failing e2e tests (#6388)
* Add fixmes to bad snapshots tests

* max attempts to 5 on snapshots

* Skip revolve on windows

* Another one

* Add fixme to edit with ML snapshot test

* fmt

* Use absolute import, fix lint

* Disable another test

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-18 14:14:23 -04:00
03c4121ab7 Remove all use of bold mono font (#6373)
* Remove all use of bold mono font
A few mono font points are left, mostly for numbers which look better in
monospace.

* make React happy with `clipRule`
2025-04-18 14:11:20 -04:00
8c2c877817 Bump crossbeam-channel from 0.5.14 to 0.5.15 in /rust in the security group (#6354)
Bump crossbeam-channel in /rust in the security group

Bumps the security group in /rust with 1 update: [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam).


Updates `crossbeam-channel` from 0.5.14 to 0.5.15
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.14...crossbeam-channel-0.5.15)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-version: 0.5.15
  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-04-18 14:10:54 -04:00
c77bb92da9 Update onboarding interactive numbers test to use editor fixture (#6356)
Trying to bring it down from the leaderboard of failed tests.

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-18 14:06:23 -04:00
bd4bad0020 allow sending async commands to engine (#6342)
* start of async

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

check at end if the async commands completed

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

run at the end of inner_run

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

set import as async

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 to the wasm side

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>

* fire

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

* flake

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

* fixup for awaiting on import

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 mock

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

* fix mock

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>

* add a test where we import then do a bunch of other stuff

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

* updates

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

* fixup to see

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

* fixups

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>

* cross platform time

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>

* another appearance tests

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

* new docs and tests

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

* updates

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

* dont loop so tight

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-04-17 17:22:19 -07:00
0b9889e313 Double the timeout in sketch editing test (#6376) 2025-04-17 14:32:11 -04:00
f9fbaa2298 Add files via upload (#6227)
* Add files via upload

Adding parametric pc fan and bottle

* Update and rename globals.kcl to parameters.kcl

* Update fan-housing.kcl

* Update fan-housing.kcl

* Update fan.kcl

* Update motor.kcl

* Update parameters.kcl

* Update kcl-samples simulation test output

* Update main.kcl

avoiding fn imports

* Update kcl-samples simulation test output

* remove functions

* angledLine kwargs

* tangentalArc kwargs

* Update kcl-samples simulation test output

* Update housing middle

more tweaks because I just can't help myself

* Update kcl-samples simulation test output

* Update kcl-samples simulation test output

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: jgomez720 <114548659+jgomez720@users.noreply.github.com>
2025-04-17 17:46:56 +00:00
6f2d127c4f Assemblies: Set translate and rotate via point-and-click (#6167)
* WIP: Add point-and-click Import for geometry
Will eventually fix #6120
Right now the whole loop is there but the codemod doesn't work yet

* Better pathToNOde, log on non-working cm dispatch call

* Add workaround to updateModelingState not working

* Back to updateModelingState with a skip flag

* Better todo

* Change working from Import to Insert, cleanups

* Sister command in kclCommands to populate file options

* Improve path selector

* Unsure: move importAstMod to kclCommands onSubmit 😶

* Add e2e test

* Clean up for review

* Add native file menu entry and test

* No await yo lint said so

* WIP: UX improvements around foreign file imports
Fixes #6152

* WIP: Set translate and rotate via point-and-click on imports. Boilerplate code
Will eventually close #6020

* Full working loop of rotate and translate pipe mutation, including edits, only on module imports. VERY VERBOSE

* Add first e2e test for set transform. Bunch of caveats listed as TODOs

* @lrev-Dev's suggestion to remove a comment

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

* Update to scene.settled(cmdBar)

* Add partNNN default name for alias

* Lint

* Lint

* Fix unit tests

* Add sad path insert test
Thanks @Irev-Dev for the suggestion

* Add step insert test

* Lint

* Add test for second foreign import thru file tree click

* WIP: Add point-and-click Load to copy files from outside the project into the project
Towards #6210

* Move Insert button to modeling toolbar, update menus and toolbars

* Add default value for local name alias

* Aligning tests

* Fix tests

* Add padding for filenames starting with a digit

* Lint

* Lint

* Update snapshots

* Merge branch 'main' into pierremtb/issue6210-Add-point-and-click-Load-to-copy-files-from-outside-the-project-into-the-project

* Add disabled transform subbutton

* Allow start of Transform flow from toolbar with selection

* Merge kcl-samples and local disk load into one 'Load external model' command

* Fix em tests

* Fix test

* Add test for file pick import, better input

* Fix non .kcl loading

* Lint

* Update snapshots

* Fix issue leading to test failure

* Fix clone test

* Add note

* Fix nested clone issue

* Clean up for review

* Add valueSummary for path

* Fix test after path change

* Clean up for review

* Support much wider range for transform

* Set display names

* Bug fixed itself moment...

* Add test for extrude tranform

* Oops missed a thing

* Clean up selection arg

* More tests incl for variable stuff

* Fix imports

* Add supportsTransform: true on all solids returning operations

* Fix edit flow on variables, add test

* Split transform command into translate and rotate

* Clean up and comment

* Clean up operations.ts

* Add comment

* Improve assemblies test

* Support more things

* Typo

* Fix test after unit change on import

* Last clean up for review

* Fix remaining test

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-04-17 15:44:31 +00:00
056a4d4a22 [FIX]: "Connecting to engine" overlay shows too often (#6350)
* Use the engineStreamState that's available right there silly

* fix lint

* Just look at playing/paused

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-04-17 12:49:31 +00:00
bab79331cb #6367 Tangent snapping improvements (#6369)
* fix snapping line being culled

* make snap line more grayed out

* make snapping tolerance smaller
2025-04-17 08:26:05 -04:00
16bbc970ae fix sketch flash part 2 (#6366) 2025-04-17 08:15:54 -04:00
0f1cff316c add toast for selections we don't recognise (#6370)
* ad toast for selections we don't recognise

* remove log
2025-04-17 21:32:13 +10:00
938a2bae13 Fix to not duplicate arg labels on constrained sketches (#6337) 2025-04-17 07:16:55 +00:00
3324835b72 ci: Fix so that just commands regenerate ast output (#6338)
* Fix so that just commands regenerate ast output

* Update just command to include manifest

* Fix overwrite-sim-test kcl_samples to generate manifest

This is the command used in CI.
2025-04-17 06:03:58 +00:00
1628ea86b2 Remove pixel color checks (#6365) 2025-04-17 14:25:45 +10:00
be119248a6 put execution benchmarks behind flag (#6364)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-16 21:23:30 -07:00
ac75181f7f fix bug and remove flash in sketch mode (#6346)
* fix bug and remove flash

* add test

* fix tests

* fix tests
2025-04-17 10:10:27 +10:00
d9fe78171f parallelized modules from kcl (#6206)
* wip

* sketch a bit more; going to pull this out of tests next

* wip

* lock start things

* this was a bad idea

* Revert "this was a bad idea"

This reverts commit a2092e7ed6.

* prepare prelude before spawning

* error

* poop

* yike

* :(

* ok

* Reapply "this was a bad idea"

This reverts commit fafdf41093.

* chip away more

* man this is bad

* fix rebase add feature flag

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

* get rid of execution kind

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

* clippy

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

* logs

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

* updates

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

* no extra executes

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

* race w batch

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

* cluppy

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

* no printlns

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

* no printlns

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

* fix source ranges

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

* batch shit

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>

* fix

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

* fix some bugs

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

* fix error

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

* cut 1

* preserve mem

* re-ad deep_clone

the helper we were calling was pushing a new call, which was hanging
out. we can skip the middleman since we already have something properly
prepared, just without a stdlib in some cases.

* skip non-kcl

* clean up source range bug

* error message changed

the uuids also changed because the error is hit before execute even
starts.

* typo

* rensnapshot a few

* order things

* MAYBE REVERT LATER:

attempt at an ordering

* snapsnap

* Revert "snapsnap"

This reverts commit 7350b32c7d.

* Revert "MAYBE REVERT LATER:"

This reverts commit ab49f3e85f.

* ugh

* poop

* poop2

* lint

* tranche 1

* more

* more snaps

* snap

* more

* update

* MAYBE REVERT THIS

* cache multi-file

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

* addd tests

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

* set to false

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

* add test outputs

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

* clippy

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

* kcl-py-bindings uses carwheel

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

* update snapshots

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: Paul R. Tagliamonte <paul@zoo.dev>
Co-authored-by: Paul Tagliamonte <paultag@gmail.com>
2025-04-16 11:52:14 -07:00
5586646a60 Fix insta version in Cargo.toml to match lock file (#6348)
Cargo decided to downgrade `windows-sys` for some reason.
2025-04-16 17:50:39 +00:00
e955e783f4 KCL: Error when user sets a keyword arg multiple times (#6339)
Previously, KCL would silently ignore any duplicated keyword args, setting the parameter to one arbitrarily-chosen argument. Now this is instead a parse error. 

I've tested that
1. The error message makes sense
2. The error is on a reasonable part of the source code
3. The error doesn't prevent other kinds of parse errors being picked up later

Thanks for noticing this one Frank!
2025-04-16 11:18:45 -05:00
9162c4d723 Split out the contributor guide (#6347) 2025-04-16 15:48:36 +00:00
f345a07bcd Update helix e2e test to account for 90deg engine change (#6341)
The engine fixed the start angle for helices, but our e2e test has a
pixel check so it broke. I made the test change the `startAngle` by
`-90` rather than try to hunt around for a new working pixel value.
2025-04-16 00:09:58 +00:00
f5e3b4bbe7 Update helix snapshots (#6340)
Engine fixed a bug where helices were starting at the wrong position. Requires updating the snapshots.
2025-04-15 17:15:37 -05:00
941911ed30 docs: Fix syntax error and deprecated string planes in types.md (#6332) 2025-04-15 17:42:24 +00:00
599bd2d958 Switch to a 6-core profile for mac (#6323)
* Switch to a 6-core profile for mac

* Bump workers percentage to optimize for CPU count (#6329)

* Bump macOS workers percentage to optimize for CPU count

* Handle floor math

---------

Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-04-15 13:07:16 -04:00
a847c7f608 Release KCL 62 (#6330) 2025-04-15 15:53:01 +00:00
d9be308c36 ~Maybe~ (Lee: ABSOLUTELY) use biome (#6327)
* maybe use biome

* import organising

* Removed unused new fmt commands; fix to not use linter

* Don't use fmt:generated - fmt is fast, but also use Makefile for this sort of thing

---------

Co-authored-by: lee-at-zoo-corp <lee@zoo.dev>
2025-04-15 10:11:25 -04:00
3cca4a30af [BUG] Grab bag of sketch mode bug fixes (#6229)
* use artifact id for sketch mode entry plane

* fix up re-eval as best as possible

* remove some async dodgyness

* fmt

* fix old sycronous re-execute shit

* add a test

* fix existing test

* add toast for error state

* spelling

* test stuff

* fmt

* fix toast

* test fix

* some other fix ups

* fix test
2025-04-15 09:27:50 -04:00
c51db5bd4a Make playwright:snapshots:ubuntu fail on mismatching image snapshots (#6322)
* pierremtb/adhoc/playwright-should-fail-on-mismatching-image-snapshots

* Add network-toggle to masks

* Add network masks

* :oops: tangentialArc snapshot update

* Update snaps

* Cleaner constants for masks

* Update snaps

* Clean up, updated README
2025-04-15 09:43:39 +00:00
7fce38b212 KCL: angledLineThatIntersects migrate to kwargs (#6296)
* KCL: Convert angledLineThatIntersects to use kwargs

* Update KCL tests and samples

* WIP

* Fix tsc and lint errors

* Fix missing cases

* Fix modifyAst unit tests

* Fix sketch unit tests

* Fix std unit tests

* Fix to not have extra docs

* Fix more unit tests

* Fix bench test

* Fix e2e tests to use new kw args

* tiny lint

* Fix adding constraint from UI to work

* Fix to use labeledArg constraints and use the correct order of args

* Fix selections e2e test

* Fix e2e test expectation

App was working as expected, but the e2e test was
expecting the old code, not the new code.

* Fix order of constraints in unit test

* Update docs

* Fix KCL formatting

* Update output

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-15 02:06:55 +00:00
d0e9b111af #5339 Add tangent snapping to straight segment tool (#5995)
* first draft of making segment snap to previous arc's last tangent

* ability to force/disable line snap, threshold in screen space

* mouseEvent refactor tsc errors fixed

* cleanups, extract getTanPreviousPoint function

* add snap line support when previous segment is ARC

* small cleanups

* remove unused planeNodePath param from onDragSegment

* renaming

* Enable snapping when placing the segment point in onClick

* refactor getSnappedDragPoint to include axis intersection

* handle snapping to both axis and tangent direction

* snap refinements

* small cleanups

* lint

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* generate tag for previous arc when snapping current straight segment

* using previous arc's tag in snapped angledLine

* angledLine uses object instead of array now

* use more general snap object instead

* snap tangent line visualized when snapping occurs

* remove unused scale param from createLine

* prettier

* fix bug where segment body is not drawn

* fix generated kcl error introduced in merge from main - modifiedAst needs to be passed to addNewSketchLn

* add support for snapping to negative tangent direction

* fix findTangentDirection for THREE_POINT_ARC_SEGMENT

* fix tsc error by introducing overrideExpr

* fix missing ccw for 3 point arc, fix tan_previous_point calculation for 3 point arcs

* resolve clippy until confirmation for circle radius

* fix runtime error when drawing a 3 point arc

* add unit tests to closestPointoOnRay

* unrelated react warning fixed

* add playwright test for tangent snapping

* better fix for tan_previous_point

* fix lint

* add simulation test for tangent_to_3_point_arc

* Fix simulation test output

* Add missing simulation test output files

* fix tangent snapping bug: use current group instead of last group in activeSegments

* make testcombos.test happy

* cleanup merge

* fix merge mistake, tsc error

* update tangent_to_3_point_arc simulation test

* fix angledLine related breaking tests

* minimum distance added before snapping to tangent

* circle is always ccw regardless of the order of points for tangential info calculation

* fix snapping when different unit is used other than mm

* update test: Straight line snapping to previous tangent

* update rust snapshot test

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
2025-04-14 23:51:14 +02:00
add1b21503 Assemblies: Load outside files into project via point-and-click (#6217)
* WIP: Add point-and-click Import for geometry
Will eventually fix #6120
Right now the whole loop is there but the codemod doesn't work yet

* Better pathToNOde, log on non-working cm dispatch call

* Add workaround to updateModelingState not working

* Back to updateModelingState with a skip flag

* Better todo

* Change working from Import to Insert, cleanups

* Sister command in kclCommands to populate file options

* Improve path selector

* Unsure: move importAstMod to kclCommands onSubmit 😶

* Add e2e test

* Clean up for review

* Add native file menu entry and test

* No await yo lint said so

* WIP: UX improvements around foreign file imports
Fixes #6152

* @lrev-Dev's suggestion to remove a comment

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

* Update to scene.settled(cmdBar)

* Add partNNN default name for alias

* Lint

* Lint

* Fix unit tests

* Add sad path insert test
Thanks @Irev-Dev for the suggestion

* Add step insert test

* Lint

* Add test for second foreign import thru file tree click

* WIP: Add point-and-click Load to copy files from outside the project into the project
Towards #6210

* Move Insert button to modeling toolbar, update menus and toolbars

* Add default value for local name alias

* Aligning tests

* Fix tests

* Add padding for filenames starting with a digit

* Lint

* Lint

* Update snapshots

* Merge branch 'main' into pierremtb/issue6210-Add-point-and-click-Load-to-copy-files-from-outside-the-project-into-the-project

* Add disabled transform subbutton

* Merge kcl-samples and local disk load into one 'Load external model' command

* Fix em tests

* Fix test

* Add test for file pick import, better input

* Fix non .kcl loading

* Lint

* Update snapshots

* Fix issue leading to test failure

* Fix clone test

* Add note

* Fix nested clone issue

* Clean up for review

* Add valueSummary for path

* Fix test after path change

* Clean up for review

* Update src/lib/kclCommands.ts

Thanks @franknoirot!

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

* Improve path input arg

* Fix tests

* Merge branch 'main' into pierremtb/issue6210-Add-point-and-click-Load-to-copy-files-from-outside-the-project-into-the-project

* Fix path header not showing and improve tests

* Clean up

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-04-14 18:53:01 +00:00
39af110ac1 Include test annotations for analysis (#6321) 2025-04-14 18:10:47 +00:00
bf7ec424a7 Add loading spinner back to stream just for engine connection, give it an error state (#6220)
* Add an engine error type for an "outage"

* Add a loading spinner back to the stream just for engine connection

* Refactor Loading spinner to account for early errors

* Add styling and state logic for unrecoverable errors in Loading

* Let engine error messages contain markdown

* Clarify 'too many connections' error message

* Add a "VeryLongLoadTime" error that suggests checking firewall

* Give the engine connection spinner a test ID and use it
2025-04-14 13:00:30 -04:00
6c7e42b541 Bump the patch group in /rust with 8 updates (#6312)
Bumps the patch group in /rust with 8 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.97` | `1.0.98` |
| [clap](https://github.com/clap-rs/clap) | `4.5.32` | `4.5.36` |
| [kittycad-modeling-cmds](https://github.com/KittyCAD/modeling-api) | `0.2.113` | `0.2.114` |
| [once_cell](https://github.com/matklad/once_cell) | `1.21.1` | `1.21.3` |
| [log](https://github.com/rust-lang/log) | `0.4.26` | `0.4.27` |
| [flate2](https://github.com/rust-lang/flate2-rs) | `1.1.0` | `1.1.1` |
| [time](https://github.com/time-rs/time) | `0.3.40` | `0.3.41` |
| [image](https://github.com/image-rs/image) | `0.25.5` | `0.25.6` |


Updates `anyhow` from 1.0.97 to 1.0.98
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.97...1.0.98)

Updates `clap` from 4.5.32 to 4.5.36
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.32...clap_complete-v4.5.36)

Updates `kittycad-modeling-cmds` from 0.2.113 to 0.2.114
- [Commits](https://github.com/KittyCAD/modeling-api/compare/kittycad-modeling-cmds-0.2.113...kittycad-modeling-cmds-0.2.114)

Updates `once_cell` from 1.21.1 to 1.21.3
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.21.1...v1.21.3)

Updates `log` from 0.4.26 to 0.4.27
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.26...0.4.27)

Updates `flate2` from 1.1.0 to 1.1.1
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.1.0...1.1.1)

Updates `time` from 0.3.40 to 0.3.41
- [Release notes](https://github.com/time-rs/time/releases)
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md)
- [Commits](https://github.com/time-rs/time/compare/v0.3.40...v0.3.41)

Updates `image` from 0.25.5 to 0.25.6
- [Changelog](https://github.com/image-rs/image/blob/main/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.25.5...v0.25.6)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.98
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: clap
  dependency-version: 4.5.36
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: kittycad-modeling-cmds
  dependency-version: 0.2.114
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: once_cell
  dependency-version: 1.21.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: log
  dependency-version: 0.4.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: flate2
  dependency-version: 1.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: time
  dependency-version: 0.3.41
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: image
  dependency-version: 0.25.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-14 09:48:43 -07:00
542a9a3f13 Fix to update prompt-to-edit snapshot (#6320)
* Fix to update prompt-to-edit snapshot

* Delete snapshot with no TS test file
2025-04-14 16:19:09 +00:00
264779a9d0 Follow up: Stream Idle PR (#6238)
* Use a dropdown for stream idle setting

* Add support for undefined values in dropdowns

* Move cache bust to the beginning of engine open for reconnections

* yarn tsc

* Don't setup model feature highlighters until the connection is ready

* Wait 2s to give engine time to serve video, then listen for modeling commands

* Undo teardown

* yarn fmt

* Fix circular module dependency; fmt & lint & tsc

* Fix editor-test waiting for 2 instead of 1

* Increment another 2 numbers ...

---------

Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-14 12:09:45 -04:00
22dd4a67dd Share file snapshots across platforms (#6282)
* Share file snapshots across platforms

* Always skip file snapshot tests on Windows
2025-04-14 13:26:52 +00:00
5c188664bd Remove step retries in build-apps after npm transition (#6310)
* Remove unecessary step retries from build-apps

* To revert: Test with IS_RELEASE

* To revert: CSC_FOR_PULL_REQUEST

* Revert for review
2025-04-14 09:24:15 -04:00
f6e23fe619 Include test tags for analysis (#6304) 2025-04-14 13:08:07 +00:00
160f55ede5 BREAKING: More units of measure work and keyword args (#6291)
* More units of measure work

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

* Update CSG output since engine change

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Nick Cameron <nrc@ncameron.org>
2025-04-14 09:58:19 +00:00
7d7b153085 Add START and END constants to std (#6270)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-14 20:37:45 +12:00
8f487a441b fix text to code bug (#6308) 2025-04-14 04:02:17 +00:00
c8cee6a0dc Fix examples of how to run e2e tests with options (#6303) 2025-04-12 14:17:13 -04:00
167445ef8a WIP: migrate from yarn v1 to npm (#6274)
* WIP: migrate from yarn v1 to npm

* Add tsc mapping script

* More fixes

* Add playwright as script

* Fix more

* more and more people just want more

* Merge branch 'main' into pierremtb/adhoc/npm

* use workspaces and fix circular deps

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

* fmt

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

* fix

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

* New machine-api types

* better lock file

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

* ignore typos in machine-api generated files

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

* updates

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

* install from root

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

* fix tsc

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

* New machine-api types

* bettter install

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

* bettter install

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

* bettter install

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

* bettter install

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

* bettter install

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

* add comment

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

* add comment

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-12 02:49:49 +00:00
95b72d839b coerce [single, HomArray[single]] into flattened HomArray (#6299)
* dont prompt for message in git tag

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

* more tests

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-04-11 22:06:12 -04:00
9365186bed Change an IPC call to a fetch client-side. (#6294)
* Change an IPC call to a fetch client-side.

* fix fmt

* update
2025-04-11 23:59:27 +00:00
eea026f8e0 dont prompt for message in git tag (#6293)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-11 17:33:17 -04:00
3cd7a3533e Release create and edit parameter flows to the public (#6295)
I can't believe I didn't realize they never got marked as no longer in
development!
2025-04-11 21:12:36 +00:00
9e1f1152e3 Involute curve for sketch (#6258)
* WIP: Involute circles in KCL

* first pass involute end calculation

* fmt

* cleanup

* involute snapshot

* actually update markdown

* remove debug build stuff

* spacing

---------

Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
2025-04-11 21:59:11 +01:00
60d2be9ff2 Fix angledLine error messages to recommend the right keyword args (#6290)
* Fix angledLine error messages to recommend the right keyword args

* Update generated docs
2025-04-11 20:03:57 +00:00
0f59894d66 Hide sweep artifacts after automatically (#6287)
* automatically hide the trajectory sketch agter a sweep

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

* updates

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

* more samples

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

* more samples

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-04-11 15:53:53 -04:00
74c07fc0eb Update onboarding bracket to be robust (#6099)
* update onboarding bracket to be robust

* update onboarding bracket with bends

* checking if asserts causing parse failure

* fun fact, it was not the asserts

* fix bracket loading

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: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2025-04-11 19:27:29 +00:00
67a8bf525d bump kcl friends (#6288)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-11 19:10:37 +00:00
129b91518f Don't bail command palette if there's no engineConnection (#6286)
The connection can't be bad if there is not yet `:galaxy-brain:`.

But seriously this behavior regressed share links because we would bail
from the command palette because the connection wasn't healthy.
2025-04-11 18:24:56 +00:00
c0aa763c3b initPromise in main.ts (#6285)
* initPromise in main.ts

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

* move initPromise so dep tree doesnt shit the bed

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-11 18:17:46 +00:00
319c60d4fa BREAKING: Change tangential arc to keyword args (#6266)
* Change tangentialArc, tangentialArcTo, and tangentialArcToRelative to keyword args

* Change tangentialArc offset to angle and convert to kw arg calls

* Fix lints

* Fix sketch errors and all unit tests passing

* Fix tangentialArcTo calls in KCL samples

* Update tangentialArc in samples

* Update sim test output

* Fix formatting

* Fix mistake in merge

* Fix gear rack sample

* Update output after more samples fixes

* Update gear rack output

* Add end label to docs snippet

* Fix to not add endAbsolute for an arc with radius or angle arguments

* Update docs outputs

* Fix formatting

* Fix executor tests

* Fix formatting

* Fix bench input files

* Fix spelling

* Improve error messages

---------

Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
2025-04-11 14:17:20 -04:00
66f95d25f6 Don't let too-tall line height goof up action buttons (#6253) 2025-04-11 14:06:36 -04:00
72ab72cea1 Bump vite from 6.2.5 to 6.2.6 in /packages/codemirror-lang-kcl in the security group (#6280)
Bump vite in /packages/codemirror-lang-kcl in the security group

Bumps the security group in /packages/codemirror-lang-kcl with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 6.2.5 to 6.2.6
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v6.2.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v6.2.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.2.6
  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-04-11 16:28:43 +00:00
4e1e9f9c6e Bump vite from 5.4.17 to 5.4.18 in the security group (#6281)
Bumps the security group with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 5.4.17 to 5.4.18
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.18/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.18/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.18
  dependency-type: direct:development
  dependency-group: security
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 16:24:24 +00:00
8b14d32879 Bump the security group in /rust with 2 updates (#6212)
Bumps the security group in /rust with 2 updates: [pyo3](https://github.com/pyo3/pyo3) and [tokio](https://github.com/tokio-rs/tokio).


Updates `pyo3` from 0.24.0 to 0.24.1
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/v0.24.1/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.24.0...v0.24.1)

Updates `tokio` from 1.44.1 to 1.44.2
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.44.1...tokio-1.44.2)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.24.1
  dependency-type: direct:production
  dependency-group: security
- dependency-name: tokio
  dependency-version: 1.44.2
  dependency-type: direct:production
  dependency-group: security
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 16:12:53 +00:00
7c5170dc16 Use the correct variable for the main branch (#6278) 2025-04-11 15:04:28 +00:00
a07dbc3aac chore: stabilizing named views e2e tests (#6246)
* fix: moving toast application state:

* fix: forgot the await on the expect calls, ts didn't yell at me?

* fix: cleaning up the camera move e2e code

* fix: lint,tsc,fmt

* Unblock on macOS for now

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
2025-04-11 10:32:44 -04:00
7d3294ff78 Quick fix for windows codesign failures with digicert (#6275)
* pierremtb/issue6256-another-test

* yarn to npm install

* Revert "yarn to npm install"

This reverts commit 4a3daf950f.

* yarn to npm install

* Force IS_RELEASE=true

* Clean up for review
2025-04-11 14:31:44 +00:00
121c393466 UI fix for comment settings collision (#6249)
* UI fix for comment settings collision

* fmt

* Fix tsc by using Promise.reject

---------

Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
2025-04-11 14:16:45 +00:00
c6ec54c138 Send test results to an API for analysis (#6261)
* Send test results to an API

* Include platform

* Include target

* Return earlier

* Include actual commit SHA

* Include PR number

* Rename variables for clarity
2025-04-11 10:04:13 -04:00
1f6b90d383 #6182 Improve calculate_circle_center (#6192)
* add tests for calculate_circle_center - the first one succeeds with the current impl

* fix calculate_circle_center

* comment cleanup

* clippy

* comment format

* update circle_three_point sim test snapshot for slight floating point changes introduced by calculate_circle_center refactor

* use TAU instead of 2 * PI

* clippy
2025-04-11 12:43:18 +02:00
c45c2e27ba make sure the nix flake never breaks (#6273)
make sure teh nix flake never breaks

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-11 06:27:42 +00:00
5832890dbb Add CSG operations to the artifact graph (#6104)
* Add CSG operations to the artifact graph

* Add tool IDs for subtract

* Fix names to match modeling-cmds now that it's done

* Update output since adding CSG ops

* Update formatting

* Add extra solid ids to the graph

* Fix to not add duplicates to the graph
2025-04-11 05:16:29 +00:00
6f2e6d14b6 refactor: Change to use topLevelModule helper function (#6264) 2025-04-11 05:13:10 +00:00
0d899694b2 Remove experimental warning on whole-module imports (#6240) 2025-04-11 04:22:51 +00:00
7bd5e7365d Insert a newline between block comments and attributes (#6250)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2025-04-11 03:19:52 +00:00
a63e51e2ad Remove import function from std (#6241)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-11 03:11:59 +00:00
1b8eee86a1 Fix vscode lsp bugs (#6271)
* start of shit

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

* untitled test

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-04-11 12:53:05 +10:00
6d50278d34 bump kcl friends (#6272)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-10 19:01:30 -07:00
35844842de Bump modeling api & pull thru csg endpoints (#6245)
* csg-upts

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

* base

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

* do the id shit

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

* tried to run

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

* csg-upts

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

* use bens samples

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

* use bens samples

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

* gen std

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

* gen std

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>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-10 18:30:57 -07:00
843e772094 Franknoirot/adhoc/improve e2e (#6265)
* fix: increasing timeout to reduce failures..?

* fix: removing debugging code

* Remove unnecessary pixel color check

* Only close the command palette on disconnection events

This code closes the palette on *any* network event, including it
getting established. This made tests like "Create a few projects using
the default project name" unreliable.

Also adds a block comment about how we should do something more
sophisticated than bail out in the future.

* Show a toast to explain why the user just lost their command flow

* Remove unnecessary click in test. `fill` focuses already

* Oop don't spam this disconnection toast if the palette isn't open

Honoring exhausting hook dependency checks

* Skip circle snapshot test, it's being weird

* Disable the export button if engine connection is unavailable

* Refactor useDemoCode to hopefully be more reliable

* allow weak connections to receive demo code

* revert Refactor useDemoCode to hopefully be more reliable
Commit:
2625c14783 [2625c1478]

---------

Co-authored-by: Kevin Nadro <kevin@zoo.dev>
Co-authored-by: Jace Browning <jacebrowning@gmail.com>
Co-authored-by: Andrew Varga <grizzly33@gmail.com>
2025-04-11 00:08:39 +00:00
9d0518dfeb Fix URL encoded names after rename to Zoo Design Studio (#6269) 2025-04-10 17:20:37 -04:00
d33d399c31 Repetitive structs removed for import file extensions (#6211)
* get rid of repetitive structs

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

fmt

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

get rid of more

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

add more

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>

updates

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

await the shit

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

updates

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

put it at the root

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

* updates

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

* fix;es

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

* fixes

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

* fix

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

* kcl-language-server flake

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-04-10 13:57:12 -07:00
970cf7f017 skip unreliable AI tests (#6252)
skip unrealiable AI tests
2025-04-10 12:10:57 -04:00
d125efcd60 Bidirectional extrude/revolve (#6154)
* extend extrude endpoint

* revolve and mocks

* add bounds check to revolve

* kcl examples of new args

* update to 110

* fix mock

* move example to prelude

* change to camelCase

* new prelude tests

* extend just file

* missed change

* change to XY

* redo sim tests

* review changes

* redo markdown
2025-04-10 10:46:10 -04:00
4664427832 Add a sidebar action to create a share link (#6233) 2025-04-10 00:27:22 +00:00
d84b9cc875 Remove flaky pixel check from prompt-to-edit test (#6225)
remove flaky pixel check
2025-04-10 00:06:38 +00:00
0c6b6bf5d5 Fix bad merge with some KCL snapshots (#6239)
Caused by admin merge in #5803
2025-04-09 16:43:56 -04:00
d275995dfe KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).

Before vs. after:

`angledLine({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, length = 3, tag = $edge)`

`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, lengthX = 3, tag = $edge)`

`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, lengthY = 3, tag = $edge)`

`angledLineToX({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`

`angledLineToY({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
2025-04-09 14:55:15 -05:00
b03ca30379 Cleanup spatula example. (#6232)
* Cleanup spatula example. Naming better variables and removing unused tags

* Update kcl-samples simulation test output

* remove unused tag

* fix spacing

* Update kcl-samples simulation test output

* cleanup comments

* Update kcl-samples simulation test output

* re-add spacing

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Greg Sweeney <greg@kittycad.io>
Co-authored-by: jgomez720 <114548659+jgomez720@users.noreply.github.com>
2025-04-09 15:21:05 -04:00
e5f23a49b4 #4469 Improve toolbar ux (#5841)
* Improve ActionButtonDropdown selection

* center rectangle icon fixed

* ignore Esc key when displaying hotkeys

* add ability to escape 3 point circle tool

* remove focus from ActionButton, ActionButtonDropdown

* remove focus outline from buttons

* remember lastly selected multi action item

* Add tests for toolbar buttons

* fix sketch-tests by turning toolbar dropdown arrays into an object with an id - this got broken because dropdown now remember the last selected option so we cant rely on cant reference the first option in tests

* update other tests with open menu click
2025-04-09 14:32:52 +02:00
e78100eaac Assemblies: UX improvements around foreign file imports (#6159)
* WIP: Add point-and-click Import for geometry
Will eventually fix #6120
Right now the whole loop is there but the codemod doesn't work yet

* Better pathToNOde, log on non-working cm dispatch call

* Add workaround to updateModelingState not working

* Back to updateModelingState with a skip flag

* Better todo

* Change working from Import to Insert, cleanups

* Sister command in kclCommands to populate file options

* Improve path selector

* Unsure: move importAstMod to kclCommands onSubmit 😶

* Add e2e test

* Clean up for review

* Add native file menu entry and test

* No await yo lint said so

* WIP: UX improvements around foreign file imports
Fixes #6152

* @lrev-Dev's suggestion to remove a comment

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

* Update to scene.settled(cmdBar)

* Add partNNN default name for alias

* Lint

* Lint

* Fix unit tests

* Add sad path insert test
Thanks @Irev-Dev for the suggestion

* Add step insert test

* Lint

* Add test for second foreign import thru file tree click

* Add default value for local name alias

* Aligning tests

* Fix tests

* Add padding for filenames starting with a digit

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-04-09 07:47:57 -04:00
ae9d8be4e4 Don't apply numeric adjustments in arithmetic yet (#6222)
Don't apply numeric adjustments yet

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-09 14:16:58 +12:00
e4f73a6d5c Continue running tests with weak network (#6223) 2025-04-09 02:13:38 +00:00
a31fd608cf Improve hovers for KCL std lib fns (#6208)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-09 12:15:12 +12:00
a98d5aa2fb Fix to not filter out empty modules from the Feature Tree (#6224) 2025-04-08 23:56:27 +00:00
4c6ef841bb Handle PowerShell vs. Git Bash on Windows (#6207) 2025-04-08 23:47:56 +00:00
997f539a8c More numeric type propagations (#6221)
Last few numeric type propagations

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-09 11:46:54 +12:00
83f74faaf7 fix nix (#6213)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Adam Sunderland <adam@kittycad.io>
2025-04-08 19:06:47 +00:00
0bb5797377 Fix unclickable state while opening share link in browser (#6201)
* Fix unclickable state, don't show warning if query present

* Leave a note about need for a web test

* Fix browser share links by waiting for network connection

* Don't worry about engineConnection on home route
2025-04-08 13:10:49 -04:00
c3097aa334 fix missing extension (#6205)
* fix missing extension

* fix e2e

* better name
2025-04-08 15:41:48 +00:00
2cd0fcc9a7 #6157 Dispatch wheel event to camControls when hovering segment label (#6158)
dispatch wheel event to camControls when hovering segment label
2025-04-08 11:12:12 -04:00
5b653fb558 Change unit conversion functions to operate on input rather than return a conversion factor (#6181)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-08 02:21:23 +00:00
6a5b23f848 Bump the minor group with 7 updates (#6191)
Bumps the minor group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [three](https://github.com/mrdoob/three.js) | `0.174.0` | `0.175.0` |
| [@types/three](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/three) | `0.174.0` | `0.175.0` |
| [@electron-forge/cli](https://github.com/electron/forge) | `7.7.0` | `7.8.0` |
| [@electron-forge/plugin-fuses](https://github.com/electron/forge) | `7.7.0` | `7.8.0` |
| [@electron-forge/plugin-vite](https://github.com/electron/forge/tree/HEAD/packages/plugin/vite) | `7.7.0` | `7.8.0` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `22.13.14` | `22.14.0` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.26.1` | `8.29.0` |


Updates `three` from 0.174.0 to 0.175.0
- [Release notes](https://github.com/mrdoob/three.js/releases)
- [Commits](https://github.com/mrdoob/three.js/commits)

Updates `@types/three` from 0.174.0 to 0.175.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/three)

Updates `@electron-forge/cli` from 7.7.0 to 7.8.0
- [Release notes](https://github.com/electron/forge/releases)
- [Changelog](https://github.com/electron/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/electron/forge/compare/v7.7.0...v7.8.0)

Updates `@electron-forge/plugin-fuses` from 7.7.0 to 7.8.0
- [Release notes](https://github.com/electron/forge/releases)
- [Changelog](https://github.com/electron/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/electron/forge/compare/v7.7.0...v7.8.0)

Updates `@electron-forge/plugin-vite` from 7.7.0 to 7.8.0
- [Release notes](https://github.com/electron/forge/releases)
- [Changelog](https://github.com/electron/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/electron/forge/commits/v7.8.0/packages/plugin/vite)

Updates `@types/node` from 22.13.14 to 22.14.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@types/three` from 0.174.0 to 0.175.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/three)

Updates `typescript-eslint` from 8.26.1 to 8.29.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.29.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: three
  dependency-version: 0.175.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@types/three"
  dependency-version: 0.175.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@electron-forge/cli"
  dependency-version: 7.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@electron-forge/plugin-fuses"
  dependency-version: 7.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@electron-forge/plugin-vite"
  dependency-version: 7.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@types/node"
  dependency-version: 22.14.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: "@types/three"
  dependency-version: 0.175.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
- dependency-name: typescript-eslint
  dependency-version: 8.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 22:24:57 +00:00
a480783ee8 Quick app rename typo fix in settings.md (#6198) 2025-04-07 21:09:27 +00:00
bc0f5b5787 Add point-and-click Insert from local project files (#6129)
* WIP: Add point-and-click Import for geometry
Will eventually fix #6120
Right now the whole loop is there but the codemod doesn't work yet

* Better pathToNOde, log on non-working cm dispatch call

* Add workaround to updateModelingState not working

* Back to updateModelingState with a skip flag

* Better todo

* Change working from Import to Insert, cleanups

* Sister command in kclCommands to populate file options

* Improve path selector

* Unsure: move importAstMod to kclCommands onSubmit 😶

* Add e2e test

* Clean up for review

* Add native file menu entry and test

* No await yo lint said so

* @lrev-Dev's suggestion to remove a comment

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

* Update to scene.settled(cmdBar)

* Lint

---------

Co-authored-by: Kurt Hutten <k.hutten@protonmail.ch>
2025-04-07 20:28:11 +00:00
962eb0e376 Install and start Vector on macOS CI runners (#6147)
* Install vector on macOS

* Include platform information
2025-04-07 20:22:27 +00:00
ababe24b97 Implement polar std function in KCL (#6180)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-07 15:16:43 -05:00
1bf7a2abd4 Bump typescript from 5.8.2 to 5.8.3 in /packages/codemirror-lsp-client in the patch group (#6188)
Bump typescript in /packages/codemirror-lsp-client in the patch group

Bumps the patch group in /packages/codemirror-lsp-client with 1 update: [typescript](https://github.com/microsoft/TypeScript).


Updates `typescript` from 5.8.2 to 5.8.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 20:12:36 +00:00
0ea4f94e8f Bump @types/node from 22.13.13 to 22.14.0 in /packages/codemirror-lsp-client in the minor group (#6189)
Bump @types/node in /packages/codemirror-lsp-client in the minor group

Bumps the minor group in /packages/codemirror-lsp-client with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 22.13.13 to 22.14.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 22.14.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 17:50:09 +00:00
6cc6130b6a Bump the major group in /packages/codemirror-lang-kcl with 2 updates (#6194)
Bumps the major group in /packages/codemirror-lang-kcl with 2 updates: [vite-tsconfig-paths](https://github.com/aleclarson/vite-tsconfig-paths) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest).


Updates `vite-tsconfig-paths` from 4.3.2 to 5.1.4
- [Release notes](https://github.com/aleclarson/vite-tsconfig-paths/releases)
- [Commits](https://github.com/aleclarson/vite-tsconfig-paths/compare/v4.3.2...v5.1.4)

Updates `vitest` from 2.1.9 to 3.1.1
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v3.1.1/packages/vitest)

---
updated-dependencies:
- dependency-name: vite-tsconfig-paths
  dependency-version: 5.1.4
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
- dependency-name: vitest
  dependency-version: 3.1.1
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 17:44:10 +00:00
8294903cd0 Bump taiki-e/install-action from 2.49.30 to 2.49.45 in the patch group (#6185)
Bumps the patch group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.49.30 to 2.49.45
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.49.30...v2.49.45)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 17:43:36 +00:00
7b7379c3dd Bump the patch group with 6 updates (#6186)
Bumps the patch group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [@kittycad/lib](https://github.com/KittyCAD/kittycad.ts) | `2.0.26` | `2.0.28` |
| [@lezer/generator](https://github.com/lezer-parser/generator) | `1.7.2` | `1.7.3` |
| [@types/wicg-file-system-access](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/wicg-file-system-access) | `2023.10.5` | `2023.10.6` |
| [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.0` | `8.18.1` |
| [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) | `7.37.4` | `7.37.5` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.8.2` | `5.8.3` |


Updates `@kittycad/lib` from 2.0.26 to 2.0.28
- [Release notes](https://github.com/KittyCAD/kittycad.ts/releases)
- [Commits](https://github.com/KittyCAD/kittycad.ts/compare/v2.0.26...v2.0.28)

Updates `@lezer/generator` from 1.7.2 to 1.7.3
- [Changelog](https://github.com/lezer-parser/generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/generator/compare/1.7.2...1.7.3)

Updates `@types/wicg-file-system-access` from 2023.10.5 to 2023.10.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/wicg-file-system-access)

Updates `@types/ws` from 8.18.0 to 8.18.1
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Updates `eslint-plugin-react` from 7.37.4 to 7.37.5
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.37.4...v7.37.5)

Updates `typescript` from 5.8.2 to 5.8.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: "@kittycad/lib"
  dependency-version: 2.0.28
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: "@lezer/generator"
  dependency-version: 1.7.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: "@types/wicg-file-system-access"
  dependency-version: 2023.10.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: "@types/ws"
  dependency-version: 8.18.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: eslint-plugin-react
  dependency-version: 7.37.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 17:37:29 +00:00
9acdf1e42f Bump the patch group in /rust/kcl-language-server with 3 updates (#6183)
Bumps the patch group in /rust/kcl-language-server with 3 updates: [@vscode/vsce](https://github.com/Microsoft/vsce), [esbuild](https://github.com/evanw/esbuild) and [typescript](https://github.com/microsoft/TypeScript).


Updates `@vscode/vsce` from 3.3.0 to 3.3.2
- [Release notes](https://github.com/Microsoft/vsce/releases)
- [Commits](https://github.com/Microsoft/vsce/compare/v3.3.0...v3.3.2)

Updates `esbuild` from 0.25.1 to 0.25.2
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.1...v0.25.2)

Updates `typescript` from 5.8.2 to 5.8.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: "@vscode/vsce"
  dependency-version: 3.3.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: esbuild
  dependency-version: 0.25.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: typescript
  dependency-version: 5.8.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 17:03:31 +00:00
5dd95d27de Bump the patch group in /packages/codemirror-lang-kcl with 2 updates (#6193)
Bumps the patch group in /packages/codemirror-lang-kcl with 2 updates: [@codemirror/state](https://github.com/codemirror/state) and [@lezer/generator](https://github.com/lezer-parser/generator).


Updates `@codemirror/state` from 6.5.0 to 6.5.2
- [Changelog](https://github.com/codemirror/state/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/state/compare/6.5.0...6.5.2)

Updates `@lezer/generator` from 1.7.2 to 1.7.3
- [Changelog](https://github.com/lezer-parser/generator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lezer-parser/generator/compare/1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: "@codemirror/state"
  dependency-version: 6.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: patch
- dependency-name: "@lezer/generator"
  dependency-version: 1.7.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 16:48:48 +00:00
1016b4c879 Remove unnecessary timeouts waiting for command bar (#6199) 2025-04-07 16:46:16 +00:00
df6f571294 Stream handling / Stream idle mode v2; a ton of network related changes (ping; scene indicator -> stream indicator, stream resizing (even on pause)) (#5312)
* Add back stream idle mode

* Shut up codespell

* Correct serialization; only expose at user level

* cargo fmt

* tsc lint fmt

* Move engineStreamMachine as a global actor; tons of more work

* Fix up everything after bumping kittycad/lib

* Remove camera sync

* Use pause/play iconology

* Add back better ping indicator

* wip

* Fix streamIdleMode checkbox being wonky

* yarn fmt

* Massive extinction event for waitForExecutionDone; try to stop projects view switching from crashing

* Clear diagnostics when unmounting code editor!

* wip

* Rework initial root projects dir + deflake many projects tests

* More e2e fixes

* Deflake revolve some revolve tests

* Fix the rest of the mfing tests

* yarn fmt

* yarn lint

* yarn tsc

* Fix tsc after rebase

* wip

* less flaky point and click

* wip

* Fixup after rebase

* Fix more tests

* Fix 2 more

* Fix up named-views tests

* yarn fmt lint tsc

* Fix up new changes

* Get rid of 1 cyclic dependency

* Fix another cyclic mfer!

* fmt

* fmt tsc

* Fix zoom to fit being frigged

* a new list of circular deps

* Remove NetworkHealthIndicator test that was shit

* Fix the bad reload repeat issue kevin started on

* Fix zoom to fit at the right moments...

* Fix cache count numbers in editor test

* Remove a test race - poll window info.

* Qualify fail function

* Try something

* Use scene.connectionEstablished

* Hopefully fix snapshots at least

* Add app console.log

* Fix native menu tests more

* tsc lint

* Fix camera failure

* Try again

* Test attempt number 15345203, action!

* Add back old window detection heuristic

* Remove firstWindow to complete the work of 2342d04fe2

* Tweak some tests for MacOS

* Tweak "set appearance" test for MacOS

Revert this if it messes up any other platform's color checks!

* Are you serious? This was all that needed formatting?

* More color tweaks

Local MacOS and CI MacOS don't agree

* Fixes on apperance e2e test for stream idle branch (#6168)

pierremtb/stream-idle-revamp-appearance-fixes

* Another apperance fix

* Skip one native menu test to make stream idle green (#6169)

* pierremtb/stream-idle-revamp-more-fixes

* Fix lint

* Update snapshot for test_generate_settings_docs

---------

Co-authored-by: lee-at-zoo-corp <lee@zoo.dev>
Co-authored-by: Frank Noirot <frankjohnson1993@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
2025-04-07 07:08:31 -04:00
be05dd7ba1 More propagation of numeric types (#6177)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-07 19:02:41 +12:00
bc22d888ee Apply type-directed coercions to arguments in calls of user functions (#6179)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-07 18:02:46 +12:00
e6ae89ebf9 Erase comment start positions from snapshot tests (#6178)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-07 17:42:15 +12:00
e7b23e1638 Implement coercion of numeric types for ascription and arithmetic (off by default) (#6175)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-07 16:13:15 +12:00
ce7a967f5f Reduce the number of reps in the add_lots test (#6174)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-06 22:41:48 -04:00
38446b5b2a take things off the batch in a more safe way (#6171)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-06 03:54:32 +00:00
48e1a8ed02 attempt to import win-ca on windows (#6136)
* attempt to import win-ca on windows

otherwise we won't see system x509 cert authorities, which leaves people
high and dry if they're using an enterprise mitm tls box (😢)
2025-04-05 16:30:48 +00:00
a059166b9c Upgrade e2e-tests windows runner from 4 cores to 8 (#6166)
* Change e2e-tests runner to windows-latest-8-cores

* Clean up for PR
2025-04-05 08:44:50 -07:00
086a2b851d Follow-up fixes after bearing sample rename (#6164) 2025-04-05 11:00:47 +00:00
8e4c5fb24d Add test for #5799: "Only showing axis planes when there are no errors" (#6007)
* first pass at adding test for Only showing axis planes when there are no errors

* fix test Only show axis planes when there are no errors

* PR feedback
2025-04-04 23:41:09 +02:00
6993893600 Wait for export button to make test more reliable (#6143) 2025-04-04 16:53:57 -04:00
bfdf8babed sketching on a mirror2d thats been extruded fixed! (#6149)
* updates

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

* snap

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

* fixes

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

* add sample

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>

* fixes

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

* snap

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-04 12:55:21 -07:00
4d31fb890d Bump vite from 5.4.16 to 5.4.17 in /packages/codemirror-lang-kcl in the security group (#6150)
Bump vite in /packages/codemirror-lang-kcl in the security group

Bumps the security group in /packages/codemirror-lang-kcl with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 5.4.16 to 5.4.17
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.17/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.17/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.17
  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-04-04 18:57:20 +00:00
ef451fd8f7 Bump vite from 5.4.16 to 5.4.17 in the security group (#6151)
Bumps the security group with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 5.4.16 to 5.4.17
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.17/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.17/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 5.4.17
  dependency-type: direct:development
  dependency-group: security
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-04 18:40:35 +00:00
656eb0abec Update all KCL-Samples to be more ME friendly (#6132)
* update all kcl-samples

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

* Update kcl-samples simulation test output

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-04 11:03:13 -07:00
a7896329f7 Shorten feedback cycle for legitimate failures (#6146)
Stop sooner with legitimate failures
2025-04-04 17:29:29 +00:00
b9e11ac201 Remove the camera projection toggle from the UI (#6077)
* Remove E2E test behavior for projection toggle UI

Even though the test is `fixme`'d this should make it easier to
ressurect. The test is still flaky but it runs now.

* Remove projection toggle from the UI
2025-04-04 16:41:56 +00:00
1aa27bd91c Use all available CPUs to run tests on CI (#6138)
* Use all available CPUs to run tests on CI

* Use less than 100% based on research

* Ensure proper types for worker value
2025-04-04 11:11:26 -04:00
118ec28b04 [fix] Get rid of risky useEffect in restart onboarding flow (#6133)
Get rid of risky useEffect in restart onboarding flow

In certain cases this would cause an infinite loop in the web version of
the app. We should eliminate all uses of this "fire and listen with a
useEffect" antipattern in the code base, it was a mistake I introduced.
This uses the XState `waitFor` function to wait **only once** for the
transition to complete, with some error handling in case it fails.
2025-04-04 14:24:30 +00:00
449b43792b Feature: Traditional menu actions in desktop application part II (#6030)
* chore: skeleton for building and creating menus. Need electron to renderer interface to dynamically set the menu

* chore: skeleton typing for communication between nodes and web side

* chore: more skeleton for the different roles within the menu options, need more type safety

* chore: adding more skeleton and templates of what the menus could be

* chore: implemented first pass for helpRole links

* fix: syntax issue stopped the build step

* feature: loading different menus based on your page

* feature: Home page file role implemented

* chore: handling the build workflow for the signin page

* fix: moving edit actionst to the edit menu

* chore: adding preferences to the file role

* chore: redoing help roles based on the question mark widget

* fix: auto fmt

* chore: examples of accelerator strings for Menu.MenuItems keyboard shortcuts!

* chore: oddly specific toggle API for disabling MenuItems from JS. No rules!

* fix: do not implement a custom label disable thingy, use id on menu and use the native APIga

* fix: auto fmt

* fix: adding some typechecks and auto fmt fixes

* fix: trying to fix custom type?

* fix: nvm we back, the lsp on my editor borked for a second

* fix: adding one more level to the custom type for the labels

* chore: cleaning up type definitions to read easier

* fix: resolving yarn lint errors

* chore: adding file sign out

* chore: adding more file bar actions

* chore: ready for PR draft

* fix: preemptive GC collectoin bug fix if somehow a user interacts with a menu while it is being GCed

* fix: linking the OG source

* fix: set application menu to null to avoid default electron menu

* chore: trying to add more typescript

* chore: BIG workflow changes... better typing, less IPC junk

* fix: remapping the icp functions to the cb option select...

* chore: all og events are rehooked up with new workflow pattern

* feat: adding more options to the native bar!

* fix: todo

* chore: cleaning up some menus and adding more

* fix: desktop vs browser and lint errors

* fix: typescript did not like sample electorn JS code for the basic templates with isMac conditionals...

* fix: PR clean up

* fix: more PR cleanup

* A snapshot a day keeps the bugs away! 📷🐛

* fix: added the new help menu to the default sign in and modeling page

* fix: disabled two menu actions within sign in page since they will not do anything.

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* fix: mergining main, auto fixes

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* fix: saving off progress found an IPC on/off bug thanks electron!

* fix: fixed ipc renderer off/remove listener bug

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* chore: skeleton layout for the file menu in the modeling page.

* fix: adding types

* A snapshot a day keeps the bugs away! 📷🐛

* fix: more skeleton

* feat: adding file preferences project settings

* feat: adding share current part link to file menu

* fix: report a bug to refresha and report a bug

* fix: new type for webContents send payload that does not brick TS

* fix: removing import file from url since it is not working in the command palette for manual user input

* fix: removing old comment

* chore: adding user default units

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* fix: trying to create a new file but I don't think this the correct workflow...

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* fix: disabling create a file and folder until we get it properly implemented at the commad bar level

* fix: hooking up more commands

* fix: auto fixes

* chore: adding standard views

* chore: adding some E2E tests.

* chore: added E2E tests for each file menu

* fix: auto fixes

* chore: adding more edit role E2E tests

* chore: e2e test

* chore: adding help role e2e test

* A snapshot a day keeps the bugs away! 📷🐛

* chore: e2e test for all the menu options you can interact with in the frontend

* chore: hooking up more menu actions

* chore: adding pane actions

* fix: mac only menu fix and added start sketch

* chore: big edit for state management and command registration

* fix: auto fixes, tsc

* fix: codespell typo

* chore: implementing E2E tests for the menus since we cleared them.

* chore: file export current part e2e test

* chore: added all file role tests in modeling page

* chore: modeling page edit e2e tests

* chore: implemented view e2e test for modeling page

* chore: add all design e2e playright tests

* fix: auto linter,fmt

* chore: added modeling help role e2e tests

* fix: ugh this function isn't available in electron evalulate

* fix: new default project name

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
2025-04-04 08:39:02 -05:00
f1e95156ea [Bug] fix some UI friction from imports (#6139)
* fix some UI friction from imports

* add test

* console

* Jon's comments
2025-04-04 19:38:53 +11:00
45e5b25cda Use scene fixture to make test more reliable on macOS (#6140) 2025-04-04 08:35:15 +00:00
bdec611cf3 Fix: function composition during playwright setup created a massive page.reload loop (#6137)
fix: prevented the largest function composition known to man
2025-04-04 03:36:51 +00:00
fa612d5f28 Alternative way to make appMachine spawned children type safe (#5890)
Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-04-04 03:25:54 +00:00
d270447777 [BUG] mutate ast to keep comments for pipe split ast-mod (#6128)
* mutate ast to keep comments

* remove commented out code

* fix case where no comments in split
2025-04-04 14:01:23 +11:00
1a59fc4f99 Rename the app to Zoo Design Studio (#5974)
* WIP: Change the name of the app
Fixes #5971

* Force release build

* More renames

* Fix release builds on PR

* Remove alpha on home page, replace with nightly if nightly

* Change appId back to dev.zoo.modeling-app after updater test failure

* Cleanup towards review

* Lint

* Lint plus @jacebrowning's suggestion

* Lint
2025-04-03 22:24:51 -04:00
d38dcb9ba2 Add grouping of module instances in Feature Tree (#6125)
* Rename operations to be more generic grouping

* Add group enum

* Add module instance groups

* Change to export all operation ts-rs types to the same file

* Fix Feature Tree display of modules to use name

* Ignore clippy warning

* Update output after operation changes

* Change module instances in Feature Tree use to import icon

* Fix error message when attempting to delete module instance
2025-04-04 02:10:39 +00:00
c7b348390e Add test for #4391: "Can't select line on top of axis" (#6035)
* disable fixed PR temporarily and add test draft

* make the test empty

* fix test for selecting line on main axis

* PR feedback
2025-04-03 23:08:52 +02:00
bf6c91932c Upgrade to rust toolchain 1.86 (#6134) 2025-04-03 19:59:26 +00:00
716ed3acb3 Change default project name to 'untitled' (#5998)
* Change default project name to 'untitled'

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* A snapshot a day keeps the bugs away! 📷🐛

* Clean up

* More renaming

* Fix test

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-03 11:38:52 -07:00
65e08bea92 Feature: Disable all automatic zoom_to_fit workflows. Do not take control of users camera. (#6076)
chore: removing all force zoom_to_fit workflows in the system except on initial stream load


sending it
2025-04-03 10:58:18 -05:00
74859e99e7 Add STUN-based RTT (#6110)
* add stun rtt

* fix

* update for future types

* update

---------

Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2025-04-03 16:47:22 +02:00
aad583be2e Move axes to std constants; move helix, revolve, and mirror2d to be declared in KCL (#6105)
Move axes to std constants; move helix, revolve, and mirror2d to be declated in KCL

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-03 09:44:52 +00:00
3e4505e2e3 [refactor] remove 6 floating-promise ignores (#5985)
* Remove trivial floating promise in authMachine

* Add catch statement so LSP promise is considered non-floating

* Remove trivial float in AllSettingsFields

* Add error reporting for ensureWasmInit

* Remove pointless floating promise in Modeling

* Add comment and reportRejection to floating promise in "set selection"

* Read comment, put back await that should be there

* Fix dumb imports rebase botch

* Missed an import

---------

Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
2025-04-03 02:53:10 +00:00
1fe1cfb397 Syntax sugar booleans (+ and -) which is intuitive for MEs (#6124)
* updates

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

* docs

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

* docs

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-03 02:13:03 +00:00
2f721c84ed Bump vite from 5.4.12 to 5.4.16 in the security group (#6118)
Bumps the security group with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 5.4.12 to 5.4.16
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.16/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.16/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  dependency-group: security
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-02 22:46:30 +00:00
9112ff8c0a Bump vite from 5.4.14 to 5.4.16 in /packages/codemirror-lang-kcl in the security group (#6117)
Bump vite in /packages/codemirror-lang-kcl in the security group

Bumps the security group in /packages/codemirror-lang-kcl with 1 update: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `vite` from 5.4.14 to 5.4.16
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.16/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.16/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  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-04-02 22:22:17 +00:00
96e12b5aba update transform samples with mesh moving (#6080)
* update transform samples with mesh moving

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

* chjanges

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

* updates

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

* update docs

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-02 15:11:06 -07:00
bec3ba71cd More circular deps fixed (#6121)
* 23

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

* 22

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

* 21

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

* fix known

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

* fixes

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

* cleanup

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

* cleanup

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

* 20

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

* 11

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

* 11

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-04-02 15:10:57 -07:00
c6766d2a73 bump kcl and friends (#6122)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-04-02 14:28:32 -07:00
2328 changed files with 6539670 additions and 559960 deletions

View File

@ -1,3 +1,4 @@
[codespell]
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/kcl/*.md,.yarn.lock,**/yarn.lock,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo
ignore-words-list: crate,everytime,inout,co-ordinate,ot,nwo,atleast,ue,afterall,ser,fromM,FromM
skip: **/target,node_modules,build,dist,./out,**/Cargo.lock,./docs/**/*.md,./e2e/playwright/lib/console-error-whitelist.ts,.package-lock.json,**/package-lock.json,./openapi/*.json,./packages/codemirror-lang-kcl/test/all.test.ts,./public/kcl-samples,./rust/kcl-lib/tests/kcl_samples,tsconfig.tsbuildinfo,./src/lib/machine-api.d.ts,./test-results,./playwright-report,./kcl-book/book

View File

@ -1,3 +1,5 @@
# DO NOT commit secrets, overrides go in the ignored `.env.development.local`
NODE_ENV=development
DEV=true
@ -7,7 +9,11 @@ VITE_KC_SITE_BASE_URL=https://dev.zoo.dev
VITE_KC_SITE_APP_URL=https://app.dev.zoo.dev
VITE_KC_SKIP_AUTH=false
VITE_KC_CONNECTION_TIMEOUT_MS=5000
# ONLY add your token in .env.development.local if you want to skip auth, otherwise this token takes precedence!
#VITE_KC_DEV_TOKEN="your token from dev.zoo.dev should go in .env.development.local"
#VITE_KC_DEV_TOKEN="optional token to skip auth in the app"
#token="required token for playwright. TODO: clean up env vars in #3973"
RUST_BACKTRACE=1
PYO3_PYTHON=/usr/local/bin/python3
#KITTYCAD_API_TOKEN="required token for engine testing"
FAIL_ON_CONSOLE_ERRORS=true

View File

@ -19,6 +19,11 @@
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended"
],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-array-constructor": "off", // This is wrong; use the @typescript-eslint one instead.
"@typescript-eslint/no-array-constructor": "error",
@ -61,6 +66,7 @@
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-autofocus": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"react/no-unknown-property": "error",
"no-restricted-globals": [
"error",
{
@ -81,6 +87,14 @@
{
"selector": "CallExpression[callee.object.name='TOML'][callee.property.name='parse']",
"message": "Do not use TOML.parse directly. Use the wrappers in test-utils instead like tomlToSettings."
},
{
"selector": "CallExpression[callee.property.name='split'] > Literal[value='/']",
"message": "Avoid using split with '/'."
},
{
"selector": "CallExpression[callee.property.name='join'] > Literal[value='/']",
"message": "Avoid using join with '/'."
}
],
"no-restricted-imports": [

View File

@ -1,5 +1,5 @@
name: Bug Report
description: File a bug report for the Zoo Modeling App
description: File a bug report for the Zoo Design Studio
title: "[BUG]: "
labels: ["bug"]
assignees: []
@ -70,7 +70,7 @@ body:
id: version
attributes:
label: Version
description: "The version of the Zoo Modeling App you're using."
description: "The version of the Zoo Design Studio you're using."
placeholder: "example: v0.15.0. You can find this in the settings."
validations:
required: true

View File

@ -7,11 +7,11 @@ if [[ ! -f "test-results/.last-run.json" ]]; then
# If no last run artifact, than run Playwright normally
echo "run playwright normally"
if [[ "$3" == *ubuntu* ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --shard=$1/$2 || true
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --shard=$1/$2 || true
elif [[ "$3" == *windows* ]]; then
yarn test:playwright:electron:windows -- --shard=$1/$2 || true
npm run test:playwright:electron -- --grep=@windows --shard=$1/$2 || true
elif [[ "$3" == *macos* ]]; then
yarn test:playwright:electron:macos -- --shard=$1/$2 || true
npm run test:playwright:electron -- --grep=@macos --shard=$1/$2 || true
else
echo "Do not run Playwright. Unable to detect os runtime."
exit 1
@ -26,16 +26,16 @@ max_retries=1
# Retry failed tests, doing our own retries because using inbuilt Playwright retries causes connection issues
while [[ $retry -le $max_retries ]]; do
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
status=$(jq -r '.status' test-results/.last-run.json)
if [[ "$status" == "failed" ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
if [[ "$3" == *ubuntu* ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --last-failed || true
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:playwright:electron -- --last-failed || true
elif [[ "$3" == *windows* ]]; then
yarn test:playwright:electron:windows -- --last-failed || true
npm run test:playwright:electron -- --grep=@windows --last-failed || true
elif [[ "$3" == *macos* ]]; then
yarn test:playwright:electron:macos -- --last-failed || true
npm run test:playwright:electron -- --grep=@macos --last-failed || true
else
echo "Do not run playwright. Unable to detect os runtime."
exit 1
@ -56,10 +56,11 @@ done
echo "retried=false" >>$GITHUB_OUTPUT
if [[ -f "test-results/.last-run.json" ]]; then
failed_tests=$(jq '.failedTests | length' test-results/.last-run.json)
if [[ $failed_tests -gt 0 ]]; then
# If it still fails after 3 retries, then fail the job
status=$(jq -r '.status' test-results/.last-run.json)
if [[ "$status" == "failed" ]]; then
# If it still fails after retries, then fail the job
exit 1
fi
fi
exit 0

24
.github/ci-cd-scripts/start-vector-macos.sh vendored Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
# Install vector
brew tap vectordotdev/brew && brew install vector
# Configure vector
mkdir -p /tmp/vector
cp .github/workflows/vector.toml /tmp/vector.toml
sed -i '' "s#OS_NAME#${OS_NAME}#g" /tmp/vector.toml
sed -i '' "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
sed -i '' "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
sed -i '' "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
sed -i '' "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
sed -i '' "s#GH_ACTIONS_AXIOM_TOKEN#${GH_ACTIONS_AXIOM_TOKEN}#g" /tmp/vector.toml
# Display settings
echo
echo 'Vector config:'
cat /tmp/vector.toml
echo
# Start in the background
$(brew --prefix)/opt/vector/bin/vector --config /tmp/vector.toml &

24
.github/ci-cd-scripts/start-vector-ubuntu.sh vendored Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
# Install vector
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev | bash -s -- -y
# Configure vector
mkdir -p /tmp/vector
cp .github/workflows/vector.toml /tmp/vector.toml
sed -i "s#OS_NAME#${OS_NAME}#g" /tmp/vector.toml
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${GH_ACTIONS_AXIOM_TOKEN}#g" /tmp/vector.toml
# Display settings
echo
echo 'Vector config:'
cat /tmp/vector.toml
echo
# Start in background
${HOME}/.vector/bin/vector --config /tmp/vector.toml &

41
.github/ci-cd-scripts/upload-results.sh vendored Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
set -euo pipefail
if [ -z "${TAB_API_URL:-}" ] || [ -z "${TAB_API_KEY:-}" ]; then
exit 0
fi
project="https://github.com/KittyCAD/modeling-app"
branch="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-}}"
commit="${CI_COMMIT_SHA:-${GITHUB_SHA:-}}"
echo "Uploading batch results"
curl --silent --request POST \
--header "X-API-Key: ${TAB_API_KEY}" \
--form "project=${project}" \
--form "branch=${branch}" \
--form "commit=${commit}" \
--form "tests=@test-results/junit.xml" \
--form "CI_COMMIT_SHA=${CI_COMMIT_SHA:-}" \
--form "CI_PR_NUMBER=${CI_PR_NUMBER:-}" \
--form "GITHUB_BASE_REF=${GITHUB_BASE_REF:-}" \
--form "GITHUB_EVENT_NAME=${GITHUB_EVENT_NAME:-}" \
--form "GITHUB_HEAD_REF=${GITHUB_HEAD_REF:-}" \
--form "GITHUB_REF_NAME=${GITHUB_REF_NAME:-}" \
--form "GITHUB_REF=${GITHUB_REF:-}" \
--form "GITHUB_SHA=${GITHUB_SHA:-}" \
--form "GITHUB_WORKFLOW=${GITHUB_WORKFLOW:-}" \
--form "RUNNER_ARCH=${RUNNER_ARCH:-}" \
${TAB_API_URL}/api/results/bulk
echo
echo "Sharing updated report"
curl --silent --request POST \
--header "Content-Type: application/json" \
--header "X-API-Key: ${TAB_API_KEY}" \
--data "{
\"project\": \"${project}\",
\"branch\": \"${branch}\",
\"commit\": \"${commit}\"
}" \
${TAB_API_URL}/api/share

441
.github/dependabot.yml vendored
View File

@ -16,9 +16,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -49,9 +52,408 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-python-bindings
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-to-core
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-language-server-release
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-wasm-lib
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-derive-docs
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-bumper
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-language-server
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-lib
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-lib/fuzz
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-test-server
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
- patch
major:
applies-to: version-updates
update-types:
- major
minor:
applies-to: version-updates
update-types:
- minor
- patch
- package-ecosystem: cargo
directory: /rust/kcl-directory-test-macro
schedule:
interval: weekly
day: monday
time: '03:00'
timezone: America/Los_Angeles
open-pull-requests-limit: 5
reviewers:
- adamchalmers
- franknoirot
- irev-dev
- jessfraz
groups:
security:
applies-to: security-updates
update-types:
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -82,9 +484,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -115,9 +520,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -148,9 +556,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -181,9 +592,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -214,9 +628,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -247,9 +664,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:
@ -280,9 +700,12 @@ updates:
security:
applies-to: security-updates
update-types:
- major
- minor
- patch
security-major:
applies-to: security-updates
update-types:
- major
patch:
applies-to: version-updates
update-types:

View File

@ -13,9 +13,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- name: Install dependencies
run: yarn
run: npm install
- name: Use correct Rust toolchain
shell: bash
run: |
@ -24,7 +24,7 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # Configured below.
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- name: Rust Cache
@ -32,7 +32,7 @@ jobs:
with:
workspaces: rust
- name: build wasm
run: yarn build:wasm
run: npm run build:wasm
# Upload the WASM bundle as an artifact

View File

@ -29,9 +29,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- run: yarn install
- run: npm install
- id: filter
name: Check for Rust changes
@ -77,7 +77,7 @@ jobs:
with:
cache: false # Configured below.
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
with:
tool: wasm-pack
@ -90,20 +90,20 @@ jobs:
- name: Run build:wasm
if: ${{ steps.wasm.outputs.should-build-wasm == 'true' }}
run: "yarn build:wasm"
run: "npm run build:wasm"
- name: Set nightly version, product name, release notes, and icons
if: ${{ env.IS_NIGHTLY == 'true' }}
run: |
export VERSION=${GITHUB_REF_NAME#nightly-v}
yarn files:set-version
yarn files:flip-to-nightly
npm run files:set-version
npm run files:flip-to-nightly
- name: Set release version
if: ${{ env.IS_RELEASE == 'true' }}
run: |
export VERSION=${GITHUB_REF_NAME#v}
yarn files:set-version
npm run files:set-version
- uses: actions/upload-artifact@v4
with:
@ -172,16 +172,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn' # Set this to npm, yarn or pnpm.
cache: 'npm' # Set this to npm, npm or pnpm.
- name: yarn install
# Windows is picky sometimes and fails on fetch. Step takes about ~30s
uses: nick-fields/retry@v3.0.2
with:
shell: bash
timeout_minutes: 2
max_attempts: 3
command: yarn install
- run: npm install
- name: Prepare certificate and variables (Windows only)
if: ${{ (env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true') && matrix.os == 'windows-2022' }}
@ -207,13 +200,20 @@ jobs:
smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
smksp_cert_sync.exe
smctl windows certsync
# This last line `smctl windows certsync` was added after windows codesign failures started happening
# with nightly-v25.4.10. It looks like `smksp_cert_sync.exe` used to do the sync to the local cert store,
# but stopped doing it overnight. This extra call that I randomly got from this azure-related doc page
# https://docs.digicert.com/en/digicert-keylocker/code-signing/sign-with-third-party-signing-tools/windows-applications/sign-azure-apps-with-signtool-using-ksp-library.html#sync-certificates--windows-only--618365
# seems to be doing that extra sync that we need for scripts/sign-win.js to work.
# TODO: we still need to make sign-win.js errors fail the workflow, see issue #6276
shell: cmd
- name: Build the app (debug)
if: ${{ env.IS_RELEASE == 'false' && env.IS_NIGHTLY == 'false' }}
# electron-builder doesn't have a concept of release vs debug,
# this is just not doing any codesign or release yml generation, and points to dev infra
run: yarn tronb:package:dev
run: npm run tronb:package:dev
- name: Build the app (release)
if: ${{ env.IS_RELEASE == 'true' || env.IS_NIGHTLY == 'true' }}
@ -226,14 +226,7 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
DEBUG: "electron-notarize*"
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
uses: nick-fields/retry@v3.0.2
with:
shell: bash
timeout_minutes: 10
max_attempts: 3
command: yarn tronb:package:prod
run: npm run tronb:package:prod
- name: List artifacts in out/
run: ls -R out
@ -241,7 +234,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: out-arm64-${{ matrix.platform }}
# first two will pick both Zoo Modeling App-$VERSION-arm64-win.exe and Zoo Modeling App-$VERSION-win.exe
# first two will pick both Zoo Design Studio-$VERSION-arm64-win.exe and Zoo Design Studio-$VERSION-win.exe
path: |
out/*-${{ env.VERSION_NO_V }}-win.*
out/*-${{ env.VERSION_NO_V }}-arm64-win.*
@ -288,14 +281,7 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
CSC_KEYCHAIN: ${{ secrets.APPLE_SIGNING_IDENTITY }}
WINDOWS_CERTIFICATE_THUMBPRINT: ${{ secrets.WINDOWS_CERTIFICATE_THUMBPRINT }}
DEBUG: "electron-notarize*"
# TODO: Fix electron-notarize flakes. The logs above should help gather more data on failures
uses: nick-fields/retry@v3.0.2
with:
shell: bash
timeout_minutes: 10
max_attempts: 3
command: yarn tronb:package:prod
run: npm run tronb:package:prod
- uses: actions/upload-artifact@v4
if: ${{ env.IS_RELEASE == 'true' }}
@ -378,7 +364,7 @@ jobs:
NOTES: ${{ needs.prepare-files.outputs.notes }}
PUB_DATE: ${{ github.event.repository.updated_at }}
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' }}
URL_CODED_NAME: ${{ env.IS_NIGHTLY == 'true' && 'Zoo%20Design%20Studio%20%28Nightly%29' || 'Zoo%20Design%20Studio' }}
run: |
RELEASE_DIR=https://${WEBSITE_DIR}
jq --null-input \
@ -435,7 +421,7 @@ jobs:
export TAG="nightly-${VERSION}"
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
npm run files:set-notes
- name: Authenticate to Google Cloud
if: ${{ env.IS_NIGHTLY == 'true' }}
@ -460,4 +446,4 @@ jobs:
- name: Invalidate bucket cache on latest*.yml and last_download.json files
if: ${{ env.IS_NIGHTLY == 'true' }}
run: yarn files:invalidate-bucket:nightly
run: npm run files:invalidate-bucket:nightly

View File

@ -26,12 +26,8 @@ name: cargo bench
jobs:
cargo-bench:
name: cargo bench
runs-on:
- runs-on=${{ github.run_id }}
- runner=32cpu-linux-x64
- extras=s3-cache
runs-on: ubuntu-latest
steps:
- uses: runs-on/action@v1
- uses: actions/checkout@v4
- name: Use correct Rust toolchain
shell: bash
@ -50,13 +46,12 @@ jobs:
- name: Build the benchmark target(s)
run: |
cd rust
cargo codspeed build --measurement-mode walltime
cargo codspeed build
- 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

@ -2,7 +2,6 @@ on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
@ -13,10 +12,14 @@ concurrency:
cancel-in-progress: true
name: cargo test
jobs:
cargotest:
name: cargo test
runs-on: ubuntu-latest-8-cores
build-test-artifacts:
name: Build test artifacts
runs-on:
- runs-on=${{ github.run_id }}
- runner=8cpu-linux-x64
- extras=s3-cache
steps:
- uses: runs-on/action@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
@ -34,21 +37,11 @@ jobs:
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
chmod +x /tmp/vector.sh
/tmp/vector.sh -y -no-modify-path
mkdir -p /tmp/vector
cp .github/workflows/vector.toml /tmp/vector.toml
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
cat /tmp/vector.toml
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Start Vector
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
env:
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
OS_NAME: ${{ env.OS_NAME }}
- uses: taiki-e/install-action@nextest
- name: Install just
uses: taiki-e/install-action@just
@ -90,11 +83,11 @@ jobs:
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
cargo nextest run --workspace --features artifact-graph --retries=10 --no-fail-fast --profile ci simulation_tests::kcl_samples 2>&1 | tee /tmp/github-actions.log
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
RUST_BACKTRACE: full
RUST_MIN_STACK: 10485760000
- name: Commit differences
if: steps.path-changes.outputs.outside-kcl-samples == 'false' && steps.cargo-test-kcl-samples.outcome == 'failure'
shell: bash
@ -105,9 +98,7 @@ jobs:
popd
git add \
rust/kcl-lib/tests \
public/kcl-samples/manifest.json \
public/kcl-samples/README.md \
public/kcl-samples/screenshots
public/kcl-samples
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
@ -123,27 +114,116 @@ jobs:
env:
# The default is auto, and insta behaves differently in CI vs. not.
INSTA_UPDATE: always
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
# Configure nextest when it's run by insta (via just).
NEXTEST_PROFILE: ci
RUST_BACKTRACE: full
RUST_MIN_STACK: 10485760000
- name: cargo test
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
- name: Build and archive tests
run: |
cd rust
cargo nextest archive --workspace --features artifact-graph --archive-file nextest-archive.tar.zst
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: rust/nextest-archive.tar.zst
run-test-artifacts:
name: cargo test (shard ${{ matrix.partitionIndex}})
runs-on:
- runs-on=${{ github.run_id }}
- runner=32cpu-linux-x64
- extras=s3-cache
needs: build-test-artifacts
strategy:
fail-fast: false
matrix:
partitionIndex: [1, 2, 3, 4, 5, 6]
partitionTotal: [6]
steps:
- uses: runs-on/action@v1
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.MODELING_APP_GH_APP_ID }}
private-key: ${{ secrets.MODELING_APP_GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false # Configured below.
- name: Start Vector
run: .github/ci-cd-scripts/start-vector-ubuntu.sh
env:
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
OS_NAME: ${{ env.OS_NAME }}
- uses: taiki-e/install-action@nextest
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive
- name: Run tests
shell: bash
run: |-
cp nextest-archive.tar.zst rust/nextest-archive.tar.zst
ls -lah
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
cargo nextest run \
--retries=10 --no-fail-fast --profile=ci --archive-file nextest-archive.tar.zst \
--partition count:${{ matrix.partitionIndex}}/${{ matrix.partitionTotal }} \
2>&1 | tee /tmp/github-actions.log
env:
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
RUST_MIN_STACK: 10485760000
- name: Upload to codecov.io
if: steps.path-changes.outputs.outside-kcl-samples == 'true'
uses: codecov/codecov-action@v5
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN_DEV}}
ZOO_HOST: https://api.dev.zoo.dev
- name: Upload results
if: always()
run: .github/ci-cd-scripts/upload-results.sh
env:
TAB_API_URL: ${{ secrets.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
run-wasm-tests:
name: Run wasm tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use correct Rust toolchain
shell: bash
run: |
[ -e rust-toolchain.toml ] || cp rust/rust-toolchain.toml ./
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
flags: rust
verbose: true
files: lcov.info
cache: false # Configured below.
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: './rust'
- name: Build Wasm
shell: bash
run: |
npm install
npm run build:wasm
- name: Run wasm tests
run: |
cd rust
cd kcl-wasm-lib
#wasm-pack test --headless --chrome
env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
NODE_ENV: development

View File

@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- 'src/lib/exampleKcl.ts'
- 'public/kcl-samples/bracket/main.kcl'
permissions:
contents: read
@ -22,11 +23,11 @@ jobs:
uses: actions/github-script@v7
with:
script: |
const message = '`src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
const message = '`public/kcl-samples/bracket/main.kcl` or `src/lib/exampleKcl.ts` has been updated in this PR, please review and update the `src/routes/onboarding`, if needed.';
const issue_number = context.payload.pull_request.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
@ -43,4 +44,4 @@ jobs:
issue_number,
body: message,
});
}
}

View File

@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true
jobs:
yarn-unit-test:
npm-unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -19,14 +19,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- run: yarn install
working-directory: packages/codemirror-lang-kcl
- run: npm install
- run: yarn tsc
working-directory: packages/codemirror-lang-kcl
- run: npm run tsc --workspace=packages/codemirror-lang-kcl
- name: run unit tests
run: yarn test
working-directory: packages/codemirror-lang-kcl
run: npm run test --workspace=packages/codemirror-lang-kcl

View File

@ -3,7 +3,6 @@ on:
push:
branches:
- main
- all-e2e # this bypasses `fixme()` using `orRunWhenFullSuiteEnabled()`
pull_request:
schedule:
- cron: 0 * * * * # hourly
@ -97,11 +96,11 @@ jobs:
if: needs.conditions.outputs.should-run == 'true'
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- name: Install dependencies
if: needs.conditions.outputs.should-run == 'true'
run: yarn
run: npm install
- name: Download Wasm Cache
id: download-wasm
@ -140,7 +139,7 @@ jobs:
with:
cache: false # Configured below.
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
with:
tool: wasm-pack
@ -154,7 +153,7 @@ jobs:
- name: Build Wasm
if: ${{ needs.conditions.outputs.should-run == 'true' && steps.wasm.outputs.should-build-wasm == 'true' }}
shell: bash
run: yarn build:wasm
run: npm run build:wasm
- uses: actions/upload-artifact@v4
if: needs.conditions.outputs.should-run == 'true'
@ -197,12 +196,12 @@ jobs:
if: needs.conditions.outputs.should-run == 'true'
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- name: Install dependencies
id: deps-install
if: needs.conditions.outputs.should-run == 'true'
run: yarn
run: npm install
- name: Cache Playwright Browsers
if: needs.conditions.outputs.should-run == 'true'
@ -210,27 +209,31 @@ jobs:
with:
path: |
~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
- name: Install Playwright Browsers
if: needs.conditions.outputs.should-run == 'true'
run: yarn playwright install --with-deps
run: npm run playwright install --with-deps
- name: build web
if: needs.conditions.outputs.should-run == 'true'
run: yarn tronb:vite:dev
run: npm run tronb:vite:dev
- name: Run ubuntu/chrome snapshots
if: needs.conditions.outputs.should-run == 'true'
uses: nick-fields/retry@v3.0.2
with:
shell: bash
command: yarn test:snapshots
timeout_minutes: 30
max_attempts: 3
command: npm run test:snapshots
timeout_minutes: 5
max_attempts: 5
env:
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
snapshottoken: ${{ secrets.KITTYCAD_API_TOKEN }}
TAB_API_URL: ${{ secrets.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
TARGET: web
- uses: actions/upload-artifact@v4
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
@ -273,28 +276,42 @@ jobs:
timeout-minutes: 60
env:
OS_NAME: ${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }}:${{ matrix.shardIndex }}:${{ matrix.shardTotal }}
name: playwright:electron:${{ contains(matrix.os, 'ubuntu') && 'ubuntu' || (contains(matrix.os, 'windows') && 'windows' || 'macos') }} (shard ${{ matrix.shardIndex }})
strategy:
fail-fast: false
matrix:
# TODO: enable namespace-profile-windows-latest once available
os:
- "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
- namespace-profile-macos-8-cores
- windows-latest
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
# Disable macos and windows tests on hourly e2e tests since we only care
# about server side changes.
# Technique from https://github.com/joaomcteixeira/python-project-skeleton/pull/31/files
isScheduled:
- ${{ github.event_name == 'schedule' }}
exclude:
include:
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 1
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 2
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 3
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 4
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 5
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 6
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 7
shardTotal: 8
- os: "runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64"
shardIndex: 8
shardTotal: 8
- os: namespace-profile-macos-8-cores
isScheduled: true
- os: windows-latest
isScheduled: true
# TODO: add ref here for main and latest release tag
shardIndex: 1
shardTotal: 1
- os: windows-latest-8-cores
shardIndex: 1
shardTotal: 1
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@ -316,12 +333,12 @@ jobs:
if: needs.conditions.outputs.should-run == 'true'
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- name: Install dependencies
id: deps-install
if: needs.conditions.outputs.should-run == 'true'
run: yarn
run: npm install
- name: Cache Playwright Browsers
if: needs.conditions.outputs.should-run == 'true'
@ -329,32 +346,22 @@ jobs:
with:
path: |
~/.cache/ms-playwright/
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }}
- name: Install Playwright Browsers
if: needs.conditions.outputs.should-run == 'true'
run: yarn playwright install --with-deps
run: npm run playwright install --with-deps
- name: Build web
if: needs.conditions.outputs.should-run == 'true'
run: yarn tronb:vite:dev
run: npm run tronb:vite:dev
- name: Install vector
if: ${{ needs.conditions.outputs.should-run == 'true' && contains(matrix.os, 'ubuntu') }}
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
chmod +x /tmp/vector.sh
/tmp/vector.sh -y -no-modify-path
mkdir -p /tmp/vector
cp .github/workflows/vector.toml /tmp/vector.toml
sed -i "s#GITHUB_WORKFLOW#${GITHUB_WORKFLOW}#g" /tmp/vector.toml
sed -i "s#GITHUB_REPOSITORY#${GITHUB_REPOSITORY}#g" /tmp/vector.toml
sed -i "s#GITHUB_SHA#${GITHUB_SHA}#g" /tmp/vector.toml
sed -i "s#GITHUB_REF_NAME#${GITHUB_REF_NAME}#g" /tmp/vector.toml
sed -i "s#GH_ACTIONS_AXIOM_TOKEN#${{secrets.GH_ACTIONS_AXIOM_TOKEN}}#g" /tmp/vector.toml
cat /tmp/vector.toml
${HOME}/.vector/bin/vector --config /tmp/vector.toml &
- name: Start Vector
if: ${{ needs.conditions.outputs.should-run == 'true' && !contains(matrix.os, 'windows') }}
run: .github/ci-cd-scripts/start-vector-${{ env.OS_NAME }}.sh
env:
GH_ACTIONS_AXIOM_TOKEN: ${{ secrets.GH_ACTIONS_AXIOM_TOKEN }}
OS_NAME: ${{ env.OS_NAME }}
- uses: actions/download-artifact@v4
if: ${{ needs.conditions.outputs.should-run == 'true' && !cancelled() && (success() || failure()) }}
@ -370,11 +377,16 @@ jobs:
with:
shell: bash
command: .github/ci-cd-scripts/playwright-electron.sh ${{matrix.shardIndex}} ${{matrix.shardTotal}} ${{ env.OS_NAME }}
timeout_minutes: 45
max_attempts: 15
timeout_minutes: 30
max_attempts: 9
env:
FAIL_ON_CONSOLE_ERRORS: true
token: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
TAB_API_URL: ${{ secrets.TAB_API_URL }}
TAB_API_KEY: ${{ secrets.TAB_API_KEY }}
CI_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
CI_PR_NUMBER: ${{ github.event.pull_request.number }}
TARGET: desktop
- uses: actions/upload-artifact@v4
if: ${{ needs.conditions.outputs.should-run == 'true' && always() }}

View File

@ -21,10 +21,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- run: yarn generate:machine-api
- run: yarn fmt
cache: 'npm'
- run: npm install
- run: npm run generate:machine-api
- run: npm run fmt || true
- name: check for changes
id: git-check
run: |

View File

@ -38,15 +38,13 @@ jobs:
run: |
mkdir -p documentation/content/pages/docs/kcl/
# cleanup old
rm -rf documentation/content/pages/docs/kcl/*.md
rm -rf documentation/content/pages/docs/kcl/types
rm -rf documentation/content/pages/docs/kcl/settings
rm -rf documentation/content/pages/docs/kcl/consts
rm -rf documentation/content/pages/docs/kcl-std
rm -rf documentation/content/pages/docs/kcl-lang
# move new
mv -f docs/kcl/*.md documentation/content/pages/docs/kcl/
mv -f docs/kcl/types documentation/content/pages/docs/kcl/
mv -f docs/kcl/settings documentation/content/pages/docs/kcl/
mv -f docs/kcl/consts documentation/content/pages/docs/kcl/
mv -f docs/kcl-std documentation/content/pages/docs
mv -f docs/kcl-lang documentation/content/pages/docs
# We don't need the README
rm documentation/content/pages/docs/kcl-std/README.md
- name: move kcl-samples
shell: bash
run: |

View File

@ -56,21 +56,19 @@ jobs:
node-version-file: ".nvmrc"
- name: Install dependencies
run: |
yarn install
cd rust/kcl-language-server
yarn install
npm install
- name: Run tests
run: |
cd rust/kcl-language-server
yarn build
yarn test-compile
npm run build
npm run test-compile
ls -la dist
xvfb-run -a yarn test
xvfb-run -a npm run test
if: runner.os == 'Linux'
- name: Run tests
run: |
cd rust/kcl-language-server
yarn test
npm run test
if: runner.os != 'Linux'
build-release:
strategy:
@ -183,19 +181,20 @@ jobs:
- name: Install dependencies
run: |
cd rust/kcl-language-server
# npm will symlink which will cause issues w tarballing later
yarn install
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }}
- name: Package Extension (nightly)
if: startsWith(github.event.ref, 'refs/tags/') == false
run: |
cd rust/kcl-language-server
npx vsce package -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
npx vsce package --yarn -o "../build/kcl-language-server-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release
- name: remove server
if: matrix.target == 'x86_64-unknown-linux-gnu'
@ -207,13 +206,13 @@ jobs:
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
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix
- name: Package Extension (no server, nightly)
if: matrix.target == 'x86_64-unknown-linux-gnu' && startsWith(github.event.ref, 'refs/tags/') == false
run: |
cd rust/kcl-language-server
npx vsce package -o ../build/kcl-language-server-no-server.vsix --pre-release
npx vsce package --yarn -o ../build/kcl-language-server-no-server.vsix --pre-release
- name: Upload artifacts
uses: actions/upload-artifact@v4
@ -244,8 +243,8 @@ jobs:
lld \
musl-dev \
nodejs \
yarn \
npm
npm \
yarn
- name: Checkout repository
uses: actions/checkout@v4
@ -272,19 +271,20 @@ jobs:
- name: Install dependencies
run: |
cd rust/kcl-language-server
# npm will symlink which will cause issues w tarballing later
yarn install
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/')
run: |
cd rust/kcl-language-server
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64
- name: Package Extension (release)
if: startsWith(github.event.ref, 'refs/tags/') == false
run: |
cd rust/kcl-language-server
npx vsce package -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
npx vsce package --yarn -o "../build/kcl-language-server-alpine-x64.vsix" --target alpine-x64 --pre-release
- name: Upload artifacts
uses: actions/upload-artifact@v4

View File

@ -125,7 +125,8 @@ jobs:
just setup-uv
just test
env:
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN }}
KITTYCAD_API_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
ZOO_HOST: https://api.dev.zoo.dev
sdist:
runs-on: ubuntu-latest

55
.github/workflows/nix.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Test Nix Flake
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
nix-flake-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: nix flake check for all platforms
run: |
nix flake check --all-systems
nix-build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: nix build . for x86_64-linux
run: nix build .
nix-build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: nix build . for x86_64-darwin
run: nix build .

View File

@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- name: Find tag workflow id
id: tag_workflow_id
@ -105,7 +105,7 @@ jobs:
- name: Override release notes
env:
NOTES: ${{ github.event.release.body }}
run: yarn files:set-notes
run: npm run files:set-notes
- name: Authenticate to Google Cloud
uses: 'google-github-actions/auth@v2.1.8'
@ -126,7 +126,7 @@ jobs:
destination: 'dl.kittycad.io/releases/modeling-app'
- name: Invalidate bucket cache on latest*.yml and last_download.json files
run: yarn files:invalidate-bucket
run: npm run files:invalidate-bucket
- name: Upload release files to Github
if: ${{ github.event_name == 'release' }}

View File

@ -16,18 +16,18 @@ permissions:
actions: read
jobs:
yarn-fmt-check:
npm-fmt-check:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
- run: yarn fmt-check
cache: 'npm'
- run: npm install
- run: npm run fmt:check
yarn-build-wasm:
npm-build-wasm:
# Build the wasm blob once on the fastest runner.
runs-on: runs-on=${{ github.run_id }}/family=i7ie.2xlarge/image=ubuntu22-full-x64
steps:
@ -36,10 +36,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- name: Install dependencies
run: yarn install
run: npm install
- name: Use correct Rust toolchain
shell: bash
@ -51,7 +51,7 @@ jobs:
with:
cache: false # Configured below.
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
@ -62,7 +62,7 @@ jobs:
- name: Build Wasm
shell: bash
run: yarn build:wasm
run: npm run build:wasm
- uses: actions/upload-artifact@v4
with:
@ -76,17 +76,17 @@ jobs:
path: |
rust/kcl-lib/bindings/*
yarn-tsc:
npm-tsc:
runs-on: ubuntu-latest
needs: yarn-build-wasm
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
cache: 'npm'
- run: npm install
- name: Download all artifacts
uses: actions/download-artifact@v4
@ -104,19 +104,19 @@ jobs:
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: yarn tsc
- run: npm run tsc
yarn-lint:
npm-lint:
runs-on: ubuntu-latest
needs: yarn-build-wasm
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
cache: 'npm'
- run: npm install
- name: Download all artifacts
uses: actions/download-artifact@v4
@ -134,19 +134,19 @@ jobs:
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: yarn lint
- run: npm run lint
yarn-circular-dependencies:
npm-circular-dependencies:
runs-on: ubuntu-latest
needs: yarn-build-wasm
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- run: yarn install
cache: 'npm'
- run: npm install
- name: Download all artifacts
uses: actions/download-artifact@v4
@ -164,34 +164,29 @@ jobs:
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: yarn circular-deps:diff
- run: npm run circular-deps:diff
python-codespell:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Install codespell
run: |
python -m pip install codespell
- name: Run codespell
run: codespell --config .codespellrc # Edit this file to tweak the typo list and other configuration.
uses: crate-ci/typos@v1.32.0
yarn-unit-test-kcl-samples:
npm-unit-test-kcl-samples:
runs-on: ubuntu-latest
needs: yarn-build-wasm
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- run: yarn install
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
- run: npm install
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
@ -211,32 +206,32 @@ jobs:
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: yarn simpleserver:bg
- run: npm run simpleserver:bg
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn playwright install chromium --with-deps
run: npm run playwright install chromium --with-deps
- name: run unit tests for kcl samples
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn test:unit:kcl-samples
run: npm run test:unit:kcl-samples
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}
yarn-unit-test:
npm-unit-test:
runs-on: ubuntu-latest
needs: yarn-build-wasm
needs: npm-build-wasm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache: 'npm'
- run: yarn install
- uses: taiki-e/install-action@37bdc826eaedac215f638a96472df572feab0f9b
- run: npm install
- uses: taiki-e/install-action@d4635f2de61c8b8104d59cd4aede2060638378cc
with:
tool: wasm-pack
@ -256,16 +251,16 @@ jobs:
mkdir rust/kcl-lib/bindings
cp -r prepared-ts-rs-bindings/* rust/kcl-lib/bindings/
- run: yarn simpleserver:bg
- run: npm run simpleserver:bg
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
- name: Install Chromium Browser
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: yarn playwright install chromium --with-deps
run: npm run playwright install chromium --with-deps
- name: Run unit tests
if: ${{ github.event_name != 'release' && github.event_name != 'schedule' }}
run: xvfb-run -a yarn test:unit
run: xvfb-run -a npm run test:unit
env:
VITE_KC_DEV_TOKEN: ${{ secrets.KITTYCAD_API_TOKEN_DEV }}

View File

@ -27,7 +27,7 @@ jobs:
with:
node-version-file: '.nvmrc'
- run: yarn install
- run: npm install
- name: Push tag
run: |

View File

@ -1,45 +0,0 @@
name: update-e2e-branch
# This is used to sync the `all-e2e` branch with the `main` branch for the
# logic in the test utility `orRunWhenFullSuiteEnabled()` that allows all e2e
# tests to run on a particular branch to analyze failures metrics in Axiom.
on:
schedule:
- cron: '0 * * * *' # runs every hour
permissions:
contents: write
jobs:
update-branch:
runs-on: ubuntu-latest
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 }}
- name: Sync with main
run: |
# Create the branch
git checkout all-e2e || git checkout -b all-e2e
# Reset to main
git fetch origin
git reset --hard origin/main
# Get a new SHA to prevent overwriting the commit status on main
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit --allow-empty --message="[all-e2e] $(git log --max-count=1 --pretty=%B)"
# Overwrite the branch
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git
git push --force origin all-e2e

View File

@ -8,6 +8,7 @@ include = ["/tmp/github-actions.log"]
type = "remap"
inputs = [ "github-actions-file" ]
source = '''
.platform = "OS_NAME"
.action = "GITHUB_WORKFLOW"
.repo = "GITHUB_REPOSITORY"
.sha = "GITHUB_SHA"

4
.gitignore vendored
View File

@ -26,10 +26,12 @@ yarn-error.log*
.idea
.vscode
.helix
result
# rust
rust/target
rust/kcl-lib/bindings
rust/kcl-language-server/server
public/kcl_wasm_lib_bg.wasm
rust/lcov.info
rust/kcl-wasm-lib/pkg
@ -82,3 +84,5 @@ dist
venv
.vscode-test
.biome/
.million

View File

@ -5,6 +5,6 @@ command = "vscode-eslint-language-server"
[[language]]
name = "typescript"
auto-format = true
formatter = { command = "node_modules/.bin/prettier", args = ["--parser", "typescript"] }
language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]
formatter = { command = "./node_modules/@biomejs/biome/bin/biome", args = ["format", "--write", "--stdin-file-path=foo.ts"] }
# language-servers = [ { name = "eslint", only-features = [ "diagnostics" ] }, "typescript-language-server" ]

1
.husky/pre-commit Executable file
View File

@ -0,0 +1 @@
npm run fmt

View File

@ -1,4 +0,0 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn fmt-check

1
.npmrc Normal file
View File

@ -0,0 +1 @@
legacy-peer-deps=true

312
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,312 @@
# Contributor Guide
## Running a development build
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
```
fnm install --corepack-enabled
fnm use
```
Install the NPM dependencies with:
```
npm install
```
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
```
# macOS/Linux
npm run install:rust
npm run install:wasm-pack:sh
# Windows
npm run install:rust:windows
npm run install:wasm-pack:cargo
```
Then to build the WASM layer, run:
```
# macOS/Linux
npm run build:wasm
# Windows
npm run build:wasm:windows
```
Or if you have the `gh` cli installed and want to download the latest main wasm bundle. Note that on Windows, you need to associate .ps1 files with PowerShell, which can be done via the right click menu, selecting `C:\Program Files\PowerShell\7\pwsh.exe`, and you can install tools like `gh` via `npm run install:tools:windows`.
```
# macOS/Linux
npm run fetch:wasm
# Windows
npm run fetch:wasm:windows
```
That will build the WASM binary and put in the `public` dir (though gitignored).
Finally, to run the web app only, run:
```
npm start
```
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
### Development environment variables
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
### Developing in Chrome
Chrome is in the process of rolling out a new default which
[blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/).
If you're having trouble logging into the `modeling-app`, you may need to
enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies".
## Desktop
To spin up the desktop app, `npm install` and `npm run build:wasm` need to have been done before hand then:
```
npm run tron:start
```
This will start the application and hot-reload on changes.
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
To package the app for your platform with electron-builder, run `npm run tronb:package:dev` (or `npm run tronb:package:prod` to point to the .env.production variables).
## Checking out commits / Bisecting
Which commands from setup are one off vs. need to be run every time?
The following will need to be run when checking out a new commit and guarantees the build is not stale:
```bash
npm install
npm run build:wasm
npm start
```
## Before submitting a PR
Before you submit a contribution PR to this repo, please ensure that:
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
- You have separated out refactoring commits from feature commits as much as possible
- You have run all of the following commands locally:
- `npm run fmt`
- `npm run tsc`
- `npm run test`
- Here they are all together: `npm run fmt && npm run tsc && npm run test`
## Release a new version
#### 1. Create a 'Cut release $VERSION' issue
It will be used to document changelog discussions and release testing.
https://github.com/KittyCAD/modeling-app/issues/new
#### 2. Push a new tag
Create a new tag and push it to the repo. The `semantic-release.sh` script will automatically bump the minor part, which we use the most. For instance going from `v0.27.0` to `v0.28.0`.
```
VERSION=$(./scripts/semantic-release.sh)
git tag $VERSION
git push origin --tags
```
This will trigger the `build-apps` workflow, set the version, build & sign the apps, and generate release files as well as updater-test artifacts.
The workflow should be listed right away [in this list](https://github.com/KittyCAD/modeling-app/actions/workflows/build-apps.yml?query=event%3Apush)).
#### 3. Manually test artifacts
##### Release builds
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in 2.).
Manually test against this [list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
##### Updater-test builds
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
```
# Windows (PowerShell)
& 'C:\Program Files\Zoo Design Studio\Zoo Design Studio.exe'
# macOS
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
# Linux
./Zoo Design Studio-{version}-{arch}-linux.AppImage
```
#### 4. Publish the release
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
#### 5. Close the issue
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
## Fuzzing the parser
Make sure you install cargo fuzz:
```bash
$ cargo install cargo-fuzz
```
```bash
$ cd rust/kcl-lib
# list the fuzz targets
$ cargo fuzz list
# run the parser fuzzer
$ cargo +nightly fuzz run parser
```
For more information on fuzzing you can check out
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
## Tests
### Playwright tests
Prepare these system dependencies:
- Set $token from https://zoo.dev/account/api-tokens
#### Snapshot tests (Google Chrome on Ubuntu only)
Only Ubunu and Google Chrome is supported for the set of tests evaluating screenshot snapshots.
If you don't run Ubuntu locally or in a VM, you may use a GitHub Codespace.
```
npm run playwright -- install chrome
npm run test:snapshots
```
You may use `-- --update-snapshots` as needed.
#### Electron flow tests (Chromium on Ubuntu, macOS, Windows)
```
npm run playwright -- install chromium
npm run test:playwright:electron:local
```
You may use `-- -g "my test"` to match specific test titles, or `-- path/to/file.spec.ts` for a test file.
#### Debugger
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
If you want to limit to a single browser use `--project="webkit"` or `firefox`, `Google Chrome`
Or comment out browsers in `playwright.config.ts`.
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `npm run playwright codegen -b wk --load-storage ./store localhost:3000`
<details>
<summary>
Where `./store` should look like this
</summary>
```JSON
{
"cookies": [],
"origins": [
{
"origin": "http://localhost:3000",
"localStorage": [
{
"name": "store",
"value": "{\"state\":{\"openPanes\":[\"code\"]},\"version\":0}"
},
{
"name": "persistCode",
"value": ""
},
{
"name": "TOKEN_PERSIST_KEY",
"value": "your-token"
}
]
}
]
}
```
</details>
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
### Unit and component tests
If you already haven't, run the following:
```
npm
npm run build:wasm
npm start
```
and finally:
```
npm run test:unit
```
For individual testing:
```
npm run test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
### Rust tests
Prepare these system dependencies:
- Set `$KITTYCAD_API_TOKEN` from https://zoo.dev/account/api-tokens
- Install `just` following [these instructions](https://just.systems/man/en/packages.html)
then run tests that target the KCL language:
```
npm run test:rust
```
### Logging
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
To enable memory metrics, build with `--features dhat-heap`.

View File

@ -1,27 +1,27 @@
# Setting Up Zoo Modeling App
# Setting Up Zoo Design Studio
Compared to other CAD software, getting Zoo Modeling App up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
Compared to other CAD software, getting Zoo Design Studio up and running is quick and straightforward across platforms. It's about 100MB to download and is quick to install.
## Windows
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Windows and for your processor type.
2. Once downloaded, run the installer `Zoo Modeling App-{version}-{arch}-win.exe` which should take a few seconds.
2. Once downloaded, run the installer `Zoo Design Studio-{version}-{arch}-win.exe` which should take a few seconds.
3. The installation happens at `C:\Program Files\Zoo Modeling App`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
3. The installation happens at `C:\Program Files\Zoo Design Studio`. A shortcut in the start menu is also created so you can run the app easily by clicking on it.
## macOS
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for macOS and for your processor type.
2. Once downloaded, open the disk image `Zoo Modeling App-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
2. Once downloaded, open the disk image `Zoo Design Studio-{version}-{arch}-mac.dmg` and drag the applications to your `Applications` directory.
3. You can then open your `Applications` directory and double-click on `Zoo Modeling App` to open.
3. You can then open your `Applications` directory and double-click on `Zoo Design Studio` to open.
## Linux
1. Download the [Zoo Modeling App installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
1. Download the [Zoo Design Studio installer](https://zoo.dev/modeling-app/download) for Linux and for your processor type.
2. Install the dependencies needed to run the [AppImage format](https://appimage.org/).
- On Ubuntu, install the FUSE library with these commands in a terminal.
@ -30,7 +30,7 @@ Compared to other CAD software, getting Zoo Modeling App up and running is quick
sudo apt install libfuse2
```
- Optionally, follow [these steps](https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md#initial-setup) to install `appimaged`. It is a daemon that makes interacting with AppImage files more seamless.
- Once installed, copy the downloaded `Zoo Modeling App-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
- Once installed, copy the downloaded `Zoo Design Studio-{version}-{arch}-linux.AppImage` to the directory of your choice, for instance `~/Applications`.
- `appimaged` should automatically find it and make it executable. If not, run:
```bash

107
Makefile
View File

@ -1,40 +1,42 @@
.PHONY: all
all: install build check
all: install check build
###############################################################################
# INSTALL
ifeq ($(OS),Windows_NT)
CARGO ?= ~/.cargo/bin/cargo.exe
WASM_PACK ?= ~/.cargo/bin/wasm-pack.exe
export WINDOWS := true
ifndef MSYSTEM
export POWERSHELL := true
endif
endif
ifdef WINDOWS
CARGO ?= $(USERPROFILE)/.cargo/bin/cargo.exe
WASM_PACK ?= $(USERPROFILE)/.cargo/bin/wasm-pack.exe
else
CARGO ?= ~/.cargo/bin/cargo
WASM_PACK ?= ~/.cargo/bin/wasm-pack
CARGO ?= $(shell which cargo || echo ~/.cargo/bin/cargo)
WASM_PACK ?= $(shell which wasm-pack || echo ~/.cargo/bin/wasm-pack)
endif
.PHONY: install
install: node_modules/.yarn-integrity $(CARGO) $(WASM_PACK) ## Install dependencies
install: node_modules/.package-lock.json $(CARGO) $(WASM_PACK) ## Install dependencies
node_modules/.yarn-integrity: package.json yarn.lock
yarn install
ifeq ($(OS),Windows_NT)
@ type nul > $@
else
@ touch $@
endif
node_modules/.package-lock.json: package.json package-lock.json
npm install
$(CARGO):
ifeq ($(OS),Windows_NT)
yarn install:rust:windows
ifdef WINDOWS
npm run install:rust:windows
else
yarn install:rust
npm run install:rust
endif
$(WASM_PACK):
ifeq ($(OS),Windows_NT)
yarn install:wasm-pack:cargo
ifdef WINDOWS
npm run install:wasm-pack:cargo
else
yarn install:wasm-pack:sh
npm run install:wasm-pack:sh
endif
###############################################################################
@ -47,27 +49,19 @@ REACT_SOURCES := $(wildcard src/*.tsx) $(wildcard src/**/*.tsx)
TYPESCRIPT_SOURCES := tsconfig.* $(wildcard src/*.ts) $(wildcard src/**/*.ts)
VITE_SOURCES := $(wildcard vite.*) $(wildcard vite/**/*.tsx)
.PHONY: build
build: build-web build-desktop
.PHONY: build-web
build-web: install public/kcl_wasm_lib_bg.wasm build/index.html
.PHONY: build-desktop
build-desktop: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
build: install public/kcl_wasm_lib_bg.wasm .vite/build/main.js
public/kcl_wasm_lib_bg.wasm: $(CARGO_SOURCES) $(RUST_SOURCES)
ifeq ($(OS),Windows_NT)
yarn build:wasm:dev:windows
ifdef WINDOWS
npm run build:wasm:dev:windows
else
yarn build:wasm:dev
npm run build:wasm:dev
endif
build/index.html: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
yarn build:local
.vite/build/main.js: $(REACT_SOURCES) $(TYPESCRIPT_SOURCES) $(VITE_SOURCES)
yarn tronb:vite:dev
npm run tronb:vite:dev
###############################################################################
# CHECK
@ -77,63 +71,72 @@ check: format lint
.PHONY: format
format: install ## Format the code
yarn fmt
npm run fmt
.PHONY: lint
lint: install ## Lint the code
yarn tsc
yarn lint
npm run tsc
npm run lint
###############################################################################
# RUN
TARGET ?= web
TARGET ?= desktop
.PHONY: run
run: run-$(TARGET)
.PHONY: run-web
run-web: install build-web ## Start the web app
yarn start
run-web: install build ## Start the web app
npm run start
.PHONY: run-desktop
run-desktop: install build-desktop ## Start the desktop app
yarn tron:start
run-desktop: install build ## Start the desktop app
npm run tron:start
###############################################################################
# TEST
E2E_WORKERS ?= 1
E2E_GREP ?=
E2E_WORKERS ?=
E2E_FAILURES ?= 1
E2E_GREP ?= ""
.PHONY: test
test: test-unit test-e2e
.PHONY: test-unit
test-unit: install ## Run the unit tests
npm run test:rust
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
yarn test:unit
npm run test:unit
.PHONY: test-e2e
test-e2e: test-e2e-$(TARGET)
.PHONY: test-e2e-web
test-e2e-web: install build-web ## Run the web e2e tests
test-e2e-web: install build ## Run the web e2e tests
@ curl -fs localhost:3000 >/dev/null || ( echo "Error: localhost:3000 not available, 'make run-web' first" && exit 1 )
yarn chrome:test --headed --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep=$(E2E_GREP)
ifdef E2E_GREP
npm run chrome:test -- --headed --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
else
npm run chrome:test -- --headed --workers='100%'
endif
.PHONY: test-e2e-desktop
test-e2e-desktop: install build-desktop ## Run the desktop e2e tests
yarn test:playwright:electron --workers=$(E2E_WORKERS) --max-failures=$(E2E_FAILURES) --grep="$(E2E_GREP)"
test-e2e-desktop: install build ## Run the desktop e2e tests
ifdef E2E_GREP
npm run test:playwright:electron -- --grep="$(E2E_GREP)" --max-failures=$(E2E_FAILURES)
else
npm run test:playwright:electron -- --workers='100%'
endif
###############################################################################
# CLEAN
.PHONY: clean
clean: ## Delete all artifacts
ifeq ($(OS),Windows_NT)
git clean --force -d -X
ifdef POWERSHELL
git clean --force -d -x --exclude=.env* --exclude=**/*.env
else
rm -rf .vite/ build/
rm -rf trace.zip playwright-report/ test-results/
@ -144,7 +147,7 @@ endif
.PHONY: help
help: install
ifeq ($(OS),Windows_NT)
ifdef POWERSHELL
@ powershell -Command "Get-Content $(MAKEFILE_LIST) | Select-String -Pattern '^[^\s]+:.*##\s.*$$' | ForEach-Object { $$line = $$_.Line -split ':.*?##\s+'; Write-Host -NoNewline $$line[0].PadRight(30) -ForegroundColor Cyan; Write-Host $$line[1] }"
else
@ grep -E '^[^[:space:]]+:.*## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@ -159,5 +162,5 @@ endif
# It should work for you other Linux users.
lee-electron-test:
Xephyr -br -ac -noreset -screen 1200x500 :2 &
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn tron:test -g "when using the file tree"
DISPLAY=:2 NODE_ENV=development PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ npm run tron:test -g "when using the file tree"
killall Xephyr

483
README.md
View File

@ -1,17 +1,17 @@
![Zoo Modeling App](/public/zma-logomark-outlined.png)
![Zoo Design Studio](/public/zma-logomark-outlined.png)
## Zoo Modeling App
# Zoo Design Studio
download at [zoo.dev/modeling-app/download](https://zoo.dev/modeling-app/download)
[zoo.dev/modeling-app](https://zoo.dev/modeling-app)
A CAD application from the future, brought to you by the [Zoo team](https://zoo.dev).
Modeling App is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
Design Studio is our take on what a modern modelling experience can be. It is applying several lessons learned in the decades since most major CAD tools came into existence:
- All artifacts—including parts and assemblies—should be represented as human-readable code. At the end of the day, your CAD project should be "plain text"
- This makes version control—which is a solved problem in software engineering—trivial for CAD
- All GUI (or point-and-click) interactions should be actions performed on this code representation under the hood
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Modeling App
- This unlocks a hybrid approach to modeling. Whether you point-and-click as you always have or you write your own KCL code, you are performing the same action in Design Studio
- Everything graphics _has_ to be built for the GPU
- Most CAD applications have had to retrofit support for GPUs, but our geometry engine is made for GPUs (primarily Nvidia's Vulkan), getting the order of magnitude rendering performance boost with it
- Make the resource-intensive pieces of an application auto-scaling
@ -19,11 +19,11 @@ Modeling App is our take on what a modern modelling experience can be. It is app
We are excited about what a small team of people could build in a short time with our API. We welcome you to try our API, build your own applications, or contribute to ours!
Modeling App is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
Design Studio is a _hybrid_ user interface for CAD modeling. You can point-and-click to design parts (and soon assemblies), but everything you make is really just [`kcl` code](https://github.com/KittyCAD/kcl-experiments) under the hood. All of your CAD models can be checked into source control such as GitHub and responsibly versioned, rolled back, and more.
The 3D view in Modeling App is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
The 3D view in Design Studio is just a video stream from our hosted geometry engine. The app sends new modeling commands to the engine via WebSockets, which returns back video frames of the view within the engine.
## Tools
## Technology
- UI
- [React](https://react.dev/)
@ -38,471 +38,16 @@ The 3D view in Modeling App is just a video stream from our hosted geometry engi
- Modeling
- [KittyCAD TypeScript client](https://github.com/KittyCAD/kittycad.ts)
[Original demo video](https://drive.google.com/file/d/183_wjqGdzZ8EEZXSqZ3eDcJocYPCyOdC/view?pli=1)
## Get Started
[Original demo slides](https://github.com/user-attachments/files/19010536/demo.pdf)
We recommend downloading the latest application binary from our [releases](https://github.com/KittyCAD/modeling-app/releases) page. If you don't see your platform or architecture supported there, please file an issue.
## Get started
If you'd like to try out upcoming changes sooner, you can also download those from our [nightly releases](https://zoo.dev/modeling-app/download/nightly) page.
We recommend downloading the latest application binary from [our Releases page](https://github.com/KittyCAD/modeling-app/releases). If you don't see your platform or architecture supported there, please file an issue.
## Developing
## Running a development build
Install a node version manager such as [fnm](https://github.com/Schniz/fnm?tab=readme-ov-#installation).
On Windows, it's also recommended to [upgrade your PowerShell version](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#winget), we're using 7.
Then in the repo run the following to install and use the node version specified in `.nvmrc`. You might need to specify your processor architecture with `--arch arm64` or `--arch x64` if it's not autodetected.
```
fnm install --corepack-enabled
fnm use
```
Install the NPM dependencies with:
```
yarn install
```
This project uses a lot of Rust compiled to [WASM](https://webassembly.org/) within it. We have package scripts to run rustup, see `package.json` for reference:
```
# macOS/Linux
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 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`.
```
# macOS/Linux
yarn fetch:wasm
# Windows
yarn fetch:wasm:windows
```
That will build the WASM binary and put in the `public` dir (though gitignored).
Finally, to run the web app only, run:
```
yarn start
```
If you're not a Zoo employee you won't be able to access the dev environment, you should copy everything from `.env.production` to `.env.development.local` to make it point to production instead, then when you navigate to `localhost:3000` the easiest way to sign in is to paste `localStorage.setItem('TOKEN_PERSIST_KEY', "your-token-from-https://zoo.dev/account/api-tokens")` replacing the with a real token from https://zoo.dev/account/api-tokens of course, then navigate to `localhost:3000` again. Note that navigating to `localhost:3000/signin` removes your token so you will need to set the token again.
### Development environment variables
The Copilot LSP plugin in the editor requires a Zoo API token to run. In production, we authenticate this with a token via cookie in the browser and device auth token in the desktop environment, but this token is inaccessible in the dev browser version because the cookie is considered "cross-site" (from `localhost` to `dev.zoo.dev`). There is an optional environment variable called `VITE_KC_DEV_TOKEN` that you can populate with a dev token in a `.env.development.local` file to not check it into Git, which will use that token instead of other methods for the LSP service.
### Developing in Chrome
Chrome is in the process of rolling out a new default which
[blocks Third-Party Cookies](https://developer.chrome.com/en/docs/privacy-sandbox/third-party-cookie-phase-out/).
If you're having trouble logging into the `modeling-app`, you may need to
enable third-party cookies. You can enable third-party cookies by clicking on
the eye with a slash through it in the URL bar, and clicking on "Enable
Third-Party Cookies".
## Desktop
To spin up the desktop app, `yarn install` and `yarn build:wasm` need to have been done before hand then:
```
yarn tron:start
```
This will start the application and hot-reload on changes.
Devtools can be opened with the usual Command-Option-I (macOS) or Ctrl-Shift-I (Linux and Windows).
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
yarn start # or yarn build:local && yarn serve for slower but more production-like build
```
## Before submitting a PR
Before you submit a contribution PR to this repo, please ensure that:
- There is a corresponding issue for the changes you want to make, so that discussion of approach can be had before work begins.
- You have separated out refactoring commits from feature commits as much as possible
- You have run all of the following commands locally:
- `yarn fmt`
- `yarn tsc`
- `yarn test`
- Here they are all together: `yarn fmt && yarn tsc && yarn test`
## Release a new version
#### 1. Create a 'Cut release $VERSION' issue
It will be used to document changelog discussions and release testing.
https://github.com/KittyCAD/modeling-app/issues/new
#### 2. Push a new tag
Create a new tag and push it to the repo. The `semantic-release.sh` script will automatically bump the minor part, which we use the most. For instance going from `v0.27.0` to `v0.28.0`.
```
VERSION=$(./scripts/semantic-release.sh)
git tag $VERSION
git push origin --tags
```
This will trigger the `build-apps` workflow, set the version, build & sign the apps, and generate release files as well as updater-test artifacts.
The workflow should be listed right away [in this list](https://github.com/KittyCAD/modeling-app/actions/workflows/build-apps.yml?query=event%3Apush)).
#### 3. Manually test artifacts
##### Release builds
The release builds can be found under the `out-{arch}-{platform}` zip files, at the very bottom of the `build-apps` summary page for the workflow (triggered by the tag in 2.).
Manually test against this [list](https://github.com/KittyCAD/modeling-app/issues/3588) across Windows, MacOS, Linux and posting results as comments in the issue.
##### Updater-test builds
The other `build-apps` output in the release `build-apps` workflow (triggered by 2.) is `updater-test-{arch}-{platform}`. It's a semi-automated process: for macOS, Windows, and Linux, download the corresponding updater-test artifact file, install the app, run it, expect an updater prompt to a dummy v0.255.255, install it and check that the app comes back at that version.
The only difference with these builds is that they point to a different update location on the release bucket, with this dummy v0.255.255 always available. This helps ensuring that the version we release will be able to update to the next one available.
If the prompt doesn't show up, start the app in command line to grab the electron-updater logs. This is likely an issue with the current build that needs addressing (or the updater-test location in the storage bucket).
```
# Windows (PowerShell)
& 'C:\Program Files\Zoo Modeling App\Zoo Modeling App.exe'
# macOS
/Applications/Zoo\ Modeling\ App.app/Contents/MacOS/Zoo\ Modeling\ App
# Linux
./Zoo Modeling App-{version}-{arch}-linux.AppImage
```
#### 4. Publish the release
Head over to https://github.com/KittyCAD/modeling-app/releases/new, pick the newly created tag and type it in the _Release title_ field as well.
Hit _Generate release notes_ as a starting point to discuss the changelog in the issue. Once done, make sure _Set as the latest release_ is checked, and hit _Publish release_.
A new `publish-apps-release` will kick in and you should be able to find it [here](https://github.com/KittyCAD/modeling-app/actions?query=event%3Arelease). On success, the files will be uploaded to the public bucket as well as to the GitHub release, and the announcement on Discord will be sent.
#### 5. Close the issue
If everything is well and the release is out to the public, the issue tracking the release shall be closed.
## Fuzzing the parser
Make sure you install cargo fuzz:
```bash
$ cargo install cargo-fuzz
```
```bash
$ cd rust/kcl-lib
# list the fuzz targets
$ cargo fuzz list
# run the parser fuzzer
$ cargo +nightly fuzz run parser
```
For more information on fuzzing you can check out
[this guide](https://rust-fuzz.github.io/book/cargo-fuzz.html).
## Tests
### Playwright tests
You will need a `./e2e/playwright/playwright-secrets.env` file:
```bash
$ touch ./e2e/playwright/playwright-secrets.env
$ cat ./e2e/playwright/playwright-secrets.env
token=<dev.zoo.dev/account/api-tokens>
snapshottoken=<your-snapshot-token>
```
For a portable way to run Playwright you'll need Docker.
#### Generic example
After that, open a terminal and run:
```bash
docker run --network host --rm --init -it playwright/chrome:playwright-x.xx.x
```
and in another terminal, run:
```bash
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" <test suite>
```
#### Specific example
open a terminal and run:
```bash
docker run --network host --rm --init -it playwright/chrome:playwright-1.46.0
```
and in another terminal, run:
```bash
PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:4444/ yarn playwright test --project="Google Chrome" e2e/playwright/command-bar-tests.spec.ts
```
run a specific test change the test from `test('...` to `test.only('...`
(note if you commit this, the tests will instantly fail without running any of the tests)
**Gotcha**: running the docker container with a mismatched image against your `./node_modules/playwright` will cause a failure. Make sure the versions are matched and up to date.
run headed
```
yarn playwright test --headed
```
run with step through debugger
```
PWDEBUG=1 yarn playwright test
```
However, if you want a debugger I recommend using VSCode and the `playwright` extension, as the above command is a cruder debugger that steps into every function call which is annoying.
With the extension you can set a breakpoint after `waitForDefaultPlanesVisibilityChange` in order to skip app loading, then the vscode debugger's "step over" is much better for being able to stay at the right level of abstraction as you debug the code.
If you want to limit to a single browser use `--project="webkit"` or `firefox`, `Google Chrome`
Or comment out browsers in `playwright.config.ts`.
note chromium has encoder compat issues which is why were testing against the branded 'Google Chrome'
You may consider using the VSCode extension, it's useful for running individual threads, but some some reason the "record a test" is locked to chromium with we can't use. A work around is to us the CI `yarn playwright codegen -b wk --load-storage ./store localhost:3000`
<details>
<summary>
Where `./store` should look like this
</summary>
```JSON
{
"cookies": [],
"origins": [
{
"origin": "http://localhost:3000",
"localStorage": [
{
"name": "store",
"value": "{\"state\":{\"openPanes\":[\"code\"]},\"version\":0}"
},
{
"name": "persistCode",
"value": ""
},
{
"name": "TOKEN_PERSIST_KEY",
"value": "your-token"
}
]
}
]
}
```
</details>
However because much of our tests involve clicking in the stream at specific locations, it's code-gen looks `await page.locator('video').click();` when really we need to use a pixel coord, so I think it's of limited use.
### Unit and component tests
If you already haven't, run the following:
```
yarn
yarn build:wasm
yarn start
```
and finally:
```
yarn test:unit
```
For individual testing:
```
yarn test abstractSyntaxTree -t "unexpected closed curly brace" --silent=false
```
Which will run our suite of [Vitest unit](https://vitest.dev/) and [React Testing Library E2E](https://testing-library.com/docs/react-testing-library/intro) tests, in interactive mode by default.
### Rust tests
**Dependencies**
- `KITTYCAD_API_TOKEN`
- `cargo-nextest`
- `just`
#### Setting KITTYCAD_API_TOKEN
Use the production zoo.dev token, set this environment variable before running the tests
#### Installing cargonextest
```
cd 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
```bash
# With just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
# Make sure you installed just
cd rust
just test
```
```bash
# Without just
# Make sure KITTYCAD_API_TOKEN=<prod zoo.dev token> is set
# Make sure you installed cargo-nextest
cd rust
export RUST_BRACKTRACE="full" && cargo nextest run --workspace --test-threads=1
```
Where `XXX` is an API token from the production engine (NOT the dev environment).
We recommend using [nextest](https://nexte.st/) to run the Rust tests (its faster and is used in CI). Once installed, run the tests using
```
cd 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`?
To answer these questions the following commands will give you confidence to locate the issue.
#### Static Analysis
Part of the CI CD pipeline performs static analysis on the code. Use the following commands to mimic the CI CD jobs.
The following set of commands should get us closer to one and done commands to instantly retest issues.
```
yarn test-setup
```
> Gotcha, are packages up to date and is the wasm built?
```
yarn tsc
yarn fmt-check
yarn lint
yarn test:unit:local
```
> Gotcha: Our unit tests have integration tests in them. You need to run a localhost server to run the unit tests.
#### E2E Tests
**Playwright Electron**
These E2E tests run in electron. There are tests that are skipped if they are ran in a windows, linux, or macos environment. We can use playwright tags to implement test skipping.
```
yarn test:playwright:electron:local
yarn test:playwright:electron:windows:local
yarn test:playwright:electron:macos:local
yarn test:playwright:electron:ubuntu:local
```
> Why does it say local? The CI CD commands that run in the pipeline cannot be ran locally. A single command will not properly setup the testing environment locally.
#### Some notes on CI
The tests are broken into snapshot tests and non-snapshot tests, and they run in that order, they automatically commit new snap shots, so if you see an image commit check it was an intended change. If we have non-determinism in the snapshots such that they are always committing new images, hopefully this annoyance makes us fix them asap, if you notice this happening let Kurt know. But for the odd occasion `git reset --hard HEAD~ && git push -f` is your friend.
How to interpret failing playwright tests?
If your tests fail, click through to the action and see that the tests failed on a line that includes `await page.getByTestId('loading').waitFor({ state: 'detached' })`, this means the test fail because the stream never started. It's you choice if you want to re-run the test, or ignore the failure.
We run on ubuntu and macos, because safari doesn't work on linux because of the dreaded "no RTCPeerConnection variable" error. But linux runs first and then macos for the same reason that we limit the number of parallel tests to 1 because we limit stream connections per user, so tests would start failing we if let them run together.
If something fails on CI you can download the artifact, unzip it and then open `playwright-report/data/<UUID>.zip` with https://trace.playwright.dev/ to see what happened.
#### Getting started writing a playwright test in our app
Besides following the instructions above and using the playwright docs, our app is weird because of the whole stream thing, which means our testing is weird. Because we've just figured out this stuff and therefore docs might go stale quick here's a 15min vid/tutorial
https://github.com/KittyCAD/modeling-app/assets/29681384/6f5e8e85-1003-4fd9-be7f-f36ce833942d
<details>
<summary>
PS: for the debug panel, the following JSON is useful for snapping the camera
</summary>
```JSON
{"type":"modeling_cmd_req","cmd_id":"054e5472-e5e9-4071-92d7-1ce3bac61956","cmd":{"type":"default_camera_look_at","center":{"x":15,"y":0,"z":0},"up":{"x":0,"y":0,"z":1},"vantage":{"x":30,"y":30,"z":30}}}
```
</details>
Finally, if you'd like to run a development build or contribute to the project, please visit our [contributor guide](CONTRIBUTING.md) to get started.
## KCL
For how to contribute to KCL, [see our KCL README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib).
### Logging
To display logging (to the terminal or console) set `ZOO_LOG=1`. This will log some warnings and simple performance metrics. To view these in test runs, use `-- --nocapture`.
To enable memory metrics, build with `--features dhat-heap`.
To contribute to the KittyCAD Language, see the [README](https://github.com/KittyCAD/modeling-app/tree/main/rust/kcl-lib) for KCL.

39
_typos.toml Normal file
View File

@ -0,0 +1,39 @@
[files]
extend-exclude = [
"**/target",
"node_modules",
"build",
"dist",
"out",
"**/Cargo.lock",
"docs/**/*.md",
"docs/**/*.json",
"e2e/playwright/lib/console-error-whitelist.ts",
".package-lock.json",
"**/package-lock.json",
"openapi/*.json",
"packages/codemirror-lang-kcl/test/all.test.ts",
"public/kcl-samples",
"rust/kcl-lib/tests/kcl_samples",
"tsconfig.tsbuildinfo",
"src/lib/machine-api.d.ts",
"kcl-book/book",
]
[default.extend-words]
metalness = "metalness" # appearance API
Hom = "Hom" # short for homogenous
typ = "typ" # used to declare a variable named 'type' which is a reserved keyword in Rust
ue = "ue" # short for UnaryExpression
THRE = "THRE" # Weird bug that wrongly detects THREEjs as a typo
nwo = "nwo" # don't know what this is about tbh
"ot" = "ot" # some abbreviation, idk what
"oe" = "oe" # some abbreviation, idk what
[default]
extend-ignore-identifiers-re = [
"\\dnd", # e.g. 2nd
]
extend-ignore-re = [
"@xstate-layout .*",
]

48
biome.json Normal file
View File

@ -0,0 +1,48 @@
{
"$schema": "https://biomejs.dev/schemas/1.6.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noUnusedVariables": "error"
},
"suspicious": {
"noExplicitAny": "warn"
},
"style": {
"useBlockStatements": "error",
"useShorthandArrayType": "error"
}
}
},
"formatter": {
"enabled": true,
"indentWidth": 2,
"indentStyle": "space",
"lineWidth": 80,
"formatWithErrors": true
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingCommas": "es5",
"semicolons": "asNeeded"
},
"parser": {
"unsafeParameterDecoratorsEnabled": true
}
},
"css": {
"parser": {
"cssModules": true
}
},
"files": {
"ignore": ["**/*.json"]
}
}

View File

@ -0,0 +1,53 @@
---
title: "Arithmetic and logic"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
KCL supports the usual arithmetic operators on numbers and logic operators on booleans:
| Operator | Meaning |
|----------|---------|
| `+` | Addition |
| `-` | Subtraction or unary negation |
| `*` | Multiplication |
| `/` | Division |
| `%` | Modulus aka remainder |
| `^` | Power, e.g., `x ^ 2` means `x` squared |
| `&` | Logical 'and' |
| `|` | Logical 'or' |
| `!` | Unary logical 'not' |
KCL also supports comparsion operators which operate on numbers and produce booleans:
| Operator | Meaning |
|----------|---------|
| `==` | Equal |
| `!=` | Not equal |
| `<` | Less than |
| `>` | Greater than |
| `<=` | Less than or equal |
| `>=` | Greater than or equal |
Arithmetics and logic expressions can be arbitrairly combined with the usual rules of associativity and precedence, e.g.,
```
myMathExpression = 3 + 1 * 2 / 3 - 7
```
You can also nest expressions in parenthesis:
```
myMathExpression = 3 + (1 * 2 / (3 - 7))
```
KCL numbers are implemented using [floating point numbers](https://en.wikipedia.org/wiki/Floating-point_arithmetic). This means that there are occasionally representation and rounding issues, and some oddities such as supporting positive and negative zero.
Some operators can be applied to other types:
- `+` can be used to concatenate strings, e.g., `'hello' + ' ' + 'world!'`
- Unary `-` can be used with planes or line-like objects such as axes to produce an object with opposite orientation, e.g., `-XY` is a plain which is aligned with `XY` but whose normal aligns with the negative Z axis.
- The following operators can be used with solids as shorthand for CSG operations:
- `+` or `|` for [`union`](/docs/kcl-std/union).
- `-` for [`subtract`](/docs/kcl-std/subtract).
- `&` for [`intersect`](/docs/kcl-std/intersect)

View File

@ -0,0 +1,30 @@
---
title: "Attributes"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
Attributes are syntax which affects the language item they annotate. In KCL they are indicated using `@`. For example, `@settings` affects the file in which it appears.
There are two kinds of attributes: named and unnamed attributes. Named attributes (e.g., `@settings`) have a name immediately after the `@` (e.g., `settings`) and affect their surrounding scope. Unnamed attributes have no name and affect the following item, e.g.,
```kcl,norun
@(lengthUnit = ft, coords = opengl)
import "tests/inputs/cube.obj"
```
has an unnamed attribute on the `import` statement.
Named and unnamed attributes may take a parenthesized list of arguments (like a function). Named attributes may also appear without any arguments (e.g., `@no_std`).
## Named attributes
The `@settings` attribute affects the current file and accepts the following arguments: `defaultLengthUnit`, `defaultAngleUnit`, and `kclVersion`. See [settings](/docs/kcl-lang/settings) for details.
The `@no_std` attribute affects the current file, takes no arguments, and causes the standard library to not be implicitly available. It can still be used by being explicitly imported.
## Unnamed attributes
Unnamed attributes may be used on `import` statements when importing non-KCL files. See [projects, modules, and imports](/docs/kcl-lang/modules) for details.
Other unnamed attributes are used on functions inside the standard library, but these are not available in user code.

View File

@ -0,0 +1,99 @@
---
title: "Importing geometry from other CAD systems"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
`import` can also be used to import files from other CAD systems. The format of the statement is the
same as for KCL files. You can only import the whole file, not items from it. E.g.,
```norun
import "tests/inputs/cube.obj"
// Use `cube` just like a KCL object.
```
```kcl
import "tests/inputs/cube.sldprt" as cube
// Use `cube` just like a KCL object.
```
For formats lacking unit data (such as STL, OBJ, or PLY files), the default
unit of measurement is millimeters. Alternatively you may specify the unit
by using an attribute. Likewise, you can also specify a coordinate system. E.g.,
```kcl
@(lengthUnit = ft, coords = opengl)
import "tests/inputs/cube.obj"
```
When importing a GLTF file, the bin file will be imported as well.
Import paths are relative to the current project directory. Imports currently only work when
using the native Design Studio, not in the browser.
### Supported values
File formats: `fbx`, `gltf`/`glb`, `obj`+, `ply`+, `sldprt`, `step`/`stp`, `stl`+. (Those marked with a
'+' support customising the length unit and coordinate system).
Length units: `mm` (the default), `cm`, `m`, `inch`, `ft`, `yd`.
Coordinate systems:
- `zoo` (the default), forward: -Y, up: +Z, handedness: right
- `opengl`, forward: +Z, up: +Y, handedness: right
- `vulkan`, forward: +Z, up: -Y, handedness: left
---
## Performance deepdive for foreignfile imports
Parallelized foreignfile imports now let you overlap file reads, initialization,
and rendering. To maximize throughput, you need to understand the three distinct
stages—reading, initializing (background render start), and invocation (blocking)
—and structure your code to defer blocking operations until the end.
### Foreign import execution stages
1. **Import (Read / Initialization) Stage**
```kcl
import "tests/inputs/cube.step" as cube
```
- Reads the file from disk and makes its API available.
- Starts engine rendering but **does not block** your script.
- This kickstarts the render pipeline while you keep executing other code.
2. **Invocation (Blocking) Stage**
```kcl
import "tests/inputs/cube.step" as cube
cube
|> translate(z=10) // ← blocks here only
```
- Any method call (e.g., `translate`, `scale`, `rotate`) waits for the background render to finish before applying transformations.
### Best practices
#### 1. Defer blocking calls
```kcl
import "tests/inputs/cube.step" as cube // 1) Read / Background render starts
// --- perform other operations and calculations here ---
cube
|> translate(z=10) // 2) Blocks only here
```
#### 2. Split heavy work into separate modules
Place computationally expensive or IOheavy work into its own module so it can render in parallel while `main.kcl` continues.
#### Future improvements
Upcoming releases will autoanalyse dependencies and only block when truly necessary. Until then, explicit deferral will give you the best performance.

View File

@ -0,0 +1,46 @@
---
title: "Functions"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
We have support for defining your own functions. Functions can take in any
type of argument. Below is an example of the syntax:
```
fn myFn(x) {
return x
}
```
As you can see above `myFn` just returns whatever it is given.
KCL uses keyword arguments:
```
// If you declare a function like this
fn add(left, right) {
return left + right
}
// You can call it like this:
total = add(left = 1, right = 2)
```
Functions can also declare one *unlabeled* arg. If you do want to declare an unlabeled arg, it must
be the first arg declared.
```
// The @ indicates an argument is used without a label.
// Note that only the first argument can use @.
fn increment(@x) {
return x + 1
}
fn add(@x, delta) {
return x + delta
}
two = increment(1)
three = add(1, delta = 2)
```

21
docs/kcl-lang/index.md Normal file
View File

@ -0,0 +1,21 @@
---
title: "KCL Language Reference"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
This is a reference for KCL. If you are learning KCL, you may prefer the [guide]() which explains
things in a more tutorial fashion. See also our documentation of the [standard library](/docs/kcl-std).
## Topics
* [Pipelines](/docs/kcl-lang/pipelines)
* [Arithmetic and logic](/docs/kcl-lang/arithmetic)
* [Values and types](/docs/kcl-lang/types)
* [Numeric types and units](/docs/kcl-lang/numeric)
* [Functions](/docs/kcl-lang/functions)
* [Projects and modules](/docs/kcl-lang/modules)
* [Attributes](/docs/kcl-lang/attributes)
* [Importing geometry from other CAD systems](/docs/kcl-lang/foreign-imports)
* [Settings](/docs/kcl-lang/settings)
* [Known Issues](/docs/kcl-lang/known-issues)

View File

@ -1,6 +1,6 @@
---
title: "KCL Known Issues"
excerpt: "Known issues with the KCL standard library for the Zoo Modeling App."
title: "Known Issues"
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
layout: manual
---
@ -15,10 +15,6 @@ once fixed in engine will just start working here with no language changes.
- **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.
- **Fillets**: Fillets cannot intersect, you will get an error. Only simple fillet
cases work currently.
- **Appearance**: Changing the appearance on a loft does not work.
- **Chamfers**: Chamfers cannot intersect, you will get an error. Only simple
chamfer cases work currently.
- **Appearance**: Changing the appearance on a loft does not work.
- **CSG Booleans**: Coplanar (bodies that share a plane) unions, subtractions, and intersections are not currently supported.

266
docs/kcl-lang/modules.md Normal file
View File

@ -0,0 +1,266 @@
---
title: "Projects and modules"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
`KCL` allows splitting code up into multiple files. Each file is somewhat
isolated from other files as a separate module.
When you define a function, you can use `export` before it to make it available
to other modules.
```kcl
// util.kcl
export fn increment(@x) {
return x + 1
}
```
Other files in the project can now import functions that have been exported.
This makes them available to use in another file.
```norun
// main.kcl
import increment from "util.kcl"
answer = increment(41)
```
Imported files _must_ be in the same project so that units are uniform across
modules. This means that it must be in the same directory.
Import statements must be at the top-level of a file. It is not allowed to have
an `import` statement inside a function or in the body of an ifelse.
Multiple functions can be exported in a file.
```kcl
// util.kcl
export fn increment(@x) {
return x + 1
}
export fn decrement(@x) {
return x - 1
}
```
When importing, you can import multiple functions at once.
```norun
import increment, decrement from "util.kcl"
```
Imported symbols can be renamed for convenience or to avoid name collisions.
```norun
import increment as inc, decrement as dec from "util.kcl"
```
---
## Functions vs `clone`
There are two common patterns for reusing geometry:
1. **Wrap the construction in a function** flexible and fully parametric.
2. **Duplicate an existing object with `clone`** lightningfast, but an exact
duplicate.
### Parametric function example
```kcl
fn cube(center) {
return startSketchOn(XY)
|> startProfile(at = [center[0] - 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] - 10])
|> line(endAbsolute = [center[0] + 10, center[1] + 10])
|> line(endAbsolute = [center[0] - 10, center[1] + 10])
|> close()
|> extrude(length = 10)
}
myCube = cube(center = [0, 0])
```
*Pros*
- Any argument can be a parameter size, position, appearance, etc.
- Works great inside loops, arrays, or optimisation sweeps.
*Cons*
- Every invocation rebuilds the entire feature tree.
- **Slower** than a straight duplicate each call is its own render job.
### `clone` example
```kcl
sketch001 = startSketchOn(-XZ)
|> circle(center = [0, 0], radius = 10)
|> extrude(length = 5)
|> appearance(color = "#ff0000", metalness = 90, roughness = 90)
sketch002 = clone(sketch001) // ✓ instant copy
```
*Pros*
- Roughly an O(1) operation we just duplicate the underlying engine handle.
- Perfect when you need ten identical bolts or two copies of the same imported STEP file.
*Cons*
- **Not parametric** the clone is exactly the same shape as the source.
- If you need to tweak dimensions perinstance, youre back to a function.
> **Rule of thumb** Reach for `clone` when the geometry is already what you want. Reach for a function when you need customisation.
---
## Modulelevel parallelism
Under the hood, the Design Studio runs **every module in parallel** where it can. This means:
- The toplevel code of `foo.kcl`, `bar.kcl`, and `baz.kcl` all start executing immediately and concurrently.
- Imports that read foreign files (STEP/OBJ/…) overlap their I/O and background render.
- CPUbound calculations in separate modules get their own worker threads.
### Why modules beat onebigfile
If you shoehorn everything into `main.kcl`, each statement runs sequentially:
```norun
import "big.step" as gizmo // blocks main while reading
gizmo |> translate(x=50) // blocks again while waiting for render
```
Split `gizmo` into its own file and the read/render can overlap whatever else `main.kcl` is doing.
```norun
// gizmo.kcl (worker A)
import "big.step"
// main.kcl (worker B)
import "gizmo.kcl" as gizmo // nonblocking
// ... other setup ...
gizmo |> translate(x=50) // only blocks here
```
### Gotcha: defining but **not** calling functions
Defining a function inside a module is instantaneous we just record the bytecode. The heavy lifting happens when the function is **called**. So:
```norun
// util.kcl
export fn makeBolt(size) { /* … expensive CAD … */ }
```
If `main.kcl` waits until the very end to call `makeBolt`, *none* of that work was parallelised youve pushed the cost back onto the serial tail of your script.
**Better:** call it early or move the invocation into another module.
```norun
// bolt_instance.kcl
import makeBolt from "util.kcl"
bolt = makeBolt(5) // executed in parallel
bolt
```
Now `main.kcl` can `import "bolt_instance.kcl" as bolt` and get the result that was rendered while it was busy doing other things.
---
## Whole module import
You can also import the whole module. This is useful if you want to use the
result of a module as a variable, like a part.
```norun
import "tests/inputs/cube.kcl" as cube
cube
|> translate(x=10)
```
This imports the whole module and makes it available as `cube`. You can then
use it like any other object. The `cube` variable is now a reference to the
result of the module. This means that if you change the module, the `cube`
variable will change as well.
In `cube.kcl`, you cannot have multiple objects. It has to be a single part. If
you have multiple objects, you will get an error. This is because the module is
expected to return a single object that can be used as a variable.
The last expression or variable definition becomes the module's return value.
The module is expected to return a single object that can be used as a variable
by whatever imports it.
So for example, this is allowed:
```norun
... a bunch of code to create cube and cube2 ...
myUnion = union([cube, cube2])
```
You can also do this:
```norun
... a bunch of code to create cube and cube2 ...
union([cube, cube2])
```
Either way, the last line will return the union of the two objects.
Or what you could do instead is:
```norun
... a bunch of code to create cube and cube2 ...
myUnion = union([cube, cube2])
myUnion
```
This will assign the union of the two objects to a variable, and then return it
on the last statement. It's simply another way of doing the same thing.
The final statement is what's important because it's the return value of the
entire module. The module is expected to return a single object that can be used
as a variable by the file that imports it.
---
## Multiple instances of the same import
Whether you are importing a file from another CAD system or a KCL file, that
file represents object(s) in memory. If you import the same file multiple times,
it will only be rendered once.
If you want to have multiple instances of the same object, you can use the
[`clone`](/docs/kcl/clone) function. This will render a new instance of the object in memory.
```norun
import cube from "tests/inputs/cube.kcl"
cube
|> translate(x=10)
clone(cube)
|> translate(x=20)
```
In the sample above, the `cube` object is imported from a KCL file. The first
instance is translated 10 units in the x direction. The second instance is
cloned and translated 20 units in the x direction. The two instances are now
separate objects in memory, and can be manipulated independently.
Here is an example with a file from another CAD system:
```kcl
import "tests/inputs/cube.step" as cube
cube
|> translate(x=10)
clone(cube)
|> translate(x=20)
```

48
docs/kcl-lang/numeric.md Normal file
View File

@ -0,0 +1,48 @@
---
title: "Numeric types and units"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
Numbers and numeric types in KCL include information about the units of the numbers. So rather than just having a number like `42`, we always have information about the units so we don't confuse 42 mm with 42 inches.
## Numeric literals
When writing a number literal, you can use a unit suffix to explicitly state the unit, e.g., `42mm`. The following units are available:
- Length units:
- metric: `mm`, `cm`, `m`
- imperial: `in`, `ft`, `yd`
- Angle units: `deg`, `rad`
- `_` to indicate a unitless number such as a count or ratio.
If you write a numeric literal without a suffix, then the defaults for the current file are used. These defaults are specified using the `@settings` attribute, see [settings](/docs/kcl-lang/settings) for details. Note that if using the defaults, the KCL interpreter won't know whether you intend the number to be a length, angle, or count and will treat it as being possibly any of them.
## Numeric types
Just like numbers carry units information, the `number` type also includes units information. Units are written in parentheses after the type, e.g., `number(mm)`.
Any of the suffixes described above can be used meaning that values with that type have the supplied units. E.g., `number(mm)` is the type of number values with mm units and `number(_)` is the type of number values with no units.
You can also use `number(Length)`, `number(Angle)`, or `number(Count)`. These types mean a number with any length, angle, or unitless (count) units, respectively (note that `number(_)` and `number(Count)` are equivalent since there is only one kind of unitless-ness).
Using just `number` means accepting any kind of number, even where the units are unknown by KCL.
## Function calls
When calling a function with an argument with numeric type, the declared numeric type in the function signature and the units of the argument value used in the function call must be compatible. Units are adjusted automatically. For example, if a function requires an argument with type `number(mm)`, then you can call it with `2in` and the units will be automatically adjusted, but calling it with `90deg` will cause an error.
## Mixing units with arithmetic
When doing arithmetic or comparisons, units will be adjusted as necessary if possible. However, often arithmetic expressions exceed the ability of KCL to accurately choose units which can result in warnings in your code or sometimes errors. In these cases, you will need to give KCL more information. Sometimes this can be done by making units explicit using suffixes. If not, then you will need to use *type ascription*, which asserts that an expression has the supplied type. For example, `(x * y): number(mm)` tells KCL that the units of `x * y` is mm. Note that type ascription does not do any adjustment of the numbers, e.g., `2mm: number(in)` has the value `2in` (note that this would be a very non-idiomatic way to use numeric type ascription, you could simply write `2in`. Usually type ascription is only necessary for supplying type information about the result of computation).
KCL has no support for area, volume, or other higher dimension units. When internal unit tracking requires multiple dimensions, KCL essentially gives up. This is usually where the extra type information described above is needed. If doing computation with higher dimensioned units, you must ensure that all adjustments occur before any computation. E.g., if you want to compute an area with unknown units, you must convert all numbers to the same unit before starting.
## Explicit conversions
You might sometimes need to convert from one unit to another for some calculation. You can do this implicitly when calling a function (see above), but if you can't or don't want to, then you can use the explicit conversion functions in the [`std::units`](/docs/kcl-std/modules/std-units) module.

View File

@ -0,0 +1,66 @@
---
title: "Pipelines"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
It can be hard to read repeated function calls, because of all the nested brackets.
```norun
i = 1
x = h(g(f(i)))
```
You can make this easier to read by breaking it into many declarations, but that is a bit annoying.
```norun
i = 1
x0 = f(i)
x1 = g(x0)
x = h(x1)
```
Instead, you can use the pipeline operator (`|>`) to simplify this.
Basically, `x |> f(%)` is a shorthand for `f(x)`. The left-hand side of the `|>` gets put into
the `%` in the right-hand side.
So, this means `x |> f(%) |> g(%)` is shorthand for `g(f(x))`. The code example above, with its
somewhat-clunky `x0` and `x1` constants could be rewritten as
```norun
i = 1
x = i
|> f(%)
|> g(%)
|> h(%)
```
This helps keep your code neat and avoid unnecessary declarations.
## Pipelines and keyword arguments
Say you have a long pipeline of sketch functions, like this:
```norun
startSketchOn(XZ)
|> line(%, end = [3, 4])
|> line(%, end = [10, 10])
|> line(%, end = [-13, -14])
|> close(%)
```
In this example, each function call outputs a sketch, and it gets put into the next function call via
the `%`, into the first (unlabeled) argument.
If a function call uses an unlabeled first parameter, it will default to `%` if it's not given. This
means that `|> line(%, end = [3, 4])` and `|> line(end = [3, 4])` are equivalent! So the above
could be rewritten as
```norun
startSketchOn(XZ)
|> line(end = [3, 4])
|> line(end = [10, 10])
|> line(end = [-13, -14])
|> close()
```

View File

@ -1,23 +1,23 @@
---
title: "KCL Settings"
excerpt: "Documentation of settings for the KCL language and Zoo Modeling App."
title: "Settings"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
# KCL Settings
There are three levels of settings available in the KittyCAD modeling application:
There are three levels of settings available in Zoo Design Studio:
1. [User Settings](/docs/kcl/settings/user): Global settings that apply to all projects, stored in `user.toml`
2. [Project Settings](/docs/kcl/settings/project): Settings specific to a project, stored in `project.toml`
1. [User Settings](/docs/kcl-lang/settings/user): Global settings that apply to all projects, stored in `user.toml`
2. [Project Settings](/docs/kcl-lang/settings/project): Settings specific to a project, stored in `project.toml`
3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
## Configuration Files
The KittyCAD modeling app uses TOML files for configuration:
Zoo Design Studio uses TOML files for configuration:
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings/user)
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings/project)
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl-lang/settings/user)
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl-lang/settings/project)
## Per-file settings
@ -25,7 +25,7 @@ Settings which affect a single file are configured using the settings attribute.
This must be at the top of the KCL file (comments before the attribute are permitted).
For example:
```js
```kcl
// The settings attribute.
@settings(defaultLengthUnit = in)

View File

@ -35,7 +35,7 @@ base_unit = "in"
#### app
The settings for the modeling app.
The settings for the Design Studio.
**Default:** None
@ -55,20 +55,6 @@ This setting has further nested options. See the schema for full details.
The onboarding status of the app.
**Default:** None
##### theme_color
The hue of the primary theme color for the app.
**Default:** None
##### enable_ssao
Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.
**Default:** None
##### dismiss_web_banner
@ -128,13 +114,6 @@ The default unit to use in modeling dimensions.
Highlight edges of 3D objects?
**Default:** None
##### show_debug_panel
Whether to show the debug panel, which lets you see various states of the app to aid in development. Remove this when we remove backwards compatibility with the old settings file.
**Default:** None
##### enable_ssao

View File

@ -37,7 +37,7 @@ text_wrapping = false
#### app
The settings for the modeling app.
The settings for the Design Studio.
**Default:** None
@ -57,34 +57,6 @@ This setting has further nested options. See the schema for full details.
The onboarding status of the app.
**Default:** None
##### project_directory
Backwards compatible project directory setting.
**Default:** None
##### theme
Backwards compatible theme setting.
**Default:** None
##### theme_color
The hue of the primary theme color for the app.
**Default:** None
##### enable_ssao
Whether or not Screen Space Ambient Occlusion (SSAO) is enabled.
**Default:** None
##### dismiss_web_banner
@ -96,14 +68,14 @@ Permanently dismiss the banner warning to download the desktop app. This setting
##### stream_idle_mode
When the user is idle, and this is true, the stream will be torn down.
When the user is idle, teardown the stream after some time.
**Default:** None
##### allow_orbit_in_sketch_mode
When the user is idle, and this is true, the stream will be torn down.
Allow orbiting in sketch mode.
**Default:** None
@ -159,13 +131,6 @@ The controls for how to navigate the 3D view.
Highlight edges of 3D objects?
**Default:** None
##### show_debug_panel
Whether to show the debug panel, which lets you see various states of the app to aid in development. Remove this when we remove backwards compatibility with the old settings file.
**Default:** None
##### enable_ssao

173
docs/kcl-lang/types.md Normal file
View File

@ -0,0 +1,173 @@
---
title: "Values and types"
excerpt: "Documentation of the KCL language for the Zoo Design Studio."
layout: manual
---
`KCL` defines the following types and keywords the language.
All these types can be nested in various forms where nesting applies. Like
arrays can hold objects and vice versa.
## Constant declaration
Constants are defined with a name and a value, like so:
```
myBool = false
```
Currently you cannot redeclare a constant.
## Arrays
An array is defined with `[]` braces. What is inside the brackets can
be of any type. For example, the following is completely valid:
```
myArray = ["thing", 2, false]
```
If you want to get a value from an array you can use the index like so:
`myArray[0]`.
## Objects
An object is defined with `{}` braces. Here is an example object:
```
myObj = { a = 0, b = "thing" }
```
We support two different ways of getting properties from objects, you can call
`myObj.a` or `myObj["a"]` both work.
## `ImportedGeometry`
Using `import` you can import geometry defined using other CAD software. In KCL,
these objects have type `ImportedGeometry` and can mostly be treated like any
other solid (they can be rotated, scaled, etc.), although there is no access to
their internal components. See the [modules and imports docs](modules) for more
detail on importing geometry.
## Tags
Tags are used to give a name (tag) to a specific path.
### `TagDeclarator`
The syntax for declaring a tag is `$myTag` you would use it in the following
way:
```norun
startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
```
### `TagIdentifier`
As per the example above you can use the tag identifier to get a reference to the
tagged object. The syntax for this is `myTag`.
In the example above we use the tag identifier to get the angle of the segment
`segAng(rectangleSegmentA001)`.
### `Start`
There is a special tag, `START` (with type `Start`, although under the cover, it's a string)
for identifying the face of a solid which was the start of an extrusion (i.e., the surface which
is extruded).
### `End`
There is a special tag, `END` (with type `End`, although under the cover, it's a string)
for identifying the face of a solid which was finishes an extrusion.
### Tag Scope
Tags are scoped globally if in the root context meaning in this example you can
use the tag `rectangleSegmentA001` in any function or expression in the file.
However if the code was written like this:
```norun
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
rect(origin = [20, 0])
```
Those tags would only be available in the `rect` function and not globally.
However you likely want to use those tags somewhere outside the `rect` function.
Tags are accessible through the sketch group they are declared in.
For example the following code works.
```norun
fn rect(origin) {
return startSketchOn(XZ)
|> startProfile(at = origin)
|> angledLine(angle = 0, length = 191.26, tag = $rectangleSegmentA001)
|> angledLine(
angle = segAng(rectangleSegmentA001) - 90,
length = 196.99,
tag = $rectangleSegmentB001,
)
|> angledLine(
angle = segAng(rectangleSegmentA001),
length = -segLen(rectangleSegmentA001),
tag = $rectangleSegmentC001,
)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
}
rect(origin = [0, 0])
myRect = rect(origin = [20, 0])
myRect
|> extrude(length = 10)
|> fillet(radius = 0.5, tags = [myRect.tags.rectangleSegmentA001])
```
See how we use the tag `rectangleSegmentA001` in the `fillet` function outside
the `rect` function. This is because the `rect` function is returning the
sketch group that contains the tags.
---
If you find any issues using any of the above expressions or syntax,
please file an issue with the `ast` label on the [modeling-app
repo](https://github.com/KittyCAD/modeling-app/issues/new).

5
docs/kcl-std/README.md Normal file
View File

@ -0,0 +1,5 @@
# Autogenerated docs
Everything in this directory and its subdirectories (except this file) is automatically generated. Do not edit anything in this directory directly, your changes will be lost.
The directory contents are generated by running the `test_generate_stdlib_markdown_docs` test in `/rust/kcl-lib/src/docs/gen_std_tests.rs`. Files are generated from the standard library declared in KCL (`/rust/kcl-lib/std`) and in Rust (`/rust/kcl-lib/src/std`), and by copying files from `../kcl-src`.

View File

@ -1,42 +1,52 @@
---
title: "angledLine"
subtitle: "Function in std::sketch"
excerpt: "Draw a line segment relative to the current origin using the polar measure of some angle and distance."
layout: manual
---
Draw a line segment relative to the current origin using the polar measure of some angle and distance.
```js
```kcl
angledLine(
data: AngledLineData,
sketch: Sketch,
@sketch: Sketch,
angle: number,
length?: number,
lengthX?: number,
lengthY?: number,
endAbsoluteX?: number,
endAbsoluteY?: number,
tag?: TagDeclarator,
): Sketch
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
| `length` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the given angle. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `lengthX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `lengthY` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line this distance along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteX` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the X axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| `endAbsoluteY` | [`number`](/docs/kcl-std/types/std-types-number) | Draw the line along the given angle until it reaches this point along the Y axis. Only one of `length`, `lengthX`, `lengthY`, `endAbsoluteX`, `endAbsoluteY` can be given. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch)
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> yLine(endAbsolute = 15)
|> angledLine({ angle = 30, length = 15 }, %)
|> angledLine(angle = 30, length = 15)
|> line(end = [8, -10])
|> yLine(endAbsolute = 0)
|> close()

View File

@ -1,48 +1,48 @@
---
title: "angledLineThatIntersects"
subtitle: "Function in std::sketch"
excerpt: "Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment."
layout: manual
---
Draw an angled line from the current origin, constructing a line segment such that the newly created line intersects the desired target line segment.
```js
```kcl
angledLineThatIntersects(
data: AngledLineThatIntersectsData,
sketch: Sketch,
@sketch: Sketch,
angle: number,
intersectTag: TagIdentifier,
offset?: number,
tag?: TagDeclarator,
): Sketch
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `angle` | [`number`](/docs/kcl-std/types/std-types-number) | Which angle should the line be drawn at? | Yes |
| `intersectTag` | [`TagIdentifier`](/docs/kcl-lang/types#TagIdentifier) | The tag of the line to intersect with | Yes |
| `offset` | [`number`](/docs/kcl-std/types/std-types-number) | The offset from the intersecting line. Defaults to 0. | No |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch)
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [5, 10])
|> line(endAbsolute = [-10, 10], tag = $lineToIntersect)
|> line(endAbsolute = [0, 20])
|> angledLineThatIntersects({
angle = 80,
intersectTag = lineToIntersect,
offset = 10
}, %)
|> angledLineThatIntersects(angle = 80, intersectTag = lineToIntersect, offset = 10)
|> close()
example = extrude(exampleSketch, length = 10)

File diff suppressed because one or more lines are too long

66
docs/kcl-std/arc.md Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,46 +1,46 @@
---
title: "bezierCurve"
subtitle: "Function in std::sketch"
excerpt: "Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape."
layout: manual
---
Draw a smooth, continuous, curved line segment from the current origin to the desired (x, y), using a number of control points to shape the curve's shape.
```js
```kcl
bezierCurve(
data: BezierData,
sketch: Sketch,
@sketch: Sketch,
control1: Point2d,
control2: Point2d,
end: Point2d,
tag?: TagDeclarator,
): Sketch
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`BezierData`](/docs/kcl/types/BezierData) | Data to draw a bezier curve. | Yes |
| `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | | Yes |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | | No |
| `sketch` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) | Which sketch should this path be added to? | Yes |
| `control1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | First control point for the cubic | Yes |
| `control2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | Second control point for the cubic | Yes |
| `end` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | How far away (along the X and Y axes) should this line go? | Yes |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Create a new tag which refers to this line | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch)
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [0, 10])
|> bezierCurve({
to = [10, 10],
control1 = [5, 0],
control2 = [5, 10]
}, %)
|> bezierCurve(control1 = [5, 0], control2 = [5, 10], end = [10, 10])
|> line(endAbsolute = [10, 0])
|> close()

View File

@ -1,42 +1,42 @@
---
title: "circleThreePoint"
subtitle: "Function in std::sketch"
excerpt: "Construct a circle derived from 3 points."
layout: manual
---
Construct a circle derived from 3 points.
```js
```kcl
circleThreePoint(
sketchSurfaceOrGroup: SketchOrSurface,
p1: [number],
p2: [number],
p3: [number],
@sketchSurfaceOrGroup: Sketch | Plane | Face,
p1: Point2d,
p2: Point2d,
p3: Point2d,
tag?: TagDeclarator,
): Sketch
```
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `sketchSurfaceOrGroup` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | Plane or surface to sketch on. | Yes |
| `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 |
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Identifier for the circle to reference elsewhere. | No |
| `sketchSurfaceOrGroup` | [`Sketch`](/docs/kcl-std/types/std-types-Sketch) or [`Plane`](/docs/kcl-std/types/std-types-Plane) or [`Face`](/docs/kcl-std/types/std-types-Face) | Plane or surface to sketch on. | Yes |
| `p1` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 1st point to derive the circle. | Yes |
| `p2` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 2nd point to derive the circle. | Yes |
| `p3` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | 3rd point to derive the circle. | Yes |
| [`tag`](/docs/kcl-std/types/std-types-tag) | [`TagDeclarator`](/docs/kcl-lang/types#TagDeclarator) | Identifier for the circle to reference elsewhere. | No |
### Returns
[`Sketch`](/docs/kcl/types/Sketch)
[`Sketch`](/docs/kcl-std/types/std-types-Sketch) - A sketch is a collection of paths.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XY)
|> circleThreePoint(p1 = [10, 10], p2 = [20, 8], p3 = [15, 5])
|> extrude(length = 5)

258
docs/kcl-std/clone.md Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,9 +9,14 @@ layout: manual
### `std`
- [`END`](/docs/kcl/consts/std-END)
- [`START`](/docs/kcl/consts/std-START)
- [`X`](/docs/kcl/consts/std-X)
- [`XY`](/docs/kcl/consts/std-XY)
- [`XZ`](/docs/kcl/consts/std-XZ)
- [`Y`](/docs/kcl/consts/std-Y)
- [`YZ`](/docs/kcl/consts/std-YZ)
- [`Z`](/docs/kcl/consts/std-Z)
### `std::math`

View File

@ -0,0 +1,16 @@
---
title: "END"
subtitle: "Constant in std"
excerpt: "Identifies the ending face of an extrusion. I.e., the new face created by an extrusion."
layout: manual
---
Identifies the ending face of an extrusion. I.e., the new face created by an extrusion.
```kcl
END: string = 'end'
```

View File

@ -0,0 +1,16 @@
---
title: "START"
subtitle: "Constant in std"
excerpt: "Identifies the starting face of an extrusion. I.e., the face which is extruded."
layout: manual
---
Identifies the starting face of an extrusion. I.e., the face which is extruded.
```kcl
START: string = 'start'
```

View File

@ -0,0 +1,16 @@
---
title: "X"
subtitle: "Constant in std"
excerpt: "The X-axis (can be used in both 2d and 3d contexts)."
layout: manual
---
The X-axis (can be used in both 2d and 3d contexts).
```kcl
X
```

View File

@ -0,0 +1,16 @@
---
title: "XY"
subtitle: "Constant in std"
excerpt: "An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis."
layout: manual
---
An abstract 3d plane aligned with the X and Y axes. Its normal is the positive Z axis.
```kcl
XY
```

View File

@ -0,0 +1,16 @@
---
title: "XZ"
subtitle: "Constant in std"
excerpt: "An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis."
layout: manual
---
An abstract 3d plane aligned with the X and Z axes. Its normal is the negative Y axis.
```kcl
XZ
```

View File

@ -0,0 +1,16 @@
---
title: "Y"
subtitle: "Constant in std"
excerpt: "The Y-axis (can be used in both 2d and 3d contexts)."
layout: manual
---
The Y-axis (can be used in both 2d and 3d contexts).
```kcl
Y
```

View File

@ -0,0 +1,16 @@
---
title: "YZ"
subtitle: "Constant in std"
excerpt: "An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis."
layout: manual
---
An abstract 3d plane aligned with the Y and Z axes. Its normal is the positive X axis.
```kcl
YZ
```

View File

@ -0,0 +1,16 @@
---
title: "Z"
subtitle: "Constant in std"
excerpt: "The 3D Z-axis."
layout: manual
---
The 3D Z-axis.
```kcl
Z
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
---
title: "turns::HALF_TURN"
subtitle: "Constant in std::turns"
excerpt: "A half turn, 180 degrees or π radians."
layout: manual
---
A half turn, 180 degrees or π radians.
```kcl
turns::HALF_TURN: number(deg) = 180deg
```

View File

@ -0,0 +1,16 @@
---
title: "turns::QUARTER_TURN"
subtitle: "Constant in std::turns"
excerpt: "A quarter turn, 90 degrees or π/2 radians."
layout: manual
---
A quarter turn, 90 degrees or π/2 radians.
```kcl
turns::QUARTER_TURN: number(deg) = 90deg
```

View File

@ -0,0 +1,16 @@
---
title: "turns::THREE_QUARTER_TURN"
subtitle: "Constant in std::turns"
excerpt: "Three quarters of a turn, 270 degrees or 1.5*π radians."
layout: manual
---
Three quarters of a turn, 270 degrees or 1.5*π radians.
```kcl
turns::THREE_QUARTER_TURN: number(deg) = 270deg
```

View File

@ -0,0 +1,16 @@
---
title: "turns::ZERO"
subtitle: "Constant in std::turns"
excerpt: "No turn, zero degrees/radians."
layout: manual
---
No turn, zero degrees/radians.
```kcl
turns::ZERO: number = 0
```

104
docs/kcl-std/extrude.md Normal file

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,44 +1,46 @@
---
title: "abs"
subtitle: "Function in std::math"
excerpt: "Compute the absolute value of a number."
layout: manual
---
Compute the absolute value of a number.
```js
abs(num: number): number
```kcl
abs(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
myAngle = -120
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [8, 0])
|> angledLine({ angle = abs(myAngle), length = 5 }, %)
|> angledLine(
angle = abs(myAngle),
length = 5,
)
|> line(end = [-5, 0])
|> angledLine({ angle = myAngle, length = 5 }, %)
|> angledLine(
angle = myAngle,
length = 5,
)
|> close()
baseExtrusion = extrude(sketch001, length = 5)

View File

@ -1,42 +1,38 @@
---
title: "acos"
excerpt: "Compute the arccosine of a number (in radians)."
subtitle: "Function in std::math"
excerpt: "Compute the arccosine of a number."
layout: manual
---
Compute the arccosine of a number (in radians).
Compute the arccosine of a number.
```js
acos(num: number): number
```kcl
acos(@num: number(_)): number(rad)
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({
angle = toDegrees(acos(0.5)),
length = 10
}, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = acos(0.5),
length = 10,
)
|> line(end = [5, 0])
|> line(endAbsolute = [12, 0])
|> close()

View File

@ -1,42 +1,38 @@
---
title: "asin"
excerpt: "Compute the arcsine of a number (in radians)."
subtitle: "Function in std::math"
excerpt: "Compute the arcsine of a number."
layout: manual
---
Compute the arcsine of a number (in radians).
Compute the arcsine of a number.
```js
asin(num: number): number
```kcl
asin(@num: number(_)): number(rad)
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({
angle = toDegrees(asin(0.5)),
length = 20
}, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = asin(0.5),
length = 20,
)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -0,0 +1,43 @@
---
title: "atan"
subtitle: "Function in std::math"
excerpt: "Compute the arctangent of a number."
layout: manual
---
Compute the arctangent of a number.
```kcl
atan(@num: number(_)): number(rad)
```
Consider using `atan2()` instead for the true inverse of tangent.
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number(_)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```kcl
sketch001 = startSketchOn(XZ)
|> startProfile(at = [0, 0])
|> angledLine(
angle = atan(1.25),
length = 20,
)
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)
```

View File

@ -1,46 +1,42 @@
---
title: "atan2"
excerpt: "Compute the four quadrant arctangent of Y and X (in radians)."
subtitle: "Function in std::math"
excerpt: "Compute the four quadrant arctangent of Y and X."
layout: manual
---
Compute the four quadrant arctangent of Y and X (in radians).
Compute the four quadrant arctangent of Y and X.
```js
```kcl
atan2(
y: number,
x: number,
): number
y: number(Length),
x: number(Length),
): number(rad)
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `y` | [`number`](/docs/kcl/types/number) | | Yes |
| `x` | [`number`](/docs/kcl/types/number) | | Yes |
| `y` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
| `x` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number(rad)`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({
angle = toDegrees(atan2(1.25, 2)),
length = 20
}, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = atan2(y = 1.25, x = 2),
length = 20,
)
|> yLine(endAbsolute = 0)
|> close()

View File

@ -1,38 +1,34 @@
---
title: "ceil"
subtitle: "Function in std::math"
excerpt: "Compute the smallest integer greater than or equal to a number."
layout: manual
---
Compute the smallest integer greater than or equal to a number.
```js
ceil(num: number): number
```kcl
ceil(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(endAbsolute = [12, 10])
|> line(end = [ceil(7.02986), 0])
|> yLine(endAbsolute = 0)

File diff suppressed because one or more lines are too long

View File

@ -1,42 +1,38 @@
---
title: "floor"
subtitle: "Function in std::math"
excerpt: "Compute the largest integer less than or equal to a number."
layout: manual
---
Compute the largest integer less than or equal to a number.
```js
floor(num: number): number
```kcl
floor(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10])
|> line(end = [floor(7.02986), 0])
|> yLine(endAbsolute = 0)
|> close()
|> startProfile(at = [0, 0])
|> line(endAbsolute = [12, 10])
|> line(end = [floor(7.02986), 0])
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)
```

View File

@ -1,38 +1,34 @@
---
title: "ln"
subtitle: "Function in std::math"
excerpt: "Compute the natural logarithm of the number."
layout: manual
---
Compute the natural logarithm of the number.
```js
ln(num: number): number
```kcl
ln(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [ln(100), 15])
|> line(end = [5, -6])
|> line(end = [-10, -10])

View File

@ -1,43 +1,41 @@
---
title: "log"
subtitle: "Function in std::math"
excerpt: "Compute the logarithm of the number with respect to an arbitrary base."
layout: manual
---
Compute the logarithm of the number with respect to an arbitrary base.
The result might not be correctly rounded owing to implementation details; `log2()` can produce more accurate results for base 2, and `log10()` can produce more accurate results for base 10.
```js
```kcl
log(
num: number,
base: number,
@input: number,
base: number(_),
): number
```
### Tags
* `math`
The result might not be correctly rounded owing to implementation
details; `log2` can produce more accurate results for base 2,
and `log10` can produce more accurate results for base 10.
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `base` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to compute the logarithm of. | Yes |
| `base` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The base of the logarithm. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = [log(100, 5), 0])
|> startProfile(at = [0, 0])
|> line(end = [log(100, base = 5), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])
|> close()

View File

@ -1,38 +1,34 @@
---
title: "log10"
subtitle: "Function in std::math"
excerpt: "Compute the base 10 logarithm of the number."
layout: manual
---
Compute the base 10 logarithm of the number.
```js
log10(num: number): number
```kcl
log10(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [log10(100), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])

View File

@ -1,38 +1,34 @@
---
title: "log2"
subtitle: "Function in std::math"
excerpt: "Compute the base 2 logarithm of the number."
layout: manual
---
Compute the base 2 logarithm of the number.
```js
log2(num: number): number
```kcl
log2(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> startProfile(at = [0, 0])
|> line(end = [log2(100), 0])
|> line(end = [5, 8])
|> line(end = [-10, 0])

View File

@ -1,42 +1,38 @@
---
title: "max"
subtitle: "Function in std::math"
excerpt: "Compute the maximum of the given arguments."
layout: manual
---
Compute the maximum of the given arguments.
```js
max(args: [number]): number
```kcl
max(@input: [number; 1+]): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `args` | [`[number]`](/docs/kcl/types/number) | | Yes |
| `input` | [`[number; 1+]`](/docs/kcl-std/types/std-types-number) | An array of numbers to compute the maximum of. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({
angle = 70,
length = max(15, 31, 4, 13, 22)
}, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 70,
length = max([15, 31, 4, 13, 22])
)
|> line(end = [20, 0])
|> close()

View File

@ -1,42 +1,38 @@
---
title: "min"
subtitle: "Function in std::math"
excerpt: "Compute the minimum of the given arguments."
layout: manual
---
Compute the minimum of the given arguments.
```js
min(args: [number]): number
```kcl
min(@input: [number; 1+]): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `args` | [`[number]`](/docs/kcl/types/number) | | Yes |
| `input` | [`[number; 1+]`](/docs/kcl-std/types/std-types-number) | An array of numbers to compute the minimum of. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({
angle = 70,
length = min(15, 31, 4, 13, 22)
}, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 70,
length = min([15, 31, 4, 13, 22])
)
|> line(end = [20, 0])
|> close()

View File

@ -1,35 +1,40 @@
---
title: "polar"
excerpt: "Convert polar/sphere (azimuth, elevation, distance) coordinates to cartesian (x/y/z grid) coordinates."
subtitle: "Function in std::math"
excerpt: ""
layout: manual
---
Convert polar/sphere (azimuth, elevation, distance) coordinates to cartesian (x/y/z grid) coordinates.
```js
polar(data: PolarCoordsData): [number]
```kcl
polar(
angle: number(rad),
length: number(Length),
): Point2d
```
Convert polar/sphere (azimuth, elevation, distance) coordinates to
cartesian (x/y/z grid) coordinates.
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `data` | [`PolarCoordsData`](/docs/kcl/types/PolarCoordsData) | Data for polar coordinates. | Yes |
| `angle` | [`number(rad)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
| `length` | [`number(Length)`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`[number]`](/docs/kcl/types/number)
[`Point2d`](/docs/kcl-std/types/std-types-Point2d) - A point in two dimensional space.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(end = polar({ angle = 30, length = 5 }), tag = $thing)
|> startProfile(at = [0, 0])
|> line(end = polar(angle = 30, length = 5), tag = $thing)
|> line(end = [0, 5])
|> line(end = [segEndX(thing), 0])
|> line(end = [-20, 10])

View File

@ -1,43 +1,42 @@
---
title: "pow"
subtitle: "Function in std::math"
excerpt: "Compute the number to a power."
layout: manual
---
Compute the number to a power.
```js
```kcl
pow(
num: number,
pow: number,
@input: number,
exp: number(_),
): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `pow` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | The number to raise. | Yes |
| `exp` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The power to raise to. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({ angle = 50, length = pow(5, 2) }, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = pow(5, exp = 2),
)
|> yLine(endAbsolute = 0)
|> close()

File diff suppressed because one or more lines are too long

View File

@ -1,42 +1,38 @@
---
title: "round"
subtitle: "Function in std::math"
excerpt: "Round a number to the nearest integer."
layout: manual
---
Round a number to the nearest integer.
```js
round(num: number): number
```kcl
round(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
sketch001 = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [12, 10])
|> line(end = [round(7.02986), 0])
|> yLine(endAbsolute = 0)
|> close()
|> startProfile(at = [0, 0])
|> line(endAbsolute = [12, 10])
|> line(end = [round(7.02986), 0])
|> yLine(endAbsolute = 0)
|> close()
extrude001 = extrude(sketch001, length = 5)
```

File diff suppressed because one or more lines are too long

View File

@ -1,39 +1,38 @@
---
title: "sqrt"
subtitle: "Function in std::math"
excerpt: "Compute the square root of a number."
layout: manual
---
Compute the square root of a number.
```js
sqrt(num: number): number
```kcl
sqrt(@input: number): number
```
### Tags
* `math`
### Arguments
| Name | Type | Description | Required |
|----------|------|-------------|----------|
| `num` | [`number`](/docs/kcl/types/number) | | Yes |
| `input` | [`number`](/docs/kcl-std/types/std-types-number) | A number. | Yes |
### Returns
[`number`](/docs/kcl/types/number)
[`number`](/docs/kcl-std/types/std-types-number) - A number.
### Examples
```js
```kcl
exampleSketch = startSketchOn(XZ)
|> startProfileAt([0, 0], %)
|> angledLine({ angle = 50, length = sqrt(2500) }, %)
|> startProfile(at = [0, 0])
|> angledLine(
angle = 50,
length = sqrt(2500),
)
|> yLine(endAbsolute = 0)
|> close()

File diff suppressed because one or more lines are too long

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