From fe9c97bb19c3e8e9d686d682061d21abfd2dac23 Mon Sep 17 00:00:00 2001 From: Steppy Date: Sun, 16 Feb 2025 17:47:33 +0100 Subject: [PATCH] Migrate project to workspace --- Cargo.toml | 20 +++--------- README.md | 32 +++---------------- leptos_webpage/Cargo.toml | 16 ++++++++++ leptos_webpage/README.md | 32 +++++++++++++++++++ Trunk.toml => leptos_webpage/Trunk.toml | 2 +- index.html => leptos_webpage/index.html | 0 leptosfmt.sh => leptos_webpage/leptosfmt.sh | 0 rustfmt.toml => leptos_webpage/rustfmt.toml | 0 {src => leptos_webpage/src}/bin/cli.rs | 0 .../src}/bin/create_default_configs.rs | 0 {src => leptos_webpage/src}/lib.rs | 0 {src => leptos_webpage/src}/main.rs | 0 {src => leptos_webpage/src}/session.rs | 0 .../src}/session_date_calculator.rs | 0 {src => leptos_webpage/src}/webpage.rs | 0 styles.css => leptos_webpage/styles.css | 0 16 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 leptos_webpage/Cargo.toml create mode 100644 leptos_webpage/README.md rename Trunk.toml => leptos_webpage/Trunk.toml (50%) rename index.html => leptos_webpage/index.html (100%) rename leptosfmt.sh => leptos_webpage/leptosfmt.sh (100%) rename rustfmt.toml => leptos_webpage/rustfmt.toml (100%) rename {src => leptos_webpage/src}/bin/cli.rs (100%) rename {src => leptos_webpage/src}/bin/create_default_configs.rs (100%) rename {src => leptos_webpage/src}/lib.rs (100%) rename {src => leptos_webpage/src}/main.rs (100%) rename {src => leptos_webpage/src}/session.rs (100%) rename {src => leptos_webpage/src}/session_date_calculator.rs (100%) rename {src => leptos_webpage/src}/webpage.rs (100%) rename styles.css => leptos_webpage/styles.css (100%) diff --git a/Cargo.toml b/Cargo.toml index 3e7bfff..9a4de6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,6 @@ -[package] -name = "jana_sessions_webpage" -version = "0.1.0" -edition = "2021" +[workspace] +resolver = "2" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -default-run = "jana_sessions_webpage" - -[dependencies] -chrono = { version = "0.4", features = ["serde"] } -leptos = { version = "0.7", features = ["csr"] } -console_error_panic_hook = "0.1.7" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -clap = { version = "4.5", features = ["derive"] } \ No newline at end of file +members = [ + "leptos_webpage", +] diff --git a/README.md b/README.md index 1c6b785..b976090 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,10 @@ # Jana Sessions Webpage -The webpage for Jana-Sessions (unofficial name), fully written in Rust. +The webpage of Jana Sessions (unofficial name) written in Rust. -## Building +The project currently consists of only a single crate, but a mayor refactoring is planned. -The project currently uses leptos, so you'll want to install trunk (`cargo install trunk`). -For the build to work you'll need the `wasm32-unknown-unknown` target (`rustup target add wasm32-unknown-unknown`). - -You can build the projekt with -```bash -trunk build --release -``` -which will create the app in the `target/dist` folder. - -Alternatively you can serve it locally with -```bash -trunk serve -``` - -To also access the local hosted page from other devices, use -```bash -trunk serve -a 0.0.0.0 -``` - -## Deployment - -Just use pythons webserver and point it to the dist folder -```bash -python3 -m http.server 8080 --directoy target/dist -``` +## leptos_webpage +The first functional version of the page, using leptos and trunk. +Please see the README there for more details. \ No newline at end of file diff --git a/leptos_webpage/Cargo.toml b/leptos_webpage/Cargo.toml new file mode 100644 index 0000000..3e7bfff --- /dev/null +++ b/leptos_webpage/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "jana_sessions_webpage" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +default-run = "jana_sessions_webpage" + +[dependencies] +chrono = { version = "0.4", features = ["serde"] } +leptos = { version = "0.7", features = ["csr"] } +console_error_panic_hook = "0.1.7" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +clap = { version = "4.5", features = ["derive"] } \ No newline at end of file diff --git a/leptos_webpage/README.md b/leptos_webpage/README.md new file mode 100644 index 0000000..1c6b785 --- /dev/null +++ b/leptos_webpage/README.md @@ -0,0 +1,32 @@ +# Jana Sessions Webpage + +The webpage for Jana-Sessions (unofficial name), fully written in Rust. + +## Building + +The project currently uses leptos, so you'll want to install trunk (`cargo install trunk`). +For the build to work you'll need the `wasm32-unknown-unknown` target (`rustup target add wasm32-unknown-unknown`). + +You can build the projekt with +```bash +trunk build --release +``` +which will create the app in the `target/dist` folder. + +Alternatively you can serve it locally with +```bash +trunk serve +``` + +To also access the local hosted page from other devices, use +```bash +trunk serve -a 0.0.0.0 +``` + +## Deployment + +Just use pythons webserver and point it to the dist folder +```bash +python3 -m http.server 8080 --directoy target/dist +``` + diff --git a/Trunk.toml b/leptos_webpage/Trunk.toml similarity index 50% rename from Trunk.toml rename to leptos_webpage/Trunk.toml index a107850..04719dc 100644 --- a/Trunk.toml +++ b/leptos_webpage/Trunk.toml @@ -1,6 +1,6 @@ [build] filehash = false -dist = "target/dist" +dist = "../target/dist" public_url = "." [[hooks]] diff --git a/index.html b/leptos_webpage/index.html similarity index 100% rename from index.html rename to leptos_webpage/index.html diff --git a/leptosfmt.sh b/leptos_webpage/leptosfmt.sh similarity index 100% rename from leptosfmt.sh rename to leptos_webpage/leptosfmt.sh diff --git a/rustfmt.toml b/leptos_webpage/rustfmt.toml similarity index 100% rename from rustfmt.toml rename to leptos_webpage/rustfmt.toml diff --git a/src/bin/cli.rs b/leptos_webpage/src/bin/cli.rs similarity index 100% rename from src/bin/cli.rs rename to leptos_webpage/src/bin/cli.rs diff --git a/src/bin/create_default_configs.rs b/leptos_webpage/src/bin/create_default_configs.rs similarity index 100% rename from src/bin/create_default_configs.rs rename to leptos_webpage/src/bin/create_default_configs.rs diff --git a/src/lib.rs b/leptos_webpage/src/lib.rs similarity index 100% rename from src/lib.rs rename to leptos_webpage/src/lib.rs diff --git a/src/main.rs b/leptos_webpage/src/main.rs similarity index 100% rename from src/main.rs rename to leptos_webpage/src/main.rs diff --git a/src/session.rs b/leptos_webpage/src/session.rs similarity index 100% rename from src/session.rs rename to leptos_webpage/src/session.rs diff --git a/src/session_date_calculator.rs b/leptos_webpage/src/session_date_calculator.rs similarity index 100% rename from src/session_date_calculator.rs rename to leptos_webpage/src/session_date_calculator.rs diff --git a/src/webpage.rs b/leptos_webpage/src/webpage.rs similarity index 100% rename from src/webpage.rs rename to leptos_webpage/src/webpage.rs diff --git a/styles.css b/leptos_webpage/styles.css similarity index 100% rename from styles.css rename to leptos_webpage/styles.css