diff --git a/Cargo.lock b/Cargo.lock index 4a6bcd6..dea6b57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,7 +60,7 @@ dependencies = [ "getrandom 0.2.15", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -176,9 +176,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310c9bcae737a48ef5cdee3174184e6d548b292739ede61a1f955ef76a738861" +checksum = "c0cf008e5e1a9e9e22a7d3c9a4992e21a350290069e36d8fb72304ed17e8f2d2" dependencies = [ "brotli", "flate2", @@ -198,18 +198,18 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] name = "async-trait" -version = "0.1.87" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -270,7 +270,7 @@ dependencies = [ "manyhow", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -286,7 +286,7 @@ dependencies = [ "proc-macro2", "quote", "quote-use", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -306,7 +306,7 @@ dependencies = [ "axum-macros 0.4.2", "bytes", "futures-util", - "http 1.2.0", + "http 1.3.1", "http-body", "http-body-util", "hyper", @@ -341,7 +341,7 @@ dependencies = [ "bytes", "form_urlencoded", "futures-util", - "http 1.2.0", + "http 1.3.1", "http-body", "http-body-util", "hyper", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "axum-controller" -version = "0.2.1" +version = "0.2.2" dependencies = [ "axum-controller-macros", "axum-typed-routing 0.2.0", @@ -375,12 +375,12 @@ dependencies = [ [[package]] name = "axum-controller-macros" -version = "0.2.1" +version = "0.2.2" dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -392,7 +392,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.2.0", + "http 1.3.1", "http-body", "http-body-util", "mime", @@ -412,7 +412,7 @@ checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" dependencies = [ "bytes", "futures-util", - "http 1.2.0", + "http 1.3.1", "http-body", "http-body-util", "mime", @@ -432,7 +432,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -443,7 +443,7 @@ checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -471,7 +471,7 @@ version = "0.2.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -481,7 +481,7 @@ source = "git+https://github.com/jvdwrf/axum-typed-routing#160684a406d616974d851 dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -513,9 +513,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.6.0" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "bitflags" @@ -1136,7 +1136,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1269,7 +1269,7 @@ dependencies = [ [[package]] name = "datastar" version = "0.1.0" -source = "git+https://github.com/starfederation/datastar.git#100e4ac64cca41666379c6eef5242a7c8978fa18" +source = "git+https://github.com/starfederation/datastar.git#db376dfbe4d100ea997c932f1301fbe72e08dfe8" dependencies = [ "futures-util", ] @@ -1302,7 +1302,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1315,7 +1315,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1335,7 +1335,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1364,7 +1364,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1396,7 +1396,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1669,7 +1669,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1776,7 +1776,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -1978,14 +1978,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -2060,7 +2060,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -2104,7 +2104,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils", - "http 1.2.0", + "http 1.3.1", "js-sys", "pin-project", "serde", @@ -2200,7 +2200,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -2214,8 +2214,8 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.2.0", - "indexmap 2.7.1", + "http 1.3.1", + "indexmap 2.8.0", "slab", "tokio", "tokio-util", @@ -2224,9 +2224,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" dependencies = [ "cfg-if", "crunchy", @@ -2362,9 +2362,9 @@ dependencies = [ [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -2378,18 +2378,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.2.0", + "http 1.3.1", ] [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", - "http 1.2.0", + "futures-core", + "http 1.3.1", "http-body", "pin-project-lite", ] @@ -2422,7 +2422,7 @@ dependencies = [ "futures-channel", "futures-util", "h2", - "http 1.2.0", + "http 1.3.1", "http-body", "httparse", "httpdate", @@ -2440,7 +2440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 1.2.0", + "http 1.3.1", "hyper", "hyper-util", "rustls", @@ -2476,7 +2476,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.2.0", + "http 1.3.1", "http-body", "hyper", "pin-project-lite", @@ -2494,7 +2494,7 @@ checksum = "508fb3d4a66e3649600d00b2c82cd0ca52227ab2970537899903b3c9fd17ab21" dependencies = [ "axum-core 0.5.0", "html-escape", - "http 1.2.0", + "http 1.3.1", "hypertext-macros", "itoa 1.0.15", "ryu", @@ -2511,7 +2511,7 @@ dependencies = [ "proc-macro2-diagnostics", "quote", "rstml 0.12.1", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -2663,7 +2663,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -2713,7 +2713,7 @@ dependencies = [ "libflate", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -2728,9 +2728,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -2962,7 +2962,7 @@ dependencies = [ "futures", "getrandom 0.2.15", "html-escape", - "indexmap 2.7.1", + "indexmap 2.8.0", "itertools 0.12.1", "js-sys", "leptos_reactive", @@ -2988,13 +2988,13 @@ checksum = "6cb53d4794240b684a2f4be224b84bee9e62d2abc498cf2bcd643cd565e01d96" dependencies = [ "anyhow", "camino", - "indexmap 2.7.1", + "indexmap 2.8.0", "parking_lot 0.12.3", "proc-macro2", "quote", "rstml 0.11.2", "serde", - "syn 2.0.99", + "syn 2.0.100", "walkdir", ] @@ -3030,7 +3030,7 @@ dependencies = [ "quote", "rstml 0.11.2", "server_fn_macro", - "syn 2.0.99", + "syn 2.0.100", "tracing", "uuid", ] @@ -3042,7 +3042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25acc2f63cf91932013e400a95bf6e35e5d3dbb44a7b7e25a8e3057d12005b3b" dependencies = [ "cfg-if", - "indexmap 2.7.1", + "indexmap 2.8.0", "leptos", "tracing", "wasm-bindgen", @@ -3058,7 +3058,7 @@ dependencies = [ "base64 0.22.1", "cfg-if", "futures", - "indexmap 2.7.1", + "indexmap 2.8.0", "js-sys", "oco_ref", "paste", @@ -3127,9 +3127,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.170" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libflate" @@ -3221,9 +3221,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "litemap" @@ -3256,7 +3256,7 @@ dependencies = [ "gloo-net 0.5.0", "gloo-timers", "gtk", - "http 1.2.0", + "http 1.3.1", "leptos", "leptos_axum", "leptos_meta", @@ -3373,7 +3373,7 @@ dependencies = [ "manyhow-macros", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -3513,7 +3513,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.2.0", + "http 1.3.1", "httparse", "memchr", "mime", @@ -3724,7 +3724,7 @@ dependencies = [ "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -3798,9 +3798,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "openport" @@ -3834,7 +3834,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -3996,7 +3996,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -4142,7 +4142,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -4207,11 +4207,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy", + "zerocopy 0.8.23", ] [[package]] @@ -4222,12 +4222,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.30" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" +checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" dependencies = [ "proc-macro2", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -4340,7 +4340,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", "version_check", "yansi", ] @@ -4464,9 +4464,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -4490,9 +4490,15 @@ dependencies = [ "proc-macro-utils 0.10.0", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -4704,9 +4710,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" dependencies = [ "base64 0.22.1", "bytes", @@ -4716,7 +4722,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 1.2.0", + "http 1.3.1", "http-body", "http-body-util", "hyper", @@ -4780,7 +4786,7 @@ checksum = "562ceb5a604d3f7c885a792d42c199fd8af239d0a51b2fa6a78aafa092452b04" dependencies = [ "anyhow", "async-trait", - "http 1.2.0", + "http 1.3.1", "reqwest", "serde", "thiserror 1.0.69", @@ -4797,7 +4803,7 @@ dependencies = [ "async-trait", "futures", "getrandom 0.2.15", - "http 1.2.0", + "http 1.3.1", "hyper", "parking_lot 0.11.2", "reqwest", @@ -4819,9 +4825,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", @@ -4868,9 +4874,9 @@ checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" [[package]] name = "rsa" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" +checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" dependencies = [ "const-oid", "digest", @@ -4895,7 +4901,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.99", + "syn 2.0.100", "syn_derive 0.1.8", "thiserror 1.0.69", ] @@ -4910,7 +4916,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.99", + "syn 2.0.100", "syn_derive 0.2.0", "thiserror 2.0.12", ] @@ -4937,7 +4943,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.99", + "syn 2.0.100", "walkdir", ] @@ -5002,22 +5008,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" dependencies = [ "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys 0.9.2", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.23" +version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ "once_cell", "ring", @@ -5047,9 +5053,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" dependencies = [ "ring", "rustls-pki-types", @@ -5198,9 +5204,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] @@ -5218,13 +5224,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -5307,7 +5313,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.8.0", "itoa 1.0.15", "ryu", "serde", @@ -5327,7 +5333,7 @@ dependencies = [ "dashmap", "futures", "gloo-net 0.6.0", - "http 1.2.0", + "http 1.3.1", "http-body-util", "hyper", "inventory", @@ -5361,7 +5367,7 @@ dependencies = [ "convert_case 0.6.0", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", "xxhash-rust", ] @@ -5372,7 +5378,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f2aa8119b558a17992e0ac1fd07f080099564f24532858811ce04f742542440" dependencies = [ "server_fn_macro", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -5618,7 +5624,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.7.1", + "indexmap 2.8.0", "log", "memchr", "once_cell", @@ -5864,7 +5870,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -5886,9 +5892,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.99" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -5904,7 +5910,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -5916,7 +5922,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -5936,7 +5942,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6036,7 +6042,7 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6053,15 +6059,14 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.18.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ - "cfg-if", "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.2", "once_cell", - "rustix 1.0.1", + "rustix 1.0.2", "windows-sys 0.59.0", ] @@ -6108,7 +6113,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6119,7 +6124,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6215,9 +6220,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ "backtrace", "bytes", @@ -6240,7 +6245,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6277,9 +6282,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -6317,7 +6322,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.8.0", "toml_datetime", "winnow", ] @@ -6328,7 +6333,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.7.1", + "indexmap 2.8.0", "serde", "serde_spanned", "toml_datetime", @@ -6374,7 +6379,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.2.0", + "http 1.3.1", "http-body", "http-body-util", "http-range-header", @@ -6422,7 +6427,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6484,7 +6489,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6527,7 +6532,7 @@ checksum = "1f718dfaf347dcb5b983bfc87608144b0bad87970aebcbea5ce44d2a30c08e63" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -6657,11 +6662,11 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.15.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.2", "js-sys", "serde", "wasm-bindgen", @@ -6724,9 +6729,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -6759,7 +6764,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", "wasm-bindgen-shared", ] @@ -6794,7 +6799,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7050,7 +7055,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -7154,7 +7159,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -7165,7 +7170,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] @@ -7176,13 +7181,13 @@ checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ - "windows-result 0.2.0", + "windows-result 0.3.1", "windows-strings", - "windows-targets 0.52.6", + "windows-targets 0.53.0", ] [[package]] @@ -7196,21 +7201,20 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" dependencies = [ - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", + "windows-link", ] [[package]] @@ -7288,13 +7292,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows-version" version = "0.1.3" @@ -7322,6 +7342,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -7340,6 +7366,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -7358,12 +7390,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -7382,6 +7426,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -7400,6 +7450,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -7418,6 +7474,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -7436,6 +7498,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winit" version = "0.29.15" @@ -7496,9 +7564,9 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags 2.9.0", ] @@ -7531,7 +7599,7 @@ dependencies = [ "gdkx11", "gtk", "html5ever", - "http 1.2.0", + "http 1.3.1", "javascriptcore-rs", "jni", "kuchikiki", @@ -7666,7 +7734,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", "synstructure", ] @@ -7676,8 +7744,16 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", ] [[package]] @@ -7688,7 +7764,18 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -7708,7 +7795,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", "synstructure", ] @@ -7737,7 +7824,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.99", + "syn 2.0.100", ] [[package]] diff --git a/darm_test/TODO.org b/darm_test/TODO.org index 8999bb3..c1eb21c 100644 --- a/darm_test/TODO.org +++ b/darm_test/TODO.org @@ -2,7 +2,7 @@ - maud vs hypertext vs minijinja - try porting to hypertext::maud ! * Todos -** Starter boilerplate +** [-] Starter boilerplate *** [X] Server: Axum **** [X] Typed routes via macro **** [X] Nested Router @@ -11,7 +11,7 @@ *** [X] "html tmpl": minijinja - only index yaml for now, test in app wether inline or external templates feel better *** [ ] CSS Basic -- UnoCSS +- [X] UnoCSS - daisyUI? *** [ ] UI framework - data* js basic @@ -19,14 +19,28 @@ *** [ ] Asset bundle testing *** [ ] DB - SqlX/SurrealDB? -** Basic streaming chat +*** [ ] Build scripts +- [ ] remove npm ? +- [ ] add fish or cargo make scripts ? +- [ ] features: + - [ ] make dev + - make js? + - "bundle"/download data* ? + - make css + - make rust app + - [ ] make watch-dev + - [ ] make prod +** [X] Chat mockup +** [X] Streaming chat with data* +** [ ] Basic streaming chat - build with inline html via maud +- add messaging foo? *** Stream same token in loop *** ??? *** Finish -** Basic Proxy Settings +** [ ] Basic Proxy Settings - build with jinja templates -** Markdown streaming chat +** [ ] Markdown streaming chat *** Moar Feats **** Tauri webview/wry? **** Jinja tmplts for models ?? diff --git a/darm_test/src/assets.rs b/darm_test/src/assets.rs new file mode 100644 index 0000000..1820257 --- /dev/null +++ b/darm_test/src/assets.rs @@ -0,0 +1,61 @@ +use axum::{ + body::Body, + extract::State, + http::{header, Response, StatusCode}, + response::IntoResponse, +}; +use axum_controller::*; +use hypertext::{maud, GlobalAttributes, Renderable}; +use rust_embed::RustEmbed; + +use crate::{ui::html_elements, AppState}; + +pub struct AxumEmbedAsset(pub T); + +impl IntoResponse for AxumEmbedAsset +where + T: Into, +{ + fn into_response(self) -> Response { + let path = self.0.into(); + tracing::debug!(?path); + #[derive(RustEmbed)] + #[folder = "public/"] + struct EmbedAsset; + + fn markup_404(uri: String) -> impl Renderable { + maud! { + h1 { "404" } + p { (uri) " Not Found" } + @for i in 0..5 { + div .{"m-" (i)} { (i) } + } + } + } + + match EmbedAsset::get(path.as_str()) { + Some(content) => { + let mime = mime_guess::from_path(path).first_or_octet_stream(); + + ([(header::CONTENT_TYPE, mime.as_ref())], content.data).into_response() + } + None => ( + StatusCode::NOT_FOUND, + axum::response::Html(markup_404(path).render()), + ) + .into_response(), + } + } +} + +pub struct AssetsController; + +#[controller(state=AppState, path="/dist")] +impl AssetsController { + #[route(GET "/*path")] + async fn static_handler(path: String, _: State) -> impl IntoResponse { + let path = path.trim_start_matches('/').to_string(); + + AxumEmbedAsset(path) + } +} diff --git a/darm_test/src/main.rs b/darm_test/src/main.rs index 6e07fe4..6cf2962 100644 --- a/darm_test/src/main.rs +++ b/darm_test/src/main.rs @@ -1,103 +1,17 @@ +mod assets; +mod ui; use std::sync::Once; +use assets::AssetsController; use axum::{ - body::Body, - extract::State, - http::{header, Response, StatusCode, Uri}, + http::{StatusCode, Uri}, response::IntoResponse, routing::get, }; -use axum_controller::*; use hypertext::{maud, GlobalAttributes, Renderable}; -use rust_embed::RustEmbed; +use ui::UiController; -mod html_elements { - use hypertext::elements; - pub use hypertext::html_elements::*; - - elements! { - bla { - blub - } - my_element { - my_attribute - } - } -} - -struct UiController {} - -#[controller( - state = AppState -)] -impl UiController { - #[route(GET "/")] - async fn index(State(_): State) -> impl IntoResponse { - maud! { - html lang="en" { - head { - meta charset="UTF-8"; - meta name="viewport" content="width=device-width, initial-scale=1.0"; - title { - "LLM Chat App" - } - script type="module" src="/dist/datastar.min.js" {} - link rel="stylesheet" href="/dist/styles.min.css"; - link rel="icon" href="/dist/favicon.ico"; - } - body class="bg-gray-100" { - div class="container mx-auto p-4" { - h1 class="text-2xl font-bold mb-4" { - "LLM Chat App" - } - div class="bg-white p-6 rounded-lg shadow-md" { - div id="chat" class="mb-4" { - // Chat messages will appear here - } - form id="chat-form" { - textarea id="user-input" class="w-full p-2 border rounded-lg mb-2" placeholder="Type your message..." {} - button type="submit" class="bg-blue-500 text-white p-2 rounded-lg" { - "Send" - } - } - } - } - script { - (hypertext::Raw(" - console.log(\"asd\"); - document.getElementById('chat-form').addEventListener('submit', function(event) { - event.preventDefault(); - const userInput = document.getElementById('user-input').value; - const chatContainer = document.getElementById('chat'); - chatContainer.innerHTML += `
You: ${userInput}
`; - document.getElementById('user-input').value = ''; - console.log(\"asd\"); - - // Mock response from LLM - setTimeout(() => { - chatContainer.innerHTML += `
LLM: This is a mock response.
`; - }, 1000); - }); - ")) - } - } - } - } - .render() - } -} - -struct DistController; - -#[controller(state=AppState, path="/dist")] -impl DistController { - #[route(GET "/*path")] - async fn static_handler(path: String, _: State) -> impl IntoResponse { - let path = path.trim_start_matches('/').to_string(); - - StaticFile(path) - } -} +use crate::ui::html_elements; fn markup_404(uri: String) -> impl Renderable { maud! { @@ -135,35 +49,6 @@ async fn handle_405() -> impl IntoResponse { ) .into_response() } - -pub struct StaticFile(pub T); - -impl IntoResponse for StaticFile -where - T: Into, -{ - fn into_response(self) -> Response { - let path = self.0.into(); - tracing::debug!(?path); - #[derive(RustEmbed)] - #[folder = "public/"] - struct Asset; - - match Asset::get(path.as_str()) { - Some(content) => { - let mime = mime_guess::from_path(path).first_or_octet_stream(); - - ([(header::CONTENT_TYPE, mime.as_ref())], content.data).into_response() - } - None => ( - StatusCode::NOT_FOUND, - axum::response::Html(markup_404(path).render()), - ) - .into_response(), - } - } -} - pub fn initialize_logger() { static INIT: Once = Once::new(); @@ -197,7 +82,7 @@ async fn main() { let router: axum::Router = axum::Router::new() .merge(UiController::into_router(app_state.clone())) - .merge(DistController::into_router(app_state.clone())) + .merge(AssetsController::into_router(app_state.clone())) .fallback_service(get(handle_404)) .method_not_allowed_fallback(handle_405) .with_state(app_state); diff --git a/darm_test/src/ui/components/mod.rs b/darm_test/src/ui/components/mod.rs new file mode 100644 index 0000000..b0e77c2 --- /dev/null +++ b/darm_test/src/ui/components/mod.rs @@ -0,0 +1,24 @@ +use hypertext::{maud, GlobalAttributes, Renderable}; + +use crate::ui::html_elements; + +pub fn main_page(body: impl Renderable) -> impl Renderable { + maud! { + html lang="en" { + head { + + meta charset="UTF-8"; + meta name="viewport" content="width=device-width, initial-scale=1.0"; + title { + "LLM Chat App" + } + script type="module" src="/dist/datastar.min.js" {} + link rel="stylesheet" href="/dist/styles.min.css"; + link rel="icon" href="/dist/favicon.ico"; + } + body class="bg-gray-100" { + (body) + } + } + } +} diff --git a/darm_test/src/ui/mod.rs b/darm_test/src/ui/mod.rs new file mode 100644 index 0000000..f2d37e7 --- /dev/null +++ b/darm_test/src/ui/mod.rs @@ -0,0 +1,69 @@ +mod components; +use axum::{extract::State, response::IntoResponse}; +use axum_controller::*; +use hypertext::{maud, GlobalAttributes, Renderable}; + +use crate::{ui::components::*, AppState}; + +pub mod html_elements { + use hypertext::elements; + pub use hypertext::html_elements::*; + + elements! { + bla { + blub + } + my_element { + my_attribute + } + } +} + +pub struct UiController {} + +#[controller( + state = AppState +)] +impl UiController { + #[route(GET "/")] + async fn index(State(_): State) -> impl IntoResponse { + main_page(maud! { + div class="container mx-auto p-4" { + h1 class="text-2xl font-bold mb-4" { + "LLM Chat App" + } + div class="bg-white p-6 rounded-lg shadow-md" { + div id="chat" class="mb-4" { + // Chat messages will appear here + } + form id="chat-form" { + textarea id="user-input" class="w-full p-2 border rounded-lg mb-2" placeholder="Type your message..." {} + button type="submit" class="bg-blue-500 text-white p-2 rounded-lg" { + "Send" + } + } + } + } + script { + (hypertext::Raw(" + console.log(\"asd\"); + document.getElementById('chat-form').addEventListener('submit', function(event) { + event.preventDefault(); + const userInput = document.getElementById('user-input').value; + const chatContainer = document.getElementById('chat'); + chatContainer.innerHTML += `
You: ${userInput}
`; + document.getElementById('user-input').value = ''; + console.log(\"asd\"); + + // Mock response from LLM + setTimeout(() => { + chatContainer.innerHTML += `
LLM: This is a mock response.
`; + }, 1000); + }); + ")) + } + } + ) + .render() + } +} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 790b0a3..b1a0513 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,16 +1,16 @@ [toolchain] channel = "nightly-2025-03-01" components = [ - "cargo", - "rust-analyzer", - "rust-src", - "rustc-codegen-cranelift", - "rustc-dev", - "rustfmt", + "cargo", + "rust-analyzer", + "rust-src", + "rustc-codegen-cranelift", + "rustc-dev", + "rustfmt", ] profile = "default" targets = [ - "wasm32-unknown-unknown", - "x86_64-pc-windows-msvc", - "x86_64-unknown-linux-gnu", + "wasm32-unknown-unknown", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", ] diff --git a/rustfmt.toml b/rustfmt.toml index 7b821b6..c5342ab 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,5 +1,5 @@ -edition = "2021" +edition = "2024" max_width = 100 tab_spaces = 4