Skip to content

Commit 0bdc50c

Browse files
authored
bump kcl-lib and friends (#6063)
* bump kcl-lib and friends Signed-off-by: Jess Frazelle <[email protected]> * expose Signed-off-by: Jess Frazelle <[email protected]> * relevant files Signed-off-by: Jess Frazelle <[email protected]> * udpates Signed-off-by: Jess Frazelle <[email protected]> * fixes Signed-off-by: Jess Frazelle <[email protected]> * updates Signed-off-by: Jess Frazelle <[email protected]> --------- Signed-off-by: Jess Frazelle <[email protected]>
1 parent 57d78b6 commit 0bdc50c

File tree

17 files changed

+64
-31
lines changed

17 files changed

+64
-31
lines changed

rust/Cargo.lock

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ clap = { version = "4.5.31", features = ["derive"] }
3535
dashmap = { version = "6.1.0" }
3636
http = "1"
3737
indexmap = "2.7.0"
38-
kittycad = { version = "0.3.33", default-features = false, features = ["js", "requests"] }
38+
kittycad = { version = "0.3.36", default-features = false, features = ["js", "requests"] }
3939
kittycad-modeling-cmds = { version = "0.2.107", features = ["ts-rs", "websocket"] }
4040
lazy_static = "1.5.0"
4141
miette = "7.5.0"

rust/kcl-bumper/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[package]
33
name = "kcl-bumper"
4-
version = "0.1.55"
4+
version = "0.1.56"
55
edition = "2021"
66
repository = "https://github.com/KittyCAD/modeling-api"
77
rust-version = "1.76"

rust/kcl-derive-docs/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kcl-derive-docs"
33
description = "A tool for generating documentation from Rust derive macros"
4-
version = "0.1.55"
4+
version = "0.1.56"
55
edition = "2021"
66
license = "MIT"
77
repository = "https://github.com/KittyCAD/modeling-app"

rust/kcl-directory-test-macro/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kcl-directory-test-macro"
33
description = "A tool for generating tests from a directory of kcl files"
4-
version = "0.1.55"
4+
version = "0.1.56"
55
edition = "2021"
66
license = "MIT"
77
repository = "https://github.com/KittyCAD/modeling-app"

rust/kcl-language-server-release/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kcl-language-server-release"
3-
version = "0.1.55"
3+
version = "0.1.56"
44
edition = "2021"
55
authors = ["KittyCAD Inc <[email protected]>"]
66
publish = false

rust/kcl-language-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "kcl-language-server"
33
description = "A language server for KCL."
44
authors = ["KittyCAD Inc <[email protected]>"]
5-
version = "0.2.55"
5+
version = "0.2.56"
66
edition = "2021"
77
license = "MIT"
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

rust/kcl-lib/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kcl-lib"
33
description = "KittyCAD Language implementation and tools"
4-
version = "0.2.55"
4+
version = "0.2.56"
55
edition = "2021"
66
license = "MIT"
77
repository = "https://github.com/KittyCAD/modeling-app"
@@ -104,7 +104,7 @@ tower-lsp = { workspace = true, features = ["proposed", "default"] }
104104

105105
[features]
106106
default = ["engine"]
107-
cli = ["dep:clap"]
107+
cli = ["dep:clap", "kittycad/clap"]
108108
dhat-heap = ["dep:dhat"]
109109
# For the lsp server, when run with stdout for rpc we want to disable println.
110110
# This is used for editor extensions that use the lsp server.

rust/kcl-lib/src/coredump/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub trait CoreDump: Clone {
5353
.meta()
5454
.create_debug_uploads(vec![kittycad::types::multipart::Attachment {
5555
name: "".to_string(),
56-
filename: Some(format!(r#"modeling-app/coredump-{coredump_id}-screenshot.png"#)),
56+
filepath: Some(format!(r#"modeling-app/coredump-{coredump_id}-screenshot.png"#).into()),
5757
content_type: Some("image/png".to_string()),
5858
data,
5959
}])
@@ -101,7 +101,7 @@ pub trait CoreDump: Clone {
101101
.meta()
102102
.create_debug_uploads(vec![kittycad::types::multipart::Attachment {
103103
name: "".to_string(),
104-
filename: Some(format!(r#"modeling-app/coredump-{}.json"#, coredump_id)),
104+
filepath: Some(format!(r#"modeling-app/coredump-{}.json"#, coredump_id).into()),
105105
content_type: Some("application/json".to_string()),
106106
data,
107107
}])

rust/kcl-lib/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub use parsing::ast::{modify::modify_ast_for_sketch, types::FormatOptions};
9797
pub use settings::types::{project::ProjectConfiguration, Configuration, UnitLength};
9898
pub use source_range::SourceRange;
9999
#[cfg(not(target_arch = "wasm32"))]
100-
pub use unparser::recast_dir;
100+
pub use unparser::{recast_dir, walk_dir};
101101

102102
// Rather than make executor public and make lots of it pub(crate), just re-export into a new module.
103103
// Ideally we wouldn't export these things at all, they should only be used for testing.

rust/kcl-lib/src/lsp/kcl/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ impl Backend {
786786
vec![kittycad::types::multipart::Attachment {
787787
// Clean the URI part.
788788
name: "attachment".to_string(),
789-
filename: Some("attachment.zip".to_string()),
789+
filepath: Some("attachment.zip".into()),
790790
content_type: Some("application/x-zip".to_string()),
791791
data: self.create_zip().await?,
792792
}],

rust/kcl-lib/src/simulation_tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ async fn unparse_test(test: &Test) {
114114
let kcl_files = kcl_files.into_iter().filter(|f| f != &entry_point);
115115
let futures = kcl_files
116116
.into_iter()
117+
.filter(|file| file.extension().is_some_and(|ext| ext == "kcl")) // We only care about kcl
118+
// files here.
117119
.map(|file| {
118120
let snap_path = Path::new("..").join(&test.output_dir);
119121
tokio::spawn(async move {

rust/kcl-lib/src/unparser.rs

+34-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
use std::fmt::Write;
22

3+
#[cfg(feature = "cli")]
4+
use clap::ValueEnum;
5+
36
use crate::parsing::{
47
ast::types::{
58
Annotation, ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem,
@@ -864,10 +867,33 @@ impl Parameter {
864867
}
865868
}
866869

867-
/// Collect all the kcl files in a directory, recursively.
870+
lazy_static::lazy_static! {
871+
872+
pub static ref IMPORT_FILE_EXTENSIONS: Vec<String> = {
873+
let mut import_file_extensions = vec!["stp".to_string(), "glb".to_string(), "fbxb".to_string()];
874+
#[cfg(feature = "cli")]
875+
let named_extensions = kittycad::types::FileImportFormat::value_variants()
876+
.iter()
877+
.map(|x| format!("{}", x))
878+
.collect::<Vec<String>>();
879+
#[cfg(not(feature = "cli"))]
880+
let named_extensions = vec![]; // We don't really need this outside of the CLI.
881+
// Add all the default import formats.
882+
import_file_extensions.extend_from_slice(&named_extensions);
883+
import_file_extensions
884+
};
885+
886+
pub static ref RELEVANT_EXTENSIONS: Vec<String> = {
887+
let mut relevant_extensions = IMPORT_FILE_EXTENSIONS.clone();
888+
relevant_extensions.push("kcl".to_string());
889+
relevant_extensions
890+
};
891+
}
892+
893+
/// Collect all the kcl (and other relevant) files in a directory, recursively.
868894
#[cfg(not(target_arch = "wasm32"))]
869895
#[async_recursion::async_recursion]
870-
pub(crate) async fn walk_dir(dir: &std::path::PathBuf) -> Result<Vec<std::path::PathBuf>, anyhow::Error> {
896+
pub async fn walk_dir(dir: &std::path::PathBuf) -> Result<Vec<std::path::PathBuf>, anyhow::Error> {
871897
// Make sure we actually have a directory.
872898
if !dir.is_dir() {
873899
anyhow::bail!("`{}` is not a directory", dir.display());
@@ -881,7 +907,10 @@ pub(crate) async fn walk_dir(dir: &std::path::PathBuf) -> Result<Vec<std::path::
881907

882908
if path.is_dir() {
883909
files.extend(walk_dir(&path).await?);
884-
} else if path.extension().is_some_and(|ext| ext == "kcl") {
910+
} else if path
911+
.extension()
912+
.is_some_and(|ext| RELEVANT_EXTENSIONS.contains(&ext.to_string_lossy().to_string()))
913+
{
885914
files.push(path);
886915
}
887916
}
@@ -901,6 +930,8 @@ pub async fn recast_dir(dir: &std::path::Path, options: &crate::FormatOptions) -
901930

902931
let futures = files
903932
.into_iter()
933+
.filter(|file| file.extension().is_some_and(|ext| ext == "kcl")) // We only care about kcl
934+
// files here.
904935
.map(|file| {
905936
let options = options.clone();
906937
tokio::spawn(async move {

rust/kcl-python-bindings/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kcl-python-bindings"
3-
version = "0.3.55"
3+
version = "0.3.56"
44
edition = "2021"
55
repository = "https://github.com/kittycad/modeling-app"
66

rust/kcl-test-server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kcl-test-server"
33
description = "A test server for KCL"
4-
version = "0.1.55"
4+
version = "0.1.56"
55
edition = "2021"
66
license = "MIT"
77

rust/kcl-to-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "kcl-to-core"
33
description = "Utility methods to convert kcl to engine core executable tests"
4-
version = "0.1.55"
4+
version = "0.1.56"
55
edition = "2021"
66
license = "MIT"
77
repository = "https://github.com/KittyCAD/modeling-app"

rust/kcl-wasm-lib/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "kcl-wasm-lib"
3-
version = "0.1.55"
3+
version = "0.1.56"
44
edition = "2021"
55
repository = "https://github.com/KittyCAD/modeling-app"
66
rust-version = "1.83"

0 commit comments

Comments
 (0)