diff --git a/docs/kcl/modules.md b/docs/kcl/modules.md index 7d49dc963..5cc34b605 100644 --- a/docs/kcl/modules.md +++ b/docs/kcl/modules.md @@ -12,7 +12,7 @@ to other modules. ``` // util.kcl -export fn increment = (x) => { +export fn increment(x) { return x + 1 } ``` @@ -37,11 +37,11 @@ Multiple functions can be exported in a file. ``` // util.kcl -export fn increment = (x) => { +export fn increment(x) { return x + 1 } -export fn decrement = (x) => { +export fn decrement(x) { return x - 1 } ``` diff --git a/docs/kcl/types.md b/docs/kcl/types.md index 673db9c3f..5e786e0af 100644 --- a/docs/kcl/types.md +++ b/docs/kcl/types.md @@ -54,7 +54,7 @@ We also 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) => { +fn myFn(x) { return x } ``` @@ -118,7 +118,7 @@ use the tag `rectangleSegmentA001` in any function or expression in the file. However if the code was written like this: ``` -fn rect = (origin) => { +fn rect(origin) { return startSketchOn('XZ') |> startProfileAt(origin, %) |> angledLine([0, 191.26], %, $rectangleSegmentA001) @@ -146,7 +146,7 @@ Tags are accessible through the sketch group they are declared in. For example the following code works. ``` -fn rect = (origin) => { +fn rect(origin) { return startSketchOn('XZ') |> startProfileAt(origin, %) |> angledLine([0, 191.26], %, $rectangleSegmentA001) diff --git a/package.json b/package.json index f3b222d54..3ab3d9e25 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ "eslint-plugin-css-modules": "^2.12.0", "eslint-plugin-import": "^2.30.0", "eslint-plugin-suggest-no-throw": "^1.0.0", - "happy-dom": "^15.10.2", + "happy-dom": "^15.11.7", "http-server": "^14.1.1", "husky": "^9.1.5", "kill-port": "^2.0.1", @@ -212,7 +212,7 @@ "vite-tsconfig-paths": "^4.3.2", "vitest": "^1.6.0", "vitest-webgl-canvas-mock": "^1.1.0", - "wasm-pack": "^0.13.0", + "wasm-pack": "^0.13.1", "ws": "^8.17.0", "yarn": "^1.22.22" } diff --git a/src/components/ModelingMachineProvider.tsx b/src/components/ModelingMachineProvider.tsx index c5585f60f..f642cceae 100644 --- a/src/components/ModelingMachineProvider.tsx +++ b/src/components/ModelingMachineProvider.tsx @@ -83,7 +83,7 @@ import { getVarNameModal } from 'hooks/useToolbarGuards' import { err, reportRejection, trap } from 'lib/trap' import { useCommandsContext } from 'hooks/useCommandsContext' import { modelingMachineEvent } from 'editor/manager' -import { hasValidEdgeTreatmentSelection } from 'lang/modifyAst/addFillet' +import { hasValidEdgeTreatmentSelection } from 'lang/modifyAst/addEdgeTreatment' import { ExportIntent, EngineConnectionStateType, diff --git a/src/lang/modifyAst/addFillet.test.ts b/src/lang/modifyAst/addEdgeTreatment.test.ts similarity index 99% rename from src/lang/modifyAst/addFillet.test.ts rename to src/lang/modifyAst/addEdgeTreatment.test.ts index 12508c92f..e939dffc1 100644 --- a/src/lang/modifyAst/addFillet.test.ts +++ b/src/lang/modifyAst/addEdgeTreatment.test.ts @@ -18,7 +18,7 @@ import { FilletParameters, ChamferParameters, EdgeTreatmentParameters, -} from './addFillet' +} from './addEdgeTreatment' import { getNodeFromPath, getNodePathFromSourceRange } from '../queryAst' import { createLiteral } from 'lang/modifyAst' import { err } from 'lib/trap' diff --git a/src/lang/modifyAst/addFillet.ts b/src/lang/modifyAst/addEdgeTreatment.ts similarity index 100% rename from src/lang/modifyAst/addFillet.ts rename to src/lang/modifyAst/addEdgeTreatment.ts diff --git a/src/machines/modelingMachine.ts b/src/machines/modelingMachine.ts index 58bdf4082..eff6072b1 100644 --- a/src/machines/modelingMachine.ts +++ b/src/machines/modelingMachine.ts @@ -51,7 +51,7 @@ import { applyEdgeTreatmentToSelection, EdgeTreatmentType, FilletParameters, -} from 'lang/modifyAst/addFillet' +} from 'lang/modifyAst/addEdgeTreatment' import { getNodeFromPath } from '../lang/queryAst' import { applyConstraintEqualAngle, diff --git a/src/wasm-lib/Cargo.lock b/src/wasm-lib/Cargo.lock index c481905ab..7d4d6fcf9 100644 --- a/src/wasm-lib/Cargo.lock +++ b/src/wasm-lib/Cargo.lock @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "kcl-lib" -version = "0.2.26" +version = "0.2.27" dependencies = [ "anyhow", "approx 0.5.1", diff --git a/src/wasm-lib/kcl/Cargo.toml b/src/wasm-lib/kcl/Cargo.toml index ba1c17e2d..95d28749a 100644 --- a/src/wasm-lib/kcl/Cargo.toml +++ b/src/wasm-lib/kcl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kcl-lib" description = "KittyCAD Language implementation and tools" -version = "0.2.26" +version = "0.2.27" edition = "2021" license = "MIT" repository = "https://github.com/KittyCAD/modeling-app" @@ -16,7 +16,10 @@ async-recursion = "1.1.1" async-trait = "0.1.83" base64 = "0.22.1" chrono = "0.4.38" -clap = { version = "4.5.21", default-features = false, optional = true, features = ["std", "derive"] } +clap = { version = "4.5.21", default-features = false, optional = true, features = [ + "std", + "derive", +] } convert_case = "0.6.0" dashmap = "6.1.0" databake = { version = "0.1.8", features = ["derive"] } @@ -38,16 +41,32 @@ miette = "7.2.0" mime_guess = "2.0.5" parse-display = "0.9.1" pyo3 = { version = "0.22.6", optional = true } -reqwest = { version = "0.12", default-features = false, features = ["stream", "rustls-tls"] } +reqwest = { version = "0.12", default-features = false, features = [ + "stream", + "rustls-tls", +] } ropey = "1.6.1" -schemars = { version = "0.8.17", features = ["impl_json_schema", "indexmap2", "url", "uuid1", "preserve_order"] } +schemars = { version = "0.8.17", features = [ + "impl_json_schema", + "indexmap2", + "url", + "uuid1", + "preserve_order", +] } serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.128" sha2 = "0.10.8" tabled = { version = "0.15.0", optional = true } thiserror = "2.0.0" toml = "0.8.19" -ts-rs = { version = "10.0.0", features = ["uuid-impl", "url-impl", "chrono-impl", "indexmap-impl", "no-serde-warnings", "serde-json-impl"] } +ts-rs = { version = "10.0.0", features = [ + "uuid-impl", + "url-impl", + "chrono-impl", + "indexmap-impl", + "no-serde-warnings", + "serde-json-impl", +] } url = { version = "2.5.3", features = ["serde"] } urlencoding = "2.1.3" uuid = { version = "1.11.0", features = ["v4", "js", "serde"] } @@ -59,7 +78,9 @@ zip = { version = "2.0.0", default-features = false } [target.'cfg(target_arch = "wasm32")'.dependencies] js-sys = { version = "0.3.72" } tokio = { version = "1.41.1", features = ["sync", "time"] } -tower-lsp = { version = "0.20.0", default-features = false, features = ["runtime-agnostic"] } +tower-lsp = { version = "0.20.0", default-features = false, features = [ + "runtime-agnostic", +] } wasm-bindgen = "0.2.91" wasm-bindgen-futures = "0.4.44" web-sys = { version = "0.3.72", features = ["console"] } @@ -68,7 +89,9 @@ web-sys = { version = "0.3.72", features = ["console"] } approx = "0.5" bson = { version = "2.13.0", features = ["uuid-1", "chrono"] } tokio = { version = "1.41.1", features = ["full"] } -tokio-tungstenite = { version = "0.24.0", features = ["rustls-tls-native-roots"] } +tokio-tungstenite = { version = "0.24.0", features = [ + "rustls-tls-native-roots", +] } tower-lsp = { version = "0.20.0", features = ["proposed"] } [features] diff --git a/src/wasm-lib/kcl/tests/sketch_on_face_end_negative_extrude/rendered_model.png b/src/wasm-lib/kcl/tests/sketch_on_face_end_negative_extrude/rendered_model.png index 847922f00..31d2b08af 100644 Binary files a/src/wasm-lib/kcl/tests/sketch_on_face_end_negative_extrude/rendered_model.png and b/src/wasm-lib/kcl/tests/sketch_on_face_end_negative_extrude/rendered_model.png differ diff --git a/yarn.lock b/yarn.lock index f5c070cba..5e4f0f8e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5511,11 +5511,16 @@ flux@^4.0.1: fbemitter "^3.0.0" fbjs "^3.0.1" -follow-redirects@^1.0.0, follow-redirects@^1.14.8: +follow-redirects@^1.0.0: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== +follow-redirects@^1.14.8: + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -5931,10 +5936,10 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -happy-dom@^15.10.2: - version "15.10.2" - resolved "https://registry.yarnpkg.com/happy-dom/-/happy-dom-15.10.2.tgz#14ae6652d1a80d2611e3f5832cb61ab5e2d1b539" - integrity sha512-NbA5XrSovenJIIcfixCREX3ZnV7yHP4phhbfuxxf4CPn+LZpz/jIM9EqJ2DrPwgVDSMoAKH3pZwQvkbsSiCrUw== +happy-dom@^15.11.7: + version "15.11.7" + resolved "https://registry.yarnpkg.com/happy-dom/-/happy-dom-15.11.7.tgz#db9854f11e5dd3fd4ab20cbbcfdf7bd9e17cd971" + integrity sha512-KyrFvnl+J9US63TEzwoiJOQzZBJY7KgBushJA8X61DMbNsH+2ONkDuLDnCnwUiPTF42tLoEmrPyoqbenVA5zrg== dependencies: entities "^4.5.0" webidl-conversions "^7.0.0" @@ -9691,10 +9696,10 @@ warning@^4.0.3: dependencies: loose-envify "^1.0.0" -wasm-pack@^0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/wasm-pack/-/wasm-pack-0.13.0.tgz#c2637e0129e1854735f3daead45d92165d54709d" - integrity sha512-AmboGZEnZoIcVCzSlkLEmNFEqJN+IwgshJ5S7pi30uNUTce4LvWkifQzsQRxnWj47G8gkqZxlyGlyQplsnIS7w== +wasm-pack@^0.13.1: + version "0.13.1" + resolved "https://registry.yarnpkg.com/wasm-pack/-/wasm-pack-0.13.1.tgz#345701522420ad74a5b584f1bdaf6db8c264cb54" + integrity sha512-P9exD4YkjpDbw68xUhF3MDm/CC/3eTmmthyG5bHJ56kalxOTewOunxTke4SyF8MTXV6jUtNjXggPgrGmMtczGg== dependencies: binary-install "^1.0.1"