diff --git a/Cargo.lock b/Cargo.lock index 100257f..9147353 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,23 +3,27 @@ version = 3 [[package]] -name = "ahash" -version = "0.7.6" +name = "addr2line" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "getrandom", - "once_cell", - "version_check", + "gimli", ] +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" -version = "0.8.3" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "cfg-if", + "getrandom", "once_cell", "version_check", ] @@ -47,19 +51,19 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", ] [[package]] @@ -79,11 +83,26 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" -version = "0.21.2" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "bincode" @@ -100,6 +119,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "bitvec" version = "1.0.1" @@ -120,54 +145,33 @@ checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "borsh" -version = "0.10.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +checksum = "bf617fabf5cdbdc92f774bfe5062d870f228b80056d41180797abf48bed4056e" dependencies = [ "borsh-derive", - "hashbrown 0.13.2", + "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" -dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +checksum = "f404657a7ea7b5249e36808dff544bc88a28f26e0ac40009f674b7a009d14be3" dependencies = [ + "once_cell", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", + "syn_derive", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytecheck" @@ -193,23 +197,23 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cairo-rs" -version = "0.17.0" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8af54f5d48af1226928adc1f57edd22f5df1349e7da1fc96ae15cf43db0e871" +checksum = "f33613627f0dea6a731b0605101fad59ba4f193a52c96c4687728d822605a8a1" dependencies = [ - "bitflags", + "bitflags 2.4.1", "cairo-sys-rs", "libc", "once_cell", @@ -218,19 +222,28 @@ dependencies = [ [[package]] name = "cairo-sys-rs" -version = "0.17.0" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55382a01d30e5e53f185eee269124f5e21ab526595b872751278dfbb463594e" +checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ "libc", "system-deps", ] +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + [[package]] name = "cfg-expr" -version = "0.15.1" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", "target-lexicon", @@ -242,6 +255,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "clap" version = "2.34.0" @@ -250,7 +269,7 @@ checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", - "bitflags", + "bitflags 1.3.2", "strsim 0.8.0", "textwrap", "unicode-width", @@ -297,18 +316,18 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] [[package]] name = "darling" -version = "0.13.4" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ "darling_core", "darling_macro", @@ -316,29 +335,35 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.4" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "darling_macro" -version = "0.13.4" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn 2.0.39", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "env_logger" version = "0.9.3" @@ -351,6 +376,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "euclid" version = "0.22.9" @@ -368,9 +399,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -383,9 +414,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -397,9 +428,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -407,44 +438,44 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -460,9 +491,9 @@ dependencies = [ [[package]] name = "g-code" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426e8db123028351d46f0befecb1fe15e326ab53cd9449c1296083981859519c" +checksum = "6261d157241cc6ec7e015a19f2b8ea37e2018a32980a60d65bda6c7b336349fc" dependencies = [ "codespan", "codespan-reporting", @@ -474,32 +505,59 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + [[package]] name = "gloo" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4bef6b277b3ab073253d4bca60761240cf8d6998f4bd142211957b69a61b20" +checksum = "28999cda5ef6916ffd33fb4a7b87e1de633c47c0dc6d97905fee1cdaa142b94d" dependencies = [ - "gloo-console", - "gloo-dialogs", - "gloo-events", - "gloo-file", - "gloo-history", - "gloo-net", - "gloo-render", - "gloo-storage", - "gloo-timers", - "gloo-utils", - "gloo-worker", + "gloo-console 0.2.3", + "gloo-dialogs 0.1.1", + "gloo-events 0.1.2", + "gloo-file 0.2.3", + "gloo-history 0.1.5", + "gloo-net 0.3.1", + "gloo-render 0.1.1", + "gloo-storage 0.2.2", + "gloo-timers 0.2.6", + "gloo-utils 0.1.7", + "gloo-worker 0.2.1", +] + +[[package]] +name = "gloo" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd35526c28cc55c1db77aed6296de58677dbab863b118483a27845631d870249" +dependencies = [ + "gloo-console 0.3.0", + "gloo-dialogs 0.2.0", + "gloo-events 0.2.0", + "gloo-file 0.3.0", + "gloo-history 0.2.1", + "gloo-net 0.4.0", + "gloo-render 0.2.0", + "gloo-storage 0.3.0", + "gloo-timers 0.3.0", + "gloo-utils 0.2.0", + "gloo-worker 0.4.0", ] [[package]] @@ -508,7 +566,20 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" dependencies = [ - "gloo-utils", + "gloo-utils 0.1.7", + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-console" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a17868f56b4a24f677b17c8cb69958385102fa879418052d60b50bc1727e261" +dependencies = [ + "gloo-utils 0.2.0", "js-sys", "serde", "wasm-bindgen", @@ -525,6 +596,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-dialogs" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4748e10122b01435750ff530095b1217cf6546173459448b83913ebe7815df" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-events" version = "0.1.2" @@ -535,14 +616,36 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-events" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27c26fb45f7c385ba980f5fa87ac677e363949e065a083722697ef1b2cc91e41" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-file" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" +dependencies = [ + "gloo-events 0.1.2", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-file" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97563d71863fb2824b2e974e754a81d19c4a7ec47b09ced8a0e6656b6d54bd1f" dependencies = [ "futures-channel", - "gloo-events", + "gloo-events 0.2.0", "js-sys", "wasm-bindgen", "web-sys", @@ -550,14 +653,31 @@ dependencies = [ [[package]] name = "gloo-history" -version = "0.1.3" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85725d90bf0ed47063b3930ef28e863658a7905989e9929a8708aab74a1d5e7f" +dependencies = [ + "gloo-events 0.1.2", + "gloo-utils 0.1.7", + "serde", + "serde-wasm-bindgen 0.5.0", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-history" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd451019e0b7a2b8a7a7b23e74916601abf1135c54664e57ff71dcc26dfcdeb7" +checksum = "0c4022e82f5f9e03cb1251b13c0a967e0600e97aa179c617f6519bac40640160" dependencies = [ - "gloo-events", - "gloo-utils", + "getrandom", + "gloo-events 0.2.0", + "gloo-utils 0.2.0", "serde", - "serde-wasm-bindgen", + "serde-wasm-bindgen 0.6.1", "serde_urlencoded", "thiserror", "wasm-bindgen", @@ -566,14 +686,36 @@ dependencies = [ [[package]] name = "gloo-net" -version = "0.2.6" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +checksum = "a66b4e3c7d9ed8d315fd6b97c8b1f74a7c6ecbbc2320e65ae7ed38b7068cc620" dependencies = [ "futures-channel", "futures-core", "futures-sink", - "gloo-utils", + "gloo-utils 0.1.7", + "http", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils 0.2.0", + "http", "js-sys", "pin-project", "serde", @@ -594,13 +736,38 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-render" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56008b6744713a8e8d98ac3dcb7d06543d5662358c9c805b4ce2167ad4649833" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-storage" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" dependencies = [ - "gloo-utils", + "gloo-utils 0.1.7", + "js-sys", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-storage" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc8031e8c92758af912f9bc08fbbadd3c6f3cfcbf6b64cdf3d6a81f0139277a" +dependencies = [ + "gloo-utils 0.2.0", "js-sys", "serde", "serde_json", @@ -619,11 +786,34 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "gloo-utils" -version = "0.1.6" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-utils" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8e8fc851e9c7b9852508bc6e3f690f452f474417e8545ec9857b7f7377036b5" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" dependencies = [ "js-sys", "serde", @@ -640,8 +830,8 @@ checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" dependencies = [ "anymap2", "bincode", - "gloo-console", - "gloo-utils", + "gloo-console 0.2.3", + "gloo-utils 0.1.7", "js-sys", "serde", "wasm-bindgen", @@ -649,23 +839,51 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-worker" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76495d3dd87de51da268fa3a593da118ab43eb7f8809e17eb38d3319b424e400" +dependencies = [ + "bincode", + "futures", + "gloo-utils 0.2.0", + "gloo-worker-macros", + "js-sys", + "pinned", + "serde", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-worker-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956caa58d4857bc9941749d55e4bd3000032d8212762586fa5705632967140e7" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash", ] [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" @@ -693,11 +911,19 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" + +[[package]] +name = "http" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ - "libc", + "bytes", + "fnv", + "itoa", ] [[package]] @@ -714,34 +940,45 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "implicit-clone" -version = "0.3.5" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fc102e70475c320b185cd18c1e48bba2d7210b63970a4d581ef903e4368ef7" +checksum = "fc06a255cbf402a52ae399c05a518c68c569c916ea11423620111df576b9b9bb" dependencies = [ + "implicit-clone-derive", "indexmap", ] +[[package]] +name = "implicit-clone-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9311685eb9a34808bbb0608ad2fcab9ae216266beca5848613e95553ac914e3b" +dependencies = [ + "quote", + "syn 2.0.39", +] + [[package]] name = "indexmap" -version = "1.9.3" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "equivalent", + "hashbrown 0.14.2", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -763,21 +1000,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "log" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lyon_geom" @@ -792,15 +1029,24 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -808,31 +1054,40 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi 0.3.3", "libc", ] +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "paste" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "peg" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07f2cafdc3babeebc087e499118343442b742cc7c31b4d054682cc598508554" +checksum = "400bcab7d219c38abf8bd7cc2054eb9bbbd4312d66f6a5557d572a203f646f61" dependencies = [ "peg-macros", "peg-runtime", @@ -840,9 +1095,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a90084dc05cf0428428e3d12399f39faad19b0909f64fb9170c9fdd6d9cd49b" +checksum = "46e61cce859b76d19090f62da50a9fe92bab7c2a5f09e183763559a2ac392c90" dependencies = [ "peg-runtime", "proc-macro2", @@ -851,41 +1106,41 @@ dependencies = [ [[package]] name = "peg-runtime" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa00462b37ead6d11a82c9d568b26682d78e0477dc02d1966c013af80969739" +checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -916,23 +1171,43 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml 0.5.11", + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", ] [[package]] @@ -961,9 +1236,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -975,7 +1250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" dependencies = [ "futures", - "gloo", + "gloo 0.8.1", "num_cpus", "once_cell", "pin-project", @@ -1007,9 +1282,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -1052,9 +1327,9 @@ dependencies = [ [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] @@ -1089,23 +1364,18 @@ dependencies = [ [[package]] name = "roxmltree" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f595a457b6b8c6cda66a48503e92ee8d19342f905948f29c383200ec9eb1d8" -dependencies = [ - "xmlparser", -] +checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" [[package]] name = "rust_decimal" -version = "1.29.1" +version = "1.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26bd36b60561ee1fb5ec2817f198b6fd09fa571c897a5e86d1487cfc2b096dfc" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" dependencies = [ "arrayvec", "borsh", - "bytecheck", - "byteorder", "bytes", "num-traits", "rand", @@ -1114,17 +1384,23 @@ dependencies = [ "serde_json", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "seahash" @@ -1134,18 +1410,29 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] [[package]] name = "serde-wasm-bindgen" -version = "0.4.5" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde-wasm-bindgen" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +checksum = "17ba92964781421b6cef36bf0d7da26d201e96d84e1b10e7ae6ed416e516906d" dependencies = [ "js-sys", "serde", @@ -1154,20 +1441,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1176,9 +1463,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -1203,24 +1490,24 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "strsim" @@ -1260,7 +1547,7 @@ dependencies = [ [[package]] name = "svg2gcode" -version = "0.1.3" +version = "0.1.4" dependencies = [ "cairo-rs", "euclid", @@ -1268,6 +1555,7 @@ dependencies = [ "log", "lyon_geom", "paste", + "pretty_assertions", "roxmltree", "serde", "serde_json", @@ -1277,7 +1565,7 @@ dependencies = [ [[package]] name = "svg2gcode-cli" -version = "0.0.4" +version = "0.0.5" dependencies = [ "codespan-reporting", "env_logger", @@ -1292,14 +1580,14 @@ dependencies = [ [[package]] name = "svg2gcode-web" -version = "0.0.3" +version = "0.0.4" dependencies = [ "base64", "codespan", "codespan-reporting", "g-code", - "gloo-file", - "gloo-timers", + "gloo-file 0.3.0", + "gloo-timers 0.3.0", "js-sys", "log", "paste", @@ -1320,9 +1608,9 @@ dependencies = [ [[package]] name = "svgtypes" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4b0611e7f3277f68c0fa18e385d9e2d26923691379690039548f867cef02a7" +checksum = "d71499ff2d42f59d26edb21369a308ede691421f79ebc0f001e2b1fd3a7c9e52" dependencies = [ "kurbo", "siphasher", @@ -1341,25 +1629,37 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "system-deps" -version = "6.1.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5fa6fb9ee296c0dc2df41a656ca7948546d061958115ddb0bcaae43ad0d17d2" +checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" dependencies = [ "cfg-expr", "heck 0.4.1", "pkg-config", - "toml 0.7.4", + "toml", "version-compare", ] @@ -1371,15 +1671,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -1395,22 +1695,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", ] [[package]] @@ -1430,13 +1730,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.2" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ - "autocfg", + "backtrace", "pin-project-lite", - "windows-sys", ] [[package]] @@ -1452,39 +1751,52 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.21.0", ] [[package]] -name = "toml" -version = "0.7.4" +name = "toml_datetime" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", - "serde_spanned", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap", "toml_datetime", - "toml_edit", + "winnow", ] [[package]] -name = "toml_datetime" -version = "0.6.2" +name = "toml_edit" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "serde", + "indexmap", + "toml_datetime", + "winnow", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap", "serde", @@ -1495,11 +1807,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1507,35 +1818,35 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-segmentation" @@ -1545,15 +1856,15 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "uom" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f50eddd69f656ee545f7663ea5fefb7c789bc1a0d11124e049715f563a16a4" +checksum = "8362194c7a9845a7a7f3562173d6e1da3f24f7132018cb78fe77a5b4474187b2" dependencies = [ "num-traits", "typenum", @@ -1561,9 +1872,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.3.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" [[package]] name = "vec_map" @@ -1591,9 +1902,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1601,24 +1912,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -1628,9 +1939,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1638,22 +1949,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-logger" @@ -1668,9 +1979,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -1694,9 +2005,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1707,77 +2018,11 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - [[package]] name = "winnow" -version = "0.4.6" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] @@ -1792,20 +2037,20 @@ dependencies = [ ] [[package]] -name = "xmlparser" -version = "0.13.5" +name = "yansi" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yew" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dbecfe44343b70cc2932c3eb445425969ae21754a8ab3a0966981c1cf7af1cc" +checksum = "5f1a03f255c70c7aa3e9c62e15292f142ede0564123543c1cc0c7a4f31660cac" dependencies = [ "console_error_panic_hook", "futures", - "gloo", + "gloo 0.10.0", "implicit-clone", "indexmap", "js-sys", @@ -1824,9 +2069,9 @@ dependencies = [ [[package]] name = "yew-macro" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64c253c1d401f1ea868ca9988db63958cfa15a69f739101f338d6f05eea8301" +checksum = "02fd8ca5166d69e59f796500a2ce432ff751edecbbb308ca59fd3fe4d0343de2" dependencies = [ "boolinator", "once_cell", @@ -1834,14 +2079,14 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] name = "yewdux" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c528544a814a0beb30059c8340eb78c88160141db788112b51a5a08098cef2d" +checksum = "2ebc94bf7668ffd7470f27a9b323ef73d4dc3fdbe920477645f3adc104bc53f2" dependencies = [ "anymap", "async-trait", @@ -1858,15 +2103,15 @@ dependencies = [ [[package]] name = "yewdux-macros" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc318072e34a9083d651ecd126153e9f1c39ae705794ef953a30b561b5eaab6d" +checksum = "d22b1832d3e3eaa61a5c2ecd40affa876507457180d1e599143368c1c3317c2d" dependencies = [ "darling", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.39", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0c5766e..c60056a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,5 @@ members = [ ] default-members = [ "cli" -] \ No newline at end of file +] +resolver = "2" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c40a53c..3c9f198 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "svg2gcode-cli" -version = "0.0.4" +version = "0.0.5" authors = ["Sameer Puri "] edition = "2021" description = "Command line interface for svg2gcode" @@ -14,8 +14,8 @@ log = "0" g-code = "0.3" codespan-reporting = "0.11" structopt = "0.3" -roxmltree = "0.18" -svgtypes = "0.11" +roxmltree = "0.19" +svgtypes = "0.12" serde_json = "1" [[bin]] diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 481263b..dabeee5 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "svg2gcode" -version = "0.1.3" +version = "0.1.4" authors = ["Sameer Puri "] edition = "2021" description = "Convert paths in SVG files to GCode for a pen plotter, laser engraver, or other machine." @@ -8,13 +8,13 @@ repository = "https://github.com/sameer/svg2gcode" license = "MIT" [dependencies] -g-code = { version = "0.3.5", features = ["serde"] } +g-code = { version = "0.3.6", features = ["serde"] } lyon_geom = "1.0.4" euclid = "0.22" log = "0.4" -uom = "0.34.0" -roxmltree = "0.18" -svgtypes = "0.11" +uom = "0.35" +roxmltree = "0.19" +svgtypes = "0.12" paste = "1.0" [dependencies.serde] @@ -24,5 +24,6 @@ version = "1" features = ["derive"] [dev-dependencies] -cairo-rs = { version = "0.17", default-features = false, features = ["svg", "v1_16"] } +cairo-rs = { version = "0.18", default-features = false, features = ["svg", "v1_16"] } serde_json = "1" +pretty_assertions = "1.4.0" diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 3ac253f..996cb03 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -30,14 +30,19 @@ pub struct Settings { #[cfg(test)] mod test { use super::*; - use g_code::emit::{format_gcode_fmt, FormatOptions}; + use g_code::emit::Token; + use pretty_assertions::assert_eq; use svgtypes::{Length, LengthUnit}; + /// The values change between debug and release builds for circular interpolation, + /// so only check within a rough tolerance + const TOLERANCE: f64 = 1E-10; + fn get_actual( input: &str, circular_interpolation: bool, dimensions: [Option; 2], - ) -> String { + ) -> Vec> { let config = ConversionConfig::default(); let options = ConversionOptions { dimensions }; let document = roxmltree::Document::parse(input).unwrap(); @@ -51,19 +56,41 @@ mod test { None, None, ); - let program = converter::svg2program(&document, &config, options, machine); + converter::svg2program(&document, &config, options, machine) + } - let mut acc = String::new(); - format_gcode_fmt(&program, FormatOptions::default(), &mut acc).unwrap(); - acc + fn assert_close(left: Vec>, right: Vec>) { + assert_eq!(left.len(), right.len()); + for (i, pair) in left.into_iter().zip(right.into_iter()).enumerate() { + match pair { + (Token::Field(l), Token::Field(r)) => { + assert_eq!(l.letters, r.letters); + if let (Some(l_value), Some(r_value)) = (l.value.as_f64(), r.value.as_f64()) { + assert!( + (l_value - r_value).abs() < TOLERANCE, + "Values differ significantly at {i}: {l} vs {r} ({})", + (l_value - r_value).abs() + ); + } else { + assert_eq!(l, r); + } + } + (l, r) => { + assert_eq!(l, r, "Differs at {i}"); + } + } + } } #[test] fn square_produces_expected_gcode() { - let square = include_str!("../tests/square.svg"); - let actual = get_actual(square, false, [None; 2]); + let expected = g_code::parse::file_parser(include_str!("../tests/square.gcode")) + .unwrap() + .iter_emit_tokens() + .collect::>(); + let actual = get_actual(include_str!("../tests/square.svg"), false, [None; 2]); - assert_eq!(actual, include_str!("../tests/square.gcode")) + assert_close(actual, expected); } #[test] @@ -73,21 +100,26 @@ mod test { unit: LengthUnit::Mm, }; + let expected = g_code::parse::file_parser(include_str!("../tests/square.gcode")) + .unwrap() + .iter_emit_tokens() + .collect::>(); + for square in [ include_str!("../tests/square.svg"), include_str!("../tests/square_dimensionless.svg"), ] { - assert_eq!( + assert_close( get_actual(square, false, [Some(side_length); 2]), - include_str!("../tests/square.gcode") + expected.clone(), ); - assert_eq!( + assert_close( get_actual(square, false, [Some(side_length), None]), - include_str!("../tests/square.gcode") + expected.clone(), ); - assert_eq!( + assert_close( get_actual(square, false, [None, Some(side_length)]), - include_str!("../tests/square.gcode") + expected.clone(), ); } } @@ -95,41 +127,61 @@ mod test { #[test] fn square_transformed_produces_expected_gcode() { let square_transformed = include_str!("../tests/square_transformed.svg"); + let expected = + g_code::parse::file_parser(include_str!("../tests/square_transformed.gcode")) + .unwrap() + .iter_emit_tokens() + .collect::>(); let actual = get_actual(square_transformed, false, [None; 2]); - assert_eq!(actual, include_str!("../tests/square_transformed.gcode")) + assert_close(actual, expected) } #[test] fn square_viewport_produces_expected_gcode() { - let square_transformed = include_str!("../tests/square_viewport.svg"); - let actual = get_actual(square_transformed, false, [None; 2]); + let square_viewport = include_str!("../tests/square_viewport.svg"); + let expected = g_code::parse::file_parser(include_str!("../tests/square_viewport.gcode")) + .unwrap() + .iter_emit_tokens() + .collect::>(); + let actual = get_actual(square_viewport, false, [None; 2]); - assert_eq!(actual, include_str!("../tests/square_viewport.gcode")) + assert_close(actual, expected); } #[test] fn circular_interpolation_produces_expected_gcode() { let circular_interpolation = include_str!("../tests/circular_interpolation.svg"); + let expected = + g_code::parse::file_parser(include_str!("../tests/circular_interpolation.gcode")) + .unwrap() + .iter_emit_tokens() + .collect::>(); let actual = get_actual(circular_interpolation, true, [None; 2]); - assert_eq!( - actual, - include_str!("../tests/circular_interpolation.gcode") - ) + assert_close(actual, expected) } #[test] fn svg_with_smooth_curves_produces_expected_gcode() { let svg = include_str!("../tests/smooth_curves.svg"); - assert_eq!( - get_actual(svg, false, [None; 2]), - include_str!("../tests/smooth_curves.gcode") - ); - assert_eq!( + let expected = g_code::parse::file_parser(include_str!("../tests/smooth_curves.gcode")) + .unwrap() + .iter_emit_tokens() + .collect::>(); + + let expected_circular_interpolation = g_code::parse::file_parser(include_str!( + "../tests/smooth_curves_circular_interpolation.gcode" + )) + .unwrap() + .iter_emit_tokens() + .collect::>(); + assert_close(get_actual(svg, false, [None; 2]), expected); + + assert_close( get_actual(svg, true, [None; 2]), - include_str!("../tests/smooth_curves_circular_interpolation.gcode") + expected_circular_interpolation, ); } diff --git a/lib/tests/circular_interpolation.gcode b/lib/tests/circular_interpolation.gcode index 5a3488f..0f43edd 100644 --- a/lib/tests/circular_interpolation.gcode +++ b/lib/tests/circular_interpolation.gcode @@ -58,18 +58,18 @@ G3 X2.6441213528766796 Y3.932607474577383 R16.909229019806858 F300 G3 X3.0621524614580276 Y3.9412866185390385 R16.902307637846288 F300 G3 X3.474762735928376 Y3.9601731711554446 R16.28877876962794 F300 G3 X3.8778904316608083 Y3.9890778449897057 R15.268674575836199 F300 -G3 X4.267739066726786 Y4.0277250178448885 R13.912776714019424 F300 -G3 X4.456063577509985 Y4.050532552971807 R12.739268728330957 F300 -G3 X4.63949362667036 Y4.075589152050236 R11.886079594871317 F300 -G3 X4.9912723595593835 Y4.132404125106506 R10.514058134441601 F300 +G3 X4.267739066726786 Y4.0277250178448885 R13.912776714021234 F300 +G3 X4.456063577509987 Y4.0505325529718075 R12.739268728338441 F300 +G3 X4.639493626670362 Y4.075589152050236 R11.886079594917863 F300 +G3 X4.991272359559384 Y4.132404125106506 R10.514058134447188 F300 G3 X5.158404895076147 Y4.163979552996096 R9.124219221791998 F300 G3 X5.319615850363981 Y4.197668785821917 R8.191555678247077 F300 G3 X5.473047754155922 Y4.233066714906146 R7.337969988742633 F300 G3 X5.61937862477731 Y4.270296440546117 R6.491816535421121 F300 -G3 X5.7594343548684455 Y4.309615721254547 R5.617604058887768 F300 -G3 X5.8915689090734364 Y4.350612794689171 R4.822901450495766 F300 -G3 X6.015159340298373 Y4.3930787556347495 R4.103817344924035 F300 -G3 X6.130250150760052 Y4.437012246178796 R3.44384482377765 F300 +G3 X5.759434354868446 Y4.309615721254546 R5.61760405887186 F300 +G3 X5.891568909073437 Y4.35061279468917 R4.822901450506084 F300 +G3 X6.015159340298373 Y4.393078755634749 R4.103817344908349 F300 +G3 X6.130250150760052 Y4.437012246178796 R3.443844823789513 F300 G3 X6.236127588090238 Y4.48211064322029 R2.846139959892035 F300 G3 X6.333048170507615 Y4.528450609158775 R2.3152352933048315 F300 G3 X6.4208476002165105 Y4.575960377763483 R1.852483263205878 F300 @@ -87,21 +87,21 @@ G3 X6.606369810412423 Y5.294504520034969 R0.7277547047047377 F300 G3 X6.543572649892903 Y5.344557674458401 R0.9564889710367651 F300 G3 X6.471071971365293 Y5.393746987681996 R1.2449378228703627 F300 G3 X6.389003780317571 Y5.441987645437967 R1.597798863130081 F300 -G3 X6.297869780912585 Y5.489015899982382 R2.0177297473684925 F300 -G3 X6.197643386983442 Y5.534873412599875 R2.505678774355954 F300 -G3 X6.088496927021365 Y5.579476569875775 R3.0612941796334256 F300 -G3 X5.970749082451981 Y5.622690761009283 R3.6808379091910886 F300 -G3 X5.844081790059699 Y5.664601230818244 R4.360700929904796 F300 -G3 X5.709324860866246 Y5.70490397007849 R5.102368612887797 F300 -G3 X5.567733146370779 Y5.743261946530389 R5.934854156765002 F300 -G3 X5.418814245543702 Y5.779844664709513 R6.798940676792501 F300 +G3 X6.297869780912585 Y5.489015899982382 R2.017729747366577 F300 +G3 X6.197643386983442 Y5.534873412599876 R2.505678774354557 F300 +G3 X6.088496927021366 Y5.579476569875775 R3.0612941796032196 F300 +G3 X5.970749082451981 Y5.622690761009283 R3.6808379092462253 F300 +G3 X5.844081790059697 Y5.664601230818246 R4.360700929949317 F300 +G3 X5.709324860866245 Y5.704903970078492 R5.102368612903584 F300 +G3 X5.567733146370777 Y5.743261946530389 R5.934854156869633 F300 +G3 X5.418814245543699 Y5.779844664709512 R6.79894067679271 F300 G3 X5.261537124667706 Y5.814858597710807 R7.631496009070628 F300 -G3 X5.097548832796083 Y5.847892236765922 R8.528687532226238 F300 -G3 X4.9276849905723505 Y5.878789845134821 R9.47189940399368 F300 -G3 X4.751951029840501 Y5.9075625483307235 R10.4133131491631 F300 +G3 X5.097548832796083 Y5.847892236765922 R8.528687532338546 F300 +G3 X4.9276849905723505 Y5.878789845134821 R9.471899404064297 F300 +G3 X4.751951029840502 Y5.9075625483307235 R10.413313149409666 F300 G3 X4.386110365917731 Y5.958272783471742 R11.758269645230168 F300 -G3 X4.196158507416505 Y5.980211912487405 R13.046962723496428 F300 -G3 X4.002046461235404 Y5.999807994943473 R13.831352786873643 F300;svg#svg8 > g#layer1 > path +G3 X4.196158507416504 Y5.980211912487406 R13.046962723669846 F300 +G3 X4.002046461235402 Y5.999807994943473 R13.831352786802256 F300;svg#svg8 > g#layer1 > path G0 X1 Y2 G3 X2.7071067811865475 Y1.2928932188134523 R1 F300 G3 X2.0000000000000004 Y3 R1 F300;svg#svg8 > g#layer1 > path @@ -113,7 +113,7 @@ G3 X7.446435873469992 Y2.5098930035038536 R0.7704193428710345 F300 G3 X7.479017753360532 Y2.809177694882109 R0.6803427665568468 F300 G3 X7.444418384862246 Y2.9583778658834623 R0.7026557460446882 F300 G3 X7.3766799299740935 Y3.1027417096732983 R0.7922831187696943 F300 -G3 X7.277389351167718 Y3.2389398933696354 R0.9367339275418858 F300 +G3 X7.277389351167718 Y3.2389398933696354 R0.9367339275420696 F300 G3 X7.148774650157433 Y3.3639502152420433 R1.125271732619803 F300 G3 X6.993673148291746 Y3.474987144669766 R1.3540462899654855 F300 G3 X6.815657407470125 Y3.5694700860997925 R1.5910816869891395 F300 @@ -134,12 +134,12 @@ G3 X4.604045213168647 Y2.3665275739817453 R0.8110589553538909 F300 G3 X4.707904549977265 Y2.231952183082983 R0.9631939268966888 F300 G3 X4.840756715708391 Y2.108903718054256 R1.15692448047627 F300 G3 X4.999519011965418 Y2.0002834466817996 R1.3906772528175693 F300 -G3 X5.221523434813825 Y1.8914584411737705 R1.6541860008828217 F300 -G3 X5.468658098289327 Y1.8111179864415283 R1.929021932467884 F300 +G3 X5.221523434813825 Y1.891458441173771 R1.6541860008829492 F300 +G3 X5.4686580982893265 Y1.8111179864415285 R1.9290219324681932 F300 G3 X5.732969365528165 Y1.7618093869229279 R2.132487933789956 F300 G3 X6.005616291542055 Y1.7451939792884783 R2.236659915629062 F300 G3 X6.277559043718761 Y1.761826851152393 R2.218645912284593 F300 G3 X6.539734110392067 Y1.811157851163688 R2.082787785187509 F300 G3 X6.7834314749579985 Y1.891549416416874 R1.8563026877496185 F300 -G3 X7.00054219152339 Y2.000327963727709 R1.5688254782733724 F300 +G3 X7.00054219152339 Y2.000327963727709 R1.5688254782732725 F300 M2 diff --git a/lib/tests/smooth_curves.gcode b/lib/tests/smooth_curves.gcode index 3741445..d302270 100644 --- a/lib/tests/smooth_curves.gcode +++ b/lib/tests/smooth_curves.gcode @@ -26,7 +26,7 @@ G1 X92.36494906990468 Y122.96200450847856 F300 G1 X92.79151193725777 Y123.20022314795844 F300 G1 X93.21004638830136 Y123.45228050906853 F300 G1 X93.62010362260743 Y123.71790630712549 F300 -G1 X94.02124392998769 Y123.99681570781864 F300 +G1 X94.02124392998768 Y123.99681570781864 F300 G1 X94.30871311269678 Y124.20902588753631 F300 G1 X94.49237213450863 Y124.20807148290805 F300 G1 X94.67421399354645 Y124.22212631487666 F300 @@ -154,7 +154,7 @@ G1 X142.70730518361685 Y142.1288663426227 F300 G1 X142.97972795897633 Y141.4736642123873 F300 G1 X143.2668539301122 Y140.82477078762568 F300 G1 X143.5685371208708 Y140.18251596871553 F300 -G1 X143.8846241541415 Y139.54722628093702 F300 +G1 X143.8846241541415 Y139.54722628093705 F300 G1 X144.2149543298345 Y138.91922470846592 F300 G1 X144.55935970658138 Y138.2988305301668 F300 G1 X144.91766518711725 Y137.68635915727046 F300 @@ -514,7 +514,7 @@ G1 X210.72585456977112 Y238.19188187914796 F300 G1 X210.10593022639196 Y238.6948309903779 F300 G1 X209.47605060071223 Y239.18525494692432 F300 G1 X208.8364687135952 Y239.6629567468716 F300 -G1 X208.18744148327508 Y240.12774449875852 F300 +G1 X208.18744148327508 Y240.12774449875855 F300 G1 X207.52922962215376 Y240.5794314986603 F300 G1 X206.86209753207328 Y241.0178363051873 F300 G1 X206.18631319810646 Y241.44278281236922 F300 @@ -741,7 +741,7 @@ G1 X164.9900208417367 Y224.83027105839398 F300 G1 X165.64207235597502 Y224.36641921509042 F300 G1 X166.2990119051494 Y223.9130949344476 F300 G1 X166.9599999999993 Y223.47000000000028 F300 -G1 X166.3559208579686 Y223.08154495889318 F300 +G1 X166.35592085796858 Y223.08154495889318 F300 G1 X165.75715299510688 Y222.67753871339133 F300 G1 X165.16748029567 Y222.26036955400951 F300 G1 X164.58719207195082 Y221.83024215728463 F300 @@ -754,7 +754,7 @@ G1 X161.3181406606669 Y218.98960445033222 F300 G1 X160.81124044630158 Y218.47502095596332 F300 G1 X160.31586201830143 Y217.9493364373853 F300 G1 X159.8322484251728 Y217.41280881224222 F300 -G1 X159.36063694321763 Y216.86570131815304 F300 +G1 X159.36063694321763 Y216.86570131815301 F300 G1 X158.9012589601181 Y216.30828238355903 F300 G1 X158.4983525486541 Y215.79786981016946 F300 G1 X158.0968582448699 Y215.270111570061 F300 @@ -1412,7 +1412,7 @@ G1 X147.81181828559653 Y142.01119444745498 F300 G1 X147.531494322548 Y142.59808666561838 F300 G1 X147.2656911637331 Y143.19169653814748 F300 G1 X147.01456965218097 Y143.79166485934098 F300 -G1 X146.77828174675017 Y144.39762857586794 F300 +G1 X146.77828174675017 Y144.3976285758679 F300 G1 X146.55697043017517 Y145.00922100645863 F300 G1 X146.35076962254448 Y145.6260720637913 F300 G1 X146.1598041002628 Y146.24780847843957 F300 @@ -1667,7 +1667,7 @@ G1 X179.20737518234546 Y167.0039819548432 F300 G1 X179.69974021404605 Y166.55059395813615 F300 G1 X180.18112749662217 Y166.0855667716475 F300 G1 X180.65126196145084 Y165.60916611570775 F300 -G1 X181.10987496986104 Y165.1216642095407 F300 +G1 X181.10987496986104 Y165.12166420954074 F300 G1 X181.556704466636 Y164.6233396157152 F300 G1 X181.99149512975367 Y164.114477080972 F300 G1 X182.4139985162798 Y163.59536737351752 F300 @@ -1775,7 +1775,7 @@ G1 X210.92486013343918 Y223.67090731854773 F300 G1 X210.69310967471415 Y223.40490783568973 F300 G1 X210.47365649247786 Y223.1286755044785 F300 G1 X210.26695184631882 Y222.8427783389517 F300 -G1 X210.07342078112637 Y222.54780422685798 F300 +G1 X210.07342078112634 Y222.54780422685798 F300 G1 X209.89346125307472 Y222.24435972078902 F300 G1 X209.72744331130943 Y221.93306879093075 F300 G1 X209.57570833701854 Y221.61457154199923 F300 @@ -1987,7 +1987,7 @@ G1 X206.35043416438458 Y235.62673279195735 F300 G1 X206.94621340685808 Y235.17093558459584 F300 G1 X207.53213605156438 Y234.70253548380458 F300 G1 X208.10793555042954 Y234.2217455742729 F300 -G1 X208.67334996060367 Y233.72878457706483 F300 +G1 X208.67334996060367 Y233.72878457706486 F300 G1 X209.074969332517 Y233.36543499821346 F300 G1 X209.50495649525632 Y232.9591452304776 F300 G1 X209.947028669483 Y232.5318978614812 F300 @@ -2463,7 +2463,7 @@ G1 X178.9586027398616 Y221.02758962455115 F300 G1 X179.1523041208184 Y220.37540577392667 F300 G1 X179.36128815785457 Y219.727957187347 F300 G1 X179.58543927444015 Y219.08560192977262 F300 -G1 X179.82463350604363 Y218.4486952493495 F300 +G1 X179.82463350604363 Y218.44869524934953 F300 G1 X180.0787385686893 Y217.81758938094248 F300 G1 X180.34761393211556 Y217.1926333513353 F300 G1 X180.38069883056613 Y217.11843860639007 F300 @@ -3149,7 +3149,7 @@ G1 X105.99785594262781 Y168.34070034133728 F300 G1 X106.31026921797542 Y168.03953270465192 F300 G1 X106.63357182296028 Y167.7500859468361 F300 G1 X106.96732430115195 Y167.47275350498876 F300 -G1 X107.31107299189185 Y167.20791234954896 F300 +G1 X107.31107299189183 Y167.20791234954896 F300 G1 X107.66435064694171 Y166.95592247189006 F300 G1 X108.02667706560155 Y166.71712639499344 F300 G1 X108.39755974743326 Y166.4918487078662 F300 @@ -3439,7 +3439,7 @@ G1 X92.29999999999988 Y82.38875000000019 F300 G1 X92.22999999999988 Y81.70000000000019 F300 G1 X91.67886325614897 Y81.50732875647871 F300 G1 X91.12092566961401 Y81.32920057361227 F300 -G1 X90.5583307352993 Y81.16637876953438 F300 +G1 X90.5583307352993 Y81.16637876953436 F300 G1 X89.99149828058832 Y81.01898484738662 F300 G1 X89.831033069085 Y80.98024517264065 F300 G1 X89.05893551828183 Y80.78920342793909 F300 @@ -3979,7 +3979,7 @@ G1 X114.61254281221811 Y88.39351724555324 F300 G1 X114.9824372617488 Y89.2534486941052 F300 G1 X115.36697481665115 Y90.10693265345769 F300 G1 X115.76604314374018 Y90.95371979927218 F300 -G1 X116.17952566502328 Y91.79356276351945 F300 +G1 X116.17952566502328 Y91.79356276351946 F300 G1 X116.60730159175574 Y92.62621620674207 F300 G1 X117.04924595972608 Y93.45143688972425 F300 G1 X117.50522966576138 Y94.26898374454824 F300 @@ -4333,7 +4333,7 @@ G1 X180.53077480805126 Y92.58679631427307 F300 G1 X180.45944418327193 Y92.92076628593006 F300 G1 X180.3725511792845 Y93.25102922035961 F300 G1 X180.27028648159688 Y93.57686036007286 F300 -G1 X180.15287450868829 Y93.89754467309376 F300 +G1 X180.1528745086883 Y93.89754467309376 F300 G1 X180.02057291952613 Y94.21237842208701 F300 G1 X179.8736720481368 Y94.52067070869995 F300 G1 X179.71249426647177 Y94.8217449897296 F300 @@ -4657,7 +4657,7 @@ G1 X193.4399684132682 Y104.71069319074918 F300 G1 X193.31013761533063 Y104.91011225680579 F300 G1 X193.1672028074377 Y105.10035852008735 F300 G1 X193.01180984012422 Y105.28057235337853 F300 -G1 X192.84466085608392 Y105.44993946097118 F300 +G1 X192.84466085608392 Y105.44993946097117 F300 G1 X192.66651111753976 Y105.60769455805723 F300 G1 X192.47816559359342 Y105.7531248286661 F300 G1 X192.28047532297484 Y105.88557314652158 F300 @@ -4813,7 +4813,7 @@ G1 X198.9969304232966 Y86.1704416983403 F300 G1 X199.31502994704962 Y86.34593156411086 F300 G1 X199.6250950705287 Y86.53525567562859 F300 G1 X199.92652452820204 Y86.73804690336499 F300 -G1 X200.21873380046569 Y86.9539120029138 F300 +G1 X200.21873380046569 Y86.95391200291378 F300 G1 X200.50115624712004 Y87.18243237755433 F300 G1 X200.77324420617495 Y87.42316488997716 F300 G1 X201.03447005585357 Y87.67564272159755 F300 @@ -5172,7 +5172,7 @@ G1 X52.711749658041725 Y15.36110453864815 F300 G1 X52.49450398252 Y15.170977432566186 F300 G1 X52.26706065283161 Y14.99317548718805 F300 G1 X52.03011801730526 Y14.828244630554671 F300 -G1 X51.78440359120266 Y14.676691270957912 F300 +G1 X51.78440359120266 Y14.676691270957914 F300 G1 X51.71975635094717 Y14.63986348616218 F300 G1 X51.51319770924947 Y14.548485816268336 F300 G1 X51.300360127067314 Y14.471777514169716 F300 @@ -5522,7 +5522,7 @@ G1 X72.85166402208871 Y47.17170456722451 F300 G1 X72.84999999999998 Y46.940000000000026 F300;svg#Drawing > g#Layer_3 > path G0 X103.46999999999998 Y26.410000000000053 G1 X103.77885836962476 Y26.750663072326184 F300 -G1 X104.07726899553943 Y27.10355838023105 F300 +G1 X104.07726899553941 Y27.10355838023105 F300 G1 X104.36328608096454 Y27.466571089161423 F300 G1 X104.63656685956495 Y27.839266160295466 F300 G1 X104.89678382834961 Y28.221196951351352 F300 @@ -5833,12 +5833,12 @@ G1 X92.40142008469502 Y21.909402755322017 F300 G1 X92.5100603226375 Y21.789938025450958 F300 G1 X93.46280816958733 Y20.81324812693225 F300 G1 X94.39844205909677 Y19.831121238596012 F300 -G1 X95.32242657666562 Y18.83802677617831 F300 -G1 X96.23463316904403 Y17.834102908142015 F300 -G1 X97.13493492163586 Y16.819489309636808 F300 +G1 X95.3224265766656 Y18.83802677617831 F300 +G1 X96.23463316904403 Y17.83410290814203 F300 +G1 X97.13493492163585 Y16.819489309636808 F300 G1 X98.023206576156 Y15.79432714306624 F300 G1 X98.89932454805763 Y14.75875903844802 F300 -G1 X99.76316694372636 Y13.712929073569924 F300 +G1 X99.76316694372638 Y13.712929073569924 F300 G1 X100.6146135774392 Y12.65698275394439 F300 G1 X101.4535459880859 Y11.591066992564478 F300 G1 X101.71600858403087 Y11.25221334299826 F300 @@ -5903,7 +5903,7 @@ G1 X101.96660721515907 Y25.03710588445343 F300 G1 X102.31447536877522 Y25.316125144899324 F300 G1 X102.6521110988666 Y25.607443036155153 F300 G1 X102.97907983286089 Y25.91068460156177 F300 -G1 X103.29496072772776 Y26.225459537441655 F300 +G1 X103.29496072772776 Y26.225459537441658 F300 G1 X103.46842170971475 Y26.40830188704308 F300;svg#Drawing > g#Layer_3 > path G0 X133.86999999999998 Y43.75000000000003 G1 X134.04090930681926 Y43.7438252157433 F300 @@ -6206,7 +6206,7 @@ G1 X143.93999999999988 Y19.400000000000148 F300 G1 X137.05999999999986 Y19.400000000000205 F300 G1 X137.20265440293454 Y20.61014724767846 F300 G1 X137.36111233175944 Y21.817655046737823 F300 -G1 X137.53542006184253 Y23.022976918782774 F300 +G1 X137.53542006184253 Y23.022976918782778 F300 G1 X137.7255475080317 Y24.225904827762466 F300 G1 X137.9314618547248 Y25.42623115081909 F300 G1 X138.15312756153338 Y26.62374871412316 F300 @@ -6226,13 +6226,13 @@ G1 X140.36987117720477 Y36.45517185357611 F300 G1 X140.3460534029641 Y36.69135057801278 F300 G1 X140.30638400180783 Y36.925389068133995 F300 G1 X140.25104309832255 Y37.15622463871996 F300 -G1 X140.1802819757915 Y37.38280914786491 F300 +G1 X140.1802819757915 Y37.382809147864904 F300 G1 X140.09442193520664 Y37.604113756215206 F300 G1 X139.99385283635579 Y37.81913359856154 F300 G1 X139.87903132760846 Y38.026892346573035 F300 G1 X139.7504787724387 Y38.226446641955604 F300 G1 X139.60877888209953 Y38.41689037990513 F300 -G1 X139.45457506519887 Y38.597358823405855 F300 +G1 X139.45457506519887 Y38.59735882340585 F300 G1 X139.28856750621043 Y38.76703252969242 F300 G1 X139.11150998618635 Y38.92514107104688 F300 G1 X138.92420646010635 Y39.070966533035886 F300 @@ -6240,7 +6240,7 @@ G1 X138.72750740640527 Y39.20384677430378 F300 G1 X138.52230596525422 Y39.323178433120084 F300 G1 X138.30953388312997 Y39.428419667029715 F300 G1 X138.09015728208675 Y39.51909261316604 F300 -G1 X137.86517227294112 Y39.5947855580556 F300 +G1 X137.86517227294112 Y39.59478555805559 F300 G1 X137.6356004322883 Y39.65515480706194 F300 G1 X137.40248416388766 Y39.69992624498029 F300 G1 X137.16688196547943 Y39.72889658069677 F300 @@ -6355,7 +6355,7 @@ G1 X144.4798020127395 Y5.15795495625754 F300 G1 X144.68465559373016 Y5.037543119815648 F300 G1 X144.89714596552687 Y4.931185976690772 F300 G1 X145.11631027180687 Y4.8393654623554205 F300 -G1 X145.34115541468876 Y4.762497642544928 F300 +G1 X145.34115541468876 Y4.762497642544929 F300 G1 X145.570662554751 Y4.700930827941333 F300 G1 X145.8037917276928 Y4.654943995875304 F300 G1 X146.03948655671786 Y4.624745526197881 F300 @@ -6591,7 +6591,7 @@ G1 X173.33722072875804 Y10.664202752823204 F300 G1 X173.71489862046437 Y10.9402641055451 F300 G1 X174.07999999999979 Y11.22000000000031 F300 G1 X174.52938819002395 Y11.588600749789443 F300 -G1 X174.9690577792388 Y11.969907256840594 F300 +G1 X174.9690577792388 Y11.96990725684059 F300 G1 X175.39807975102428 Y12.36315545801282 F300 G1 X175.81612987168654 Y12.768048155667621 F300 G1 X176.22289219951682 Y13.18427935182909 F300 @@ -7096,7 +7096,7 @@ G1 X201.64999035384915 Y28.209870794922875 F300 G1 X201.64999999999966 Y27.690000000000367 F300 G1 X201.11889714077725 Y27.47300347754515 F300 G1 X200.5805820424032 Y27.27031935171787 F300 -G1 X200.03683812874596 Y27.08268524937891 F300 +G1 X200.03683812874596 Y27.082685249378912 F300 G1 X199.48808607107858 Y26.91024633496086 F300 G1 X198.9347504152597 Y26.75313601703314 F300 G1 X198.81120309240117 Y26.72031558605934 F300 @@ -7198,44 +7198,44 @@ G1 X218.6253738032657 Y52.93474919601907 F300 G1 X218.40780857813817 Y53.03075917107447 F300 G1 X218.18428131874572 Y53.111926324550595 F300 G1 X217.95580330787516 Y53.17788343973573 F300 -G1 X217.72340822651998 Y53.228332113225136 F300 +G1 X217.72340822652 Y53.228332113225136 F300 G1 X217.48814747729733 Y53.26304410495871 F300 G1 X217.25108542768862 Y53.28186237082544 F300 G1 X217.0132945946246 Y53.28470177316292 F300 G1 X216.7758507922006 Y53.27154946593745 F300 G1 X216.53982826447478 Y53.24246495286207 F300 G1 X216.30629482536946 Y53.19757981818973 F300 -G1 X216.07630702766372 Y53.1370971313993 F300 +G1 X216.07630702766374 Y53.1370971313993 F300 G1 X215.85090538293386 Y53.06129052846797 F300 G1 X215.63110965406722 Y52.97050297388644 F300 G1 X215.41791424164754 Y52.86514520901779 F300 G1 X215.21228368508446 Y52.745693893820004 F300 -G1 X215.01514829884107 Y52.61268945033939 F300 +G1 X215.01514829884107 Y52.612689450339396 F300 G1 X214.827399963502 Y52.46673361773131 F300 -G1 X214.6498880907242 Y52.30848672986983 F300 +G1 X214.64988809072423 Y52.30848672986983 F300 G1 X214.48341578032606 Y52.13866472786299 F300 G1 X214.3287361869001 Y51.958035920989595 F300 -G1 X214.18654911238883 Y51.76741751071177 F300 -G1 X214.05749784003814 Y51.56767189348932 F300 -G1 X213.94216622405304 Y51.35970275912273 F300 +G1 X214.18654911238886 Y51.76741751071177 F300 +G1 X214.05749784003814 Y51.567671893489326 F300 +G1 X213.94216622405307 Y51.35970275912273 F300 G1 X213.84107604812274 Y51.144451002276725 F300 G1 X213.7546846647648 Y50.92289046568138 F300 -G1 X213.6833829261695 Y50.69602353426958 F300 +G1 X213.6833829261695 Y50.696023534269585 F300 G1 X213.627493415905 Y50.46487660018368 F300 G1 X213.58726898948368 Y50.23049541916867 F300 G1 X213.56289163039222 Y49.9939403793605 F300 G1 X213.55447162676157 Y49.75628170387447 F300 -G1 X213.56204707240073 Y49.51859460889814 F300 -G1 X213.58558369445282 Y49.28195443919466 F300 +G1 X213.56204707240073 Y49.51859460889815 F300 +G1 X213.58558369445282 Y49.281954439194664 F300 G1 X213.6249750084523 Y49.04743180302427 F300 G1 X213.6800428000825 Y48.816087728494814 F300 G1 X213.75053793145332 Y48.58896886325476 F300 G1 X213.83614146825172 Y48.367102739246334 F300 -G1 X213.9364661226655 Y48.15149312394203 F300 +G1 X213.9364661226655 Y48.15149312394204 F300 G1 X214.05105800555216 Y47.943115479096406 F300 G1 X214.1793986799255 Y47.742912547558646 F300 G1 X214.32090750647026 Y47.55179008811224 F300 -G1 X214.4749442704723 Y47.37061277763795 F300 +G1 X214.4749442704723 Y47.37061277763796 F300 G1 X214.59050800623007 Y47.249492096996455 F300 G1 X214.6399999999994 Y47.19000000000062 F300 G1 X214.63999999999936 Y47.19000000000065 F300 @@ -7315,13 +7315,13 @@ G1 X220.33021807405524 Y9.72879685256915 F300 G1 X220.56747762914603 Y9.7253467050202 F300 G1 X220.8044305548761 Y9.737889072737799 F300 G1 X221.04000009847465 Y9.766366961155832 F300 -G1 X221.27311579348526 Y9.810650962101077 F300 +G1 X221.27311579348526 Y9.810650962101075 F300 G1 X221.50271832413986 Y9.870539841845066 F300 G1 X221.72776433906276 Y9.94576145554299 F300 G1 X221.9472311924294 Y10.035973983904299 F300 G1 X222.16012159103602 Y10.140767486475346 F300 G1 X222.3654681261627 Y10.259665764475724 F300 -G1 X222.56233766963655 Y10.392128524723251 F300 +G1 X222.56233766963655 Y10.39212852472325 F300 G1 X222.74983561411833 Y10.537553834814371 F300 G1 X222.92710993834433 Y10.695280858403256 F300 G1 X223.09335507884998 Y10.86459285815002 F300 diff --git a/lib/tests/square.gcode b/lib/tests/square.gcode index 960863a..1ff6164 100644 --- a/lib/tests/square.gcode +++ b/lib/tests/square.gcode @@ -9,37 +9,37 @@ G0 X8 Y2.5 G1 X7.992016 Y2.4110041813117045 F300 G1 X7.968318977024 Y2.324850533089038 F300 G1 X7.929665719197762 Y2.24429045824164 F300 -G1 X7.877290656963224 Y2.171896723319837 F300 -G1 X7.812866440307907 Y2.1099812946420924 F300 +G1 X7.877290656963223 Y2.171896723319837 F300 +G1 X7.812866440307907 Y2.109981294642092 F300 G1 X7.738450521014919 Y2.060521503338657 F300 -G1 X7.656419445882797 Y2.025096897304599 F300 +G1 X7.656419445882797 Y2.0250968973045986 F300 G1 X7.569392959326962 Y2.0048387967582206 F300 G1 X7.5 Y2 F300 G1 X7.4110041813117045 Y2.007984 F300 -G1 X7.324850533089038 Y2.031681022976 F300 -G1 X7.2442904582416405 Y2.0703342808022382 F300 +G1 X7.324850533089037 Y2.031681022976 F300 +G1 X7.24429045824164 Y2.0703342808022387 F300 G1 X7.171896723319837 Y2.1227093430367767 F300 -G1 X7.109981294642092 Y2.1871335596920924 F300 -G1 X7.0605215033386575 Y2.261549478985082 F300 -G1 X7.025096897304599 Y2.343580554117203 F300 +G1 X7.1099812946420915 Y2.187133559692093 F300 +G1 X7.060521503338657 Y2.261549478985082 F300 +G1 X7.025096897304599 Y2.3435805541172035 F300 G1 X7.004838796758221 Y2.430607040673038 F300 -G1 X7 Y2.5000000000000004 F300 +G1 X7 Y2.5 F300 G1 X7.007984 Y2.588995818688296 F300 G1 X7.0316810229760005 Y2.675149466910962 F300 G1 X7.070334280802238 Y2.75570954175836 F300 G1 X7.122709343036777 Y2.828103276680163 F300 G1 X7.187133559692093 Y2.890018705357908 F300 G1 X7.261549478985082 Y2.939478496661343 F300 -G1 X7.343580554117203 Y2.9749031026954014 F300 -G1 X7.430607040673038 Y2.9951612032417794 F300 -G1 X7.500000000000001 Y3 F300 +G1 X7.343580554117204 Y2.9749031026954014 F300 +G1 X7.4306070406730385 Y2.9951612032417794 F300 +G1 X7.5 Y3 F300 G1 X7.5889958186882955 Y2.992016 F300 -G1 X7.675149466910962 Y2.968318977024 F300 -G1 X7.7557095417583595 Y2.9296657191977618 F300 +G1 X7.675149466910963 Y2.968318977024 F300 +G1 X7.75570954175836 Y2.9296657191977613 F300 G1 X7.828103276680163 Y2.8772906569632233 F300 -G1 X7.890018705357908 Y2.8128664403079076 F300 -G1 X7.9394784966613425 Y2.7384505210149186 F300 -G1 X7.974903102695401 Y2.656419445882797 F300 -G1 X7.995161203241779 Y2.5693929593269624 F300 +G1 X7.890018705357908 Y2.812866440307907 F300 +G1 X7.9394784966613425 Y2.738450521014918 F300 +G1 X7.974903102695401 Y2.6564194458827965 F300 +G1 X7.995161203241779 Y2.569392959326962 F300 G1 X8 Y2.5 F300 M2 diff --git a/lib/tests/square_viewport.gcode b/lib/tests/square_viewport.gcode index 960863a..1ff6164 100644 --- a/lib/tests/square_viewport.gcode +++ b/lib/tests/square_viewport.gcode @@ -9,37 +9,37 @@ G0 X8 Y2.5 G1 X7.992016 Y2.4110041813117045 F300 G1 X7.968318977024 Y2.324850533089038 F300 G1 X7.929665719197762 Y2.24429045824164 F300 -G1 X7.877290656963224 Y2.171896723319837 F300 -G1 X7.812866440307907 Y2.1099812946420924 F300 +G1 X7.877290656963223 Y2.171896723319837 F300 +G1 X7.812866440307907 Y2.109981294642092 F300 G1 X7.738450521014919 Y2.060521503338657 F300 -G1 X7.656419445882797 Y2.025096897304599 F300 +G1 X7.656419445882797 Y2.0250968973045986 F300 G1 X7.569392959326962 Y2.0048387967582206 F300 G1 X7.5 Y2 F300 G1 X7.4110041813117045 Y2.007984 F300 -G1 X7.324850533089038 Y2.031681022976 F300 -G1 X7.2442904582416405 Y2.0703342808022382 F300 +G1 X7.324850533089037 Y2.031681022976 F300 +G1 X7.24429045824164 Y2.0703342808022387 F300 G1 X7.171896723319837 Y2.1227093430367767 F300 -G1 X7.109981294642092 Y2.1871335596920924 F300 -G1 X7.0605215033386575 Y2.261549478985082 F300 -G1 X7.025096897304599 Y2.343580554117203 F300 +G1 X7.1099812946420915 Y2.187133559692093 F300 +G1 X7.060521503338657 Y2.261549478985082 F300 +G1 X7.025096897304599 Y2.3435805541172035 F300 G1 X7.004838796758221 Y2.430607040673038 F300 -G1 X7 Y2.5000000000000004 F300 +G1 X7 Y2.5 F300 G1 X7.007984 Y2.588995818688296 F300 G1 X7.0316810229760005 Y2.675149466910962 F300 G1 X7.070334280802238 Y2.75570954175836 F300 G1 X7.122709343036777 Y2.828103276680163 F300 G1 X7.187133559692093 Y2.890018705357908 F300 G1 X7.261549478985082 Y2.939478496661343 F300 -G1 X7.343580554117203 Y2.9749031026954014 F300 -G1 X7.430607040673038 Y2.9951612032417794 F300 -G1 X7.500000000000001 Y3 F300 +G1 X7.343580554117204 Y2.9749031026954014 F300 +G1 X7.4306070406730385 Y2.9951612032417794 F300 +G1 X7.5 Y3 F300 G1 X7.5889958186882955 Y2.992016 F300 -G1 X7.675149466910962 Y2.968318977024 F300 -G1 X7.7557095417583595 Y2.9296657191977618 F300 +G1 X7.675149466910963 Y2.968318977024 F300 +G1 X7.75570954175836 Y2.9296657191977613 F300 G1 X7.828103276680163 Y2.8772906569632233 F300 -G1 X7.890018705357908 Y2.8128664403079076 F300 -G1 X7.9394784966613425 Y2.7384505210149186 F300 -G1 X7.974903102695401 Y2.656419445882797 F300 -G1 X7.995161203241779 Y2.5693929593269624 F300 +G1 X7.890018705357908 Y2.812866440307907 F300 +G1 X7.9394784966613425 Y2.738450521014918 F300 +G1 X7.974903102695401 Y2.6564194458827965 F300 +G1 X7.995161203241779 Y2.569392959326962 F300 G1 X8 Y2.5 F300 M2 diff --git a/web/Cargo.toml b/web/Cargo.toml index 5d3b53a..decf4c4 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "svg2gcode-web" -version = "0.0.3" +version = "0.0.4" authors = ["Sameer Puri "] edition = "2021" description = "Convert vector graphics to g-code for pen plotters, laser engravers, and other CNC machines" @@ -11,24 +11,24 @@ license = "MIT" [dependencies] wasm-bindgen = "0.2" svg2gcode = { path = "../lib", features = ["serde"] } -roxmltree = "0.18" +roxmltree = "0.19" g-code = "0.3" codespan-reporting = "0.11" codespan = "0.11" serde = "1" paste = "1" log = "0.4" -svgtypes = "0.11" +svgtypes = "0.12" serde_json = "1" thiserror = "1.0" zip = { version = "0.6", default-features = false } -yew = { version ="0.20", features = ["csr"] } -yewdux = "0.9.2" +yew = { version ="0.21", features = ["csr"] } +yewdux = "0.9.4" web-sys = { version = "0.3", features = [] } wasm-logger = "0.2" -gloo-file = { version = "0.2", features = ["futures"] } -gloo-timers = "0.2" +gloo-file = { version = "0.3", features = ["futures"] } +gloo-timers = "0.3" base64 = "0.21" wasm-bindgen-futures = "0.4" js-sys = "0.3" diff --git a/web/src/ui/mod.rs b/web/src/ui/mod.rs index fb11b59..4dd72ca 100644 --- a/web/src/ui/mod.rs +++ b/web/src/ui/mod.rs @@ -1,9 +1,9 @@ use std::fmt::Display; -use web_sys::{FileList, HtmlInputElement, MouseEvent, InputEvent, Event}; +use web_sys::{Event, FileList, HtmlInputElement, InputEvent, MouseEvent}; use yew::{ - classes, function_component, html, use_state, + classes, function_component, html, use_force_update, use_node_ref, use_state, virtual_dom::{VChild, VNode}, - Callback, Children, Html, NodeRef, Properties, TargetCast, use_node_ref, use_force_update, + AttrValue, Callback, Children, Html, NodeRef, Properties, TargetCast, ToHtml, }; macro_rules! css_class_enum { @@ -50,9 +50,13 @@ where E: Display + Clone + PartialEq, { pub label: &'static str, + #[prop_or_default] pub desc: Option<&'static str>, + #[prop_or_default] pub parsed: Option>, + #[prop_or_default] pub placeholder: Option, + #[prop_or_default] pub default: Option, #[prop_or(InputType::Text)] pub r#type: InputType, @@ -125,7 +129,7 @@ where { if let Some(Err(ref err)) = props.parsed.as_ref() { - html!{
{ err }
} + html!{
{ err.to_string() }
} } else if let Some(desc) = props.desc { html! {

{ desc }

} } else { @@ -170,13 +174,16 @@ pub fn checkbox(props: &CheckboxProps) -> Html { pub struct FileUploadProps where T: Clone + PartialEq, - E: Display + Clone + PartialEq, + E: Display + Clone + PartialEq + ToHtml, { pub label: &'static str, + #[prop_or_default] pub desc: Option<&'static str>, + #[prop_or_default] pub accept: Option<&'static str>, #[prop_or(false)] pub multiple: bool, + #[prop_or_default] pub parsed: Option>, #[prop_or_default] pub onchange: Callback, @@ -188,7 +195,7 @@ where pub fn file_upload(props: &FileUploadProps) -> Html where T: Clone + PartialEq, - E: Display + Clone + PartialEq, + E: Display + Clone + PartialEq + ToHtml, { let success = props.parsed.as_ref().map(|x| x.is_ok()).unwrap_or(false); let error = props.parsed.as_ref().map(|x| x.is_err()).unwrap_or(false); @@ -285,6 +292,7 @@ pub fn input_group(props: &InputGroupProps) -> Html { pub struct FormGroupProps { #[prop_or_default] pub children: Children, + #[prop_or_default] pub success: Option, } @@ -310,16 +318,19 @@ pub fn form_group(props: &FormGroupProps) -> Html { pub struct TextAreaProps where T: Display + Clone + PartialEq, - E: Display + Clone + PartialEq, + E: Display + Clone + PartialEq + ToHtml, { pub label: &'static str, pub desc: Option<&'static str>, pub parsed: Option>, - pub placeholder: Option, - pub default: Option, + #[prop_or_default] + pub placeholder: Option, + pub default: Option, #[prop_or_default] pub oninput: Callback, + #[prop_or_default] pub rows: Option, + #[prop_or_default] pub cols: Option, } @@ -327,13 +338,12 @@ where pub fn text_area(props: &TextAreaProps) -> Html where T: Display + Clone + PartialEq, - E: Display + Clone + PartialEq, + E: Display + Clone + PartialEq + ToHtml, { let success = props.parsed.as_ref().map(|x| x.is_ok()).unwrap_or(false); let error = props.parsed.as_ref().map(|x| x.is_err()).unwrap_or(false); let id = props.label.to_lowercase().replace(' ', "-"); - // To properly set the default value, we need to force a second render // so the noderef becomes valid. let first_render = use_state(|| true); @@ -411,13 +421,15 @@ impl Default for ButtonStyle { pub struct ButtonProps { #[prop_or_default] pub style: ButtonStyle, - #[prop_or(false)] + #[prop_or_default] pub disabled: bool, - #[prop_or(false)] + #[prop_or_default] pub loading: bool, - #[prop_or(false)] + #[prop_or_default] pub input_group: bool, + #[prop_or_default] pub title: Option<&'static str>, + #[prop_or_default] pub icon: Option>, #[prop_or_default] pub onclick: Callback, @@ -457,6 +469,7 @@ pub struct HyperlinkButtonProps { #[prop_or(false)] pub loading: bool, pub title: Option<&'static str>, + #[prop_or_default] pub icon: Option, pub href: &'static str, #[prop_or_default]