From 26ec3c0b2e156bf51e5851451818130f57d53cdb Mon Sep 17 00:00:00 2001 From: G2-Games Date: Sat, 9 Nov 2024 16:37:36 -0600 Subject: [PATCH] Moved to workspace structure --- Cargo.toml | 30 ++++++------------ confetti-box/Cargo.toml | 26 +++++++++++++++ LICENSE => confetti-box/LICENSE | 0 {src => confetti-box/src}/database.rs | 2 +- {src => confetti-box/src}/endpoints.rs | 2 +- {src => confetti-box/src}/lib.rs | 6 ++-- {src => confetti-box/src}/main.rs | 0 {src => confetti-box/src}/pages.rs | 0 {src => confetti-box/src}/resources.rs | 0 {src => confetti-box/src}/settings.rs | 0 {src => confetti-box/src}/strings.rs | 0 {src => confetti-box/src}/utils.rs | 0 {web => confetti-box/web}/favicon.svg | 0 .../web}/fonts/fira-code.woff2 | Bin {web => confetti-box/web}/fonts/roboto.woff2 | Bin {web => confetti-box/web}/main.css | 0 {web => confetti-box/web}/request.js | 0 17 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 confetti-box/Cargo.toml rename LICENSE => confetti-box/LICENSE (100%) rename {src => confetti-box/src}/database.rs (99%) rename {src => confetti-box/src}/endpoints.rs (95%) rename {src => confetti-box/src}/lib.rs (97%) rename {src => confetti-box/src}/main.rs (100%) rename {src => confetti-box/src}/pages.rs (100%) rename {src => confetti-box/src}/resources.rs (100%) rename {src => confetti-box/src}/settings.rs (100%) rename {src => confetti-box/src}/strings.rs (100%) rename {src => confetti-box/src}/utils.rs (100%) rename {web => confetti-box/web}/favicon.svg (100%) rename {web => confetti-box/web}/fonts/fira-code.woff2 (100%) rename {web => confetti-box/web}/fonts/roboto.woff2 (100%) rename {web => confetti-box/web}/main.css (100%) rename {web => confetti-box/web}/request.js (100%) diff --git a/Cargo.toml b/Cargo.toml index c4beaf6..cce8aba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,14 @@ -[package] -name = "confetti_box" -version = "0.1.3" -edition = "2021" +[workspace] +resolver = "2" +members = [ + "confetti-box", +] -[dependencies] -blake3 = { version = "1.5.4", features = ["mmap", "rayon", "serde"] } -chrono = { version = "0.4.38", features = ["serde"] } -ciborium = "0.2.2" -file-format = { version = "0.26", features = ["reader"] } -log = "0.4" -lz4_flex = "0.11.3" -maud = { version = "0.26", features = ["rocket"] } -rand = "0.8.5" -rocket = { version = "0.5", features = ["json"] } -serde = { version = "1.0.213", features = ["derive"] } -serde_with = { version = "3.11.0", features = ["chrono_0_4"] } -toml = "0.8.19" -unidecode = "0.3.0" -urlencoding = "2.1.3" -uuid = { version = "1.11.0", features = ["serde", "v4"] } +[workspace.package] +authors = ["G2"] + +[workspace.lints.rust] +unsafe_code = "forbid" [profile.production] inherits = "release" diff --git a/confetti-box/Cargo.toml b/confetti-box/Cargo.toml new file mode 100644 index 0000000..0521bd7 --- /dev/null +++ b/confetti-box/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "confetti_box" +version = "0.1.3" +edition = "2021" +license = "GPL-3.0-or-later" +authors.workspace = true + +[lints] +workspace = true + +[dependencies] +blake3 = { version = "1.5.4", features = ["mmap", "rayon", "serde"] } +chrono = { version = "0.4.38", features = ["serde"] } +ciborium = "0.2.2" +file-format = { version = "0.26", features = ["reader"] } +log = "0.4" +lz4_flex = "0.11.3" +maud = { version = "0.26", features = ["rocket"] } +rand = "0.8.5" +rocket = { version = "0.5", features = ["json"] } +serde = { version = "1.0.213", features = ["derive"] } +serde_with = { version = "3.11.0", features = ["chrono_0_4"] } +toml = "0.8.19" +unidecode = "0.3.0" +urlencoding = "2.1.3" +uuid = { version = "1.11.0", features = ["serde", "v4"] } diff --git a/LICENSE b/confetti-box/LICENSE similarity index 100% rename from LICENSE rename to confetti-box/LICENSE diff --git a/src/database.rs b/confetti-box/src/database.rs similarity index 99% rename from src/database.rs rename to confetti-box/src/database.rs index 4124a08..69d95da 100644 --- a/src/database.rs +++ b/confetti-box/src/database.rs @@ -14,7 +14,7 @@ use log::{error, info, warn}; use rand::distributions::{Alphanumeric, DistString}; use rocket::{ form::{self, FromFormField, ValueField}, - serde::{Deserialize, Serialize}, tokio, + serde::{Deserialize, Serialize}, }; use serde_with::{serde_as, DisplayFromStr}; use uuid::Uuid; diff --git a/src/endpoints.rs b/confetti-box/src/endpoints.rs similarity index 95% rename from src/endpoints.rs rename to confetti-box/src/endpoints.rs index 19ec757..ef34161 100644 --- a/src/endpoints.rs +++ b/confetti-box/src/endpoints.rs @@ -4,7 +4,7 @@ use std::{ }; use rocket::{ - get, http::{uri::Uri, ContentType, Header}, response::{self, Redirect, Responder, Response}, serde::{self, json::Json}, tokio::{self, fs::File}, uri, Request, State + get, http::ContentType, response::{self, Redirect, Responder, Response}, serde::{self, json::Json}, tokio::{self, fs::File}, uri, Request, State }; use serde::Serialize; diff --git a/src/lib.rs b/confetti-box/src/lib.rs similarity index 97% rename from src/lib.rs rename to confetti-box/src/lib.rs index c316485..fa87eb2 100644 --- a/src/lib.rs +++ b/confetti-box/src/lib.rs @@ -20,9 +20,9 @@ use chrono::{TimeDelta, Utc}; use database::{Chunkbase, ChunkedInfo, Mmid, MochiFile, Mochibase}; use maud::{html, Markup, PreEscaped}; use rocket::{ - data::ToByteUnit, get, http::ContentType, post, serde::{json::Json, Serialize}, tokio::{ - self, fs, io::{AsyncSeekExt, AsyncWriteExt} - }, Data, Responder, State + data::ToByteUnit, get, post, serde::{json::Json, Serialize}, tokio::{ + fs, io::{AsyncSeekExt, AsyncWriteExt} + }, Data, State }; use uuid::Uuid; diff --git a/src/main.rs b/confetti-box/src/main.rs similarity index 100% rename from src/main.rs rename to confetti-box/src/main.rs diff --git a/src/pages.rs b/confetti-box/src/pages.rs similarity index 100% rename from src/pages.rs rename to confetti-box/src/pages.rs diff --git a/src/resources.rs b/confetti-box/src/resources.rs similarity index 100% rename from src/resources.rs rename to confetti-box/src/resources.rs diff --git a/src/settings.rs b/confetti-box/src/settings.rs similarity index 100% rename from src/settings.rs rename to confetti-box/src/settings.rs diff --git a/src/strings.rs b/confetti-box/src/strings.rs similarity index 100% rename from src/strings.rs rename to confetti-box/src/strings.rs diff --git a/src/utils.rs b/confetti-box/src/utils.rs similarity index 100% rename from src/utils.rs rename to confetti-box/src/utils.rs diff --git a/web/favicon.svg b/confetti-box/web/favicon.svg similarity index 100% rename from web/favicon.svg rename to confetti-box/web/favicon.svg diff --git a/web/fonts/fira-code.woff2 b/confetti-box/web/fonts/fira-code.woff2 similarity index 100% rename from web/fonts/fira-code.woff2 rename to confetti-box/web/fonts/fira-code.woff2 diff --git a/web/fonts/roboto.woff2 b/confetti-box/web/fonts/roboto.woff2 similarity index 100% rename from web/fonts/roboto.woff2 rename to confetti-box/web/fonts/roboto.woff2 diff --git a/web/main.css b/confetti-box/web/main.css similarity index 100% rename from web/main.css rename to confetti-box/web/main.css diff --git a/web/request.js b/confetti-box/web/request.js similarity index 100% rename from web/request.js rename to confetti-box/web/request.js