Skip to content

Commit

Permalink
update kcl-lib
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Sep 17, 2023
1 parent 7a5c720 commit 906d6a2
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 48 deletions.
6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git_rev = "0.1.0"
heck = "0.4.0"
http = "0.2.6"
itertools = "0.11.0"
kcl-lib = { version = "0.1.28" }
kcl-lib = { version = "0.1.29" }
#kcl-lib = { path = "../modeling-app/src/wasm-lib/kcl" }
kittycad = { version = "0.2.25", features = ["clap", "tabled", "requests", "retry"] }
log = "0.4.20"
Expand Down
10 changes: 5 additions & 5 deletions cli-macro-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ impl Operation {
#(#additional_struct_params)*
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for #struct_name {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
#(#mutable_variables)*
Expand Down Expand Up @@ -913,7 +913,7 @@ impl Operation {
#(#additional_struct_params)*
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for #struct_name {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
#check_nothing_to_edit
Expand Down Expand Up @@ -1006,7 +1006,7 @@ impl Operation {
#format_flag
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for #struct_name {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
if self.web {
Expand Down Expand Up @@ -1083,7 +1083,7 @@ impl Operation {
#format_flag
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for #struct_name {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
if self.limit < 1 {
Expand Down Expand Up @@ -1197,7 +1197,7 @@ impl Operation {
pub confirm: bool,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for #struct_name {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
if !ctx.io.can_prompt() && !self.confirm {
Expand Down
6 changes: 3 additions & 3 deletions cli-macro-impl/tests/gen/users.rs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct CmdUserView {
pub format: Option<crate::types::FormatOutput>,
}

#[async_trait::async_trait]
# [async_trait :: async_trait (? Send)]
impl crate::cmd::Command for CmdUserView {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
if self.web {
Expand Down Expand Up @@ -60,7 +60,7 @@ pub struct CmdUserEdit {
pub new_phone: kittycad::types::phone_number::PhoneNumber,
}

#[async_trait::async_trait]
# [async_trait :: async_trait (? Send)]
impl crate::cmd::Command for CmdUserEdit {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
if self.new_company.is_none()
Expand Down Expand Up @@ -108,7 +108,7 @@ pub struct CmdUserDelete {
pub confirm: bool,
}

#[async_trait::async_trait]
# [async_trait :: async_trait (? Send)]
impl crate::cmd::Command for CmdUserDelete {
async fn run(&self, ctx: &mut crate::context::Context) -> anyhow::Result<()> {
if !ctx.io.can_prompt() && !self.confirm {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use anyhow::Result;
}*/

/// This trait describes a command.
#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
pub trait Command {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()>;
}
Expand Down
8 changes: 4 additions & 4 deletions src/cmd_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum SubCommand {
List(CmdAliasList),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAlias {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand All @@ -41,7 +41,7 @@ pub struct CmdAliasDelete {
pub alias: String,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAliasDelete {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let mut alias_config = ctx.config.aliases()?;
Expand Down Expand Up @@ -102,7 +102,7 @@ pub struct CmdAliasSet {
pub shell: bool,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAliasSet {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let cs = ctx.io.color_scheme();
Expand Down Expand Up @@ -173,7 +173,7 @@ impl crate::cmd::Command for CmdAliasSet {
#[clap(verbatim_doc_comment)]
pub struct CmdAliasList {}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAliasList {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let config_aliases = ctx.config.aliases()?;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub struct PaginatableResponse {
pub next_page: Option<String>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdApi {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Let's get the api client.
Expand Down
4 changes: 2 additions & 2 deletions src/cmd_api_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum SubCommand {
Status(CmdApiCallStatus),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdApiCall {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand All @@ -43,7 +43,7 @@ pub struct CmdApiCallStatus {
pub format: Option<crate::types::FormatOutput>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdApiCallStatus {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let client = ctx.api_client("")?;
Expand Down
8 changes: 4 additions & 4 deletions src/cmd_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum SubCommand {
Status(CmdAuthStatus),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAuth {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand Down Expand Up @@ -113,7 +113,7 @@ pub struct CmdAuthLogin {
pub web: bool,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAuthLogin {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
if !ctx.io.can_prompt() && !self.with_token {
Expand Down Expand Up @@ -311,7 +311,7 @@ pub struct CmdAuthLogout {
pub host: Option<url::Url>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAuthLogout {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
if self.host.is_none() && !ctx.io.can_prompt() {
Expand Down Expand Up @@ -438,7 +438,7 @@ pub struct CmdAuthStatus {
pub host: Option<url::Url>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdAuthStatus {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let cs = ctx.io.color_scheme();
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub struct CmdCompletion {
pub shell: Shell,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdCompletion {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Convert our opts into a clap app.
Expand Down
8 changes: 4 additions & 4 deletions src/cmd_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum SubCommand {
Get(CmdConfigGet),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdConfig {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand All @@ -48,7 +48,7 @@ pub struct CmdConfigGet {
pub host: String,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdConfigGet {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match ctx.config.get(&self.host, &self.key) {
Expand Down Expand Up @@ -79,7 +79,7 @@ pub struct CmdConfigSet {
pub host: String,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdConfigSet {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let cs = ctx.io.color_scheme();
Expand Down Expand Up @@ -124,7 +124,7 @@ pub struct CmdConfigList {
pub host: String,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdConfigList {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let host = if self.host.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_drake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use clap::Parser;
#[clap(verbatim_doc_comment)]
pub struct CmdDrake {}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdDrake {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
ctx.browser("", "https://dl.kittycad.io/drake.jpeg")
Expand Down
14 changes: 7 additions & 7 deletions src/cmd_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum SubCommand {
SurfaceArea(CmdFileSurfaceArea),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFile {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand Down Expand Up @@ -79,7 +79,7 @@ pub struct CmdFileConvert {
pub format: Option<crate::types::FormatOutput>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFileConvert {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Make sure the output dir is a directory.
Expand Down Expand Up @@ -181,7 +181,7 @@ pub struct CmdFileVolume {
pub output_unit: kittycad::types::UnitVolume,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFileVolume {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Parse the source format.
Expand Down Expand Up @@ -250,7 +250,7 @@ pub struct CmdFileMass {
pub output_unit: kittycad::types::UnitMass,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFileMass {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
if self.material_density == 0.0 {
Expand Down Expand Up @@ -321,7 +321,7 @@ pub struct CmdFileCenterOfMass {
pub output_unit: kittycad::types::UnitLength,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFileCenterOfMass {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Parse the source format.
Expand Down Expand Up @@ -390,7 +390,7 @@ pub struct CmdFileDensity {
pub output_unit: kittycad::types::UnitDensity,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFileDensity {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
if self.material_mass == 0.0 {
Expand Down Expand Up @@ -461,7 +461,7 @@ pub struct CmdFileSurfaceArea {
pub output_unit: kittycad::types::UnitArea,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdFileSurfaceArea {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Parse the source format.
Expand Down
6 changes: 3 additions & 3 deletions src/cmd_generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum SubCommand {
ManPages(CmdGenerateManPages),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdGenerate {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand All @@ -36,7 +36,7 @@ pub struct CmdGenerateMarkdown {
pub dir: String,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdGenerateMarkdown {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let mut app: Command = crate::Opts::command();
Expand Down Expand Up @@ -109,7 +109,7 @@ pub struct CmdGenerateManPages {
pub dir: String,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdGenerateManPages {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
let mut app: Command = crate::Opts::command();
Expand Down
8 changes: 4 additions & 4 deletions src/cmd_kcl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum SubCommand {
View(CmdKclView),
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdKcl {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
match &self.subcmd {
Expand Down Expand Up @@ -60,7 +60,7 @@ pub struct CmdKclExport {
pub format: Option<crate::types::FormatOutput>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdKclExport {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Make sure the output dir is a directory.
Expand Down Expand Up @@ -132,7 +132,7 @@ pub struct CmdKclSnapshot {
pub format: Option<crate::types::FormatOutput>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdKclSnapshot {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Make sure the parent directory is a directory and exists.
Expand Down Expand Up @@ -206,7 +206,7 @@ pub struct CmdKclView {
pub format: Option<crate::types::FormatOutput>,
}

#[async_trait::async_trait]
#[async_trait::async_trait(?Send)]
impl crate::cmd::Command for CmdKclView {
async fn run(&self, ctx: &mut crate::context::Context) -> Result<()> {
// Get the contents of the input file.
Expand Down
Loading

0 comments on commit 906d6a2

Please sign in to comment.