No more empty outputs from modeling API (#3931)
* WIP: No more empty outputs from modeling API Part of https://github.com/KittyCAD/modeling-api/issues/518 * Remove unused import * Keep Empty in the API * Fix TS type error due to upgrade to ts_rs 10.0.0 * Fix warning about unused use * Fix more type errors from ts_rs upgrade * De-flake settings override desktop test * Update export test file sizes --------- Co-authored-by: Jonathan Tran <jonnytran@gmail.com> Co-authored-by: Frank Noirot <frank@kittycad.io>
This commit is contained in:
@ -1766,17 +1766,17 @@ const key = 'c'`
|
||||
const ast = parse(code)
|
||||
if (err(ast)) throw ast
|
||||
const { nonCodeMeta } = ast
|
||||
expect(nonCodeMeta.nonCodeNodes[0][0]).toEqual(nonCodeMetaInstance)
|
||||
expect(nonCodeMeta.nonCodeNodes[0]?.[0]).toEqual(nonCodeMetaInstance)
|
||||
|
||||
// extra whitespace won't change it's position (0) or value (NB the start end would have changed though)
|
||||
const codeWithExtraStartWhitespace = '\n\n\n' + code
|
||||
const ast2 = parse(codeWithExtraStartWhitespace)
|
||||
if (err(ast2)) throw ast2
|
||||
const { nonCodeMeta: nonCodeMeta2 } = ast2
|
||||
expect(nonCodeMeta2.nonCodeNodes[0][0].value).toStrictEqual(
|
||||
expect(nonCodeMeta2.nonCodeNodes[0]?.[0].value).toStrictEqual(
|
||||
nonCodeMetaInstance.value
|
||||
)
|
||||
expect(nonCodeMeta2.nonCodeNodes[0][0].start).not.toBe(
|
||||
expect(nonCodeMeta2.nonCodeNodes[0]?.[0].start).not.toBe(
|
||||
nonCodeMetaInstance.start
|
||||
)
|
||||
})
|
||||
|
||||
6
src/wasm-lib/Cargo.lock
generated
6
src/wasm-lib/Cargo.lock
generated
@ -1527,8 +1527,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "kittycad-modeling-cmds"
|
||||
version = "0.2.59"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee900033a5804ca2354f0760478e851a0ab04d32b38a9117d0bd4f87a8867110"
|
||||
source = "git+https://github.com/KittyCAD/modeling-api?branch=achalmers/no-more-empty#2611f6f93b20b4efc701fd008ee3ccab8c447907"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@ -1552,8 +1551,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "kittycad-modeling-cmds-macros"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0cdc505a33bfffb87c317435ec41ced8f73474217cf30db685e479bf289757e"
|
||||
source = "git+https://github.com/KittyCAD/modeling-api?branch=achalmers/no-more-empty#2611f6f93b20b4efc701fd008ee3ccab8c447907"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
||||
@ -73,7 +73,7 @@ members = [
|
||||
http = "0.2.12"
|
||||
kittycad = { version = "0.3.20", default-features = false, features = ["js", "requests"] }
|
||||
kittycad-modeling-session = "0.1.4"
|
||||
kittycad-modeling-cmds = { version = "0.2.59", features = ["websocket"] }
|
||||
kittycad-modeling-cmds = { git = "https://github.com/KittyCAD/modeling-api", branch="achalmers/no-more-empty", features = ["websocket"] }
|
||||
|
||||
[[test]]
|
||||
name = "executor"
|
||||
|
||||
@ -40,7 +40,8 @@ pub struct StdLibFnData {
|
||||
|
||||
/// This struct defines a single argument to a stdlib function.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, JsonSchema, ts_rs::TS)]
|
||||
#[ts(export)]
|
||||
// There's a bug in ts_rs where this isn't correctly imported by StdLibFnData.
|
||||
#[ts(export_to = "StdLibFnData.ts")]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct StdLibFnArg {
|
||||
/// The name of the argument.
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
//! Functions for setting up our WebSocket and WebRTC connections for communications with the
|
||||
//! engine.
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use anyhow::Result;
|
||||
use indexmap::IndexMap;
|
||||
|
||||
Reference in New Issue
Block a user