aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-18 23:43:12 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-18 23:43:12 +0100
commited19a428cb5eef84c8cf3fed5fda3afd5fc96305 (patch)
tree39e3167a4f8b7423a15b3a5f56e973554bdb3195
parent901dff07ed357694eb35284a58c3cc6c003c53ce (diff)
downloadjellything-ed19a428cb5eef84c8cf3fed5fda3afd5fc96305.tar
jellything-ed19a428cb5eef84c8cf3fed5fda3afd5fc96305.tar.bz2
jellything-ed19a428cb5eef84c8cf3fed5fda3afd5fc96305.tar.zst
Move client scripts to build-crate
-rw-r--r--.gitmodules4
-rw-r--r--Cargo.lock9
-rw-r--r--Cargo.toml1
-rw-r--r--logic/src/account.rs59
-rw-r--r--server/Cargo.toml5
-rw-r--r--server/src/ui/style.rs7
-rw-r--r--ui/client-scripts/Cargo.toml9
-rw-r--r--ui/client-scripts/build.rs (renamed from server/build.rs)5
-rw-r--r--ui/client-scripts/src/backbutton.ts (renamed from web/script/backbutton.ts)0
-rw-r--r--ui/client-scripts/src/dangerbutton.ts (renamed from web/script/dangerbutton.ts)0
-rw-r--r--ui/client-scripts/src/import_live.ts (renamed from web/script/import_live.ts)0
-rw-r--r--ui/client-scripts/src/lib.rs13
-rw-r--r--ui/client-scripts/src/log_live.ts (renamed from web/script/log_live.ts)0
-rw-r--r--ui/client-scripts/src/main.ts (renamed from web/script/main.ts)0
-rw-r--r--ui/client-scripts/src/player/download.ts (renamed from web/script/player/download.ts)0
-rw-r--r--ui/client-scripts/src/player/mediacaps.ts (renamed from web/script/player/mediacaps.ts)0
-rw-r--r--ui/client-scripts/src/player/mod.ts (renamed from web/script/player/mod.ts)0
-rw-r--r--ui/client-scripts/src/player/player.ts (renamed from web/script/player/player.ts)0
-rw-r--r--ui/client-scripts/src/player/popup.ts (renamed from web/script/player/popup.ts)0
-rw-r--r--ui/client-scripts/src/player/sync.ts (renamed from web/script/player/sync.ts)0
-rw-r--r--ui/client-scripts/src/player/track/create.ts (renamed from web/script/player/track/create.ts)0
-rw-r--r--ui/client-scripts/src/player/track/mod.ts (renamed from web/script/player/track/mod.ts)0
-rw-r--r--ui/client-scripts/src/player/track/mse.ts (renamed from web/script/player/track/mse.ts)0
-rw-r--r--ui/client-scripts/src/player/track/vtt.ts (renamed from web/script/player/track/vtt.ts)0
-rw-r--r--ui/client-scripts/src/player/types_node.ts (renamed from web/script/player/types_node.ts)0
-rw-r--r--ui/client-scripts/src/player/types_stream.ts (renamed from web/script/player/types_stream.ts)0
-rw-r--r--ui/client-scripts/src/transition.ts (renamed from web/script/transition.ts)0
m---------web/script/jshelper0
28 files changed, 34 insertions, 78 deletions
diff --git a/.gitmodules b/.gitmodules
index b6fef27..fd98708 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "web/script/jshelper"]
- path = web/script/jshelper
+[submodule "ui/client-scripts/src/jshelper"]
+ path = ui/client-scripts/src/jshelper
url = https://codeberg.org/metamuffin/jshelper.git
diff --git a/Cargo.lock b/Cargo.lock
index 3429369..f26cc91 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1940,11 +1940,9 @@ dependencies = [
"chrono",
"env_logger",
"futures",
- "glob",
"jellycache",
"jellycommon",
"jellyimport",
- "jellylogic",
"jellystream",
"jellytranscoder",
"jellyui",
@@ -2017,6 +2015,13 @@ dependencies = [
]
[[package]]
+name = "jellyui-client-scripts"
+version = "0.1.0"
+dependencies = [
+ "glob",
+]
+
+[[package]]
name = "jiff"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 86832cd..e17fdaa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,7 @@ members = [
"stream",
"stream/types",
"ui",
+ "ui/client-scripts",
"remuxer",
"common/object",
]
diff --git a/logic/src/account.rs b/logic/src/account.rs
deleted file mode 100644
index 812b7cf..0000000
--- a/logic/src/account.rs
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- This file is part of jellything (https://codeberg.org/metamuffin/jellything)
- which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
- Copyright (C) 2026 metamuffin <metamuffin.org>
-*/
-
-use crate::{DATABASE, login::hash_password, session::Session};
-use anyhow::Result;
-
-pub fn update_user_password(session: &Session, password: &str) -> Result<()> {
- DATABASE.update_user(&session.user.name, |user| {
- user.password = hash_password(&session.user.name, password);
- Ok(())
- })?;
- Ok(())
-}
-pub fn update_user_display_name(session: &Session, display_name: &str) -> Result<()> {
- DATABASE.update_user(&session.user.name, |user| {
- user.display_name = display_name.to_owned();
- Ok(())
- })?;
- Ok(())
-}
-pub fn update_user_native_secret(session: &Session, native_secret: &str) -> Result<()> {
- DATABASE.update_user(&session.user.name, |user| {
- user.native_secret = native_secret.to_owned();
- Ok(())
- })?;
- Ok(())
-}
-pub fn update_user_theme(session: &Session, theme: Theme) -> Result<()> {
- DATABASE.update_user(&session.user.name, |user| {
- user.theme = theme;
- Ok(())
- })?;
- Ok(())
-}
-pub fn update_user_player_preference(
- session: &Session,
- player_preference: PlayerKind,
-) -> Result<()> {
- DATABASE.update_user(&session.user.name, |user| {
- user.player_preference = player_preference;
- Ok(())
- })?;
- Ok(())
-}
-pub fn register_user(invitation: &str, username: &str, password: &str) -> Result<()> {
- DATABASE.register_user(
- invitation,
- username,
- User {
- display_name: username.to_owned(),
- name: username.to_owned(),
- password: hash_password(username, password),
- ..Default::default()
- },
- )
-}
diff --git a/server/Cargo.toml b/server/Cargo.toml
index 84b978a..b790291 100644
--- a/server/Cargo.toml
+++ b/server/Cargo.toml
@@ -10,7 +10,6 @@ jellytranscoder = { path = "../transcoder" }
jellyimport = { path = "../import" }
jellycache = { path = "../cache" }
jellyui = { path = "../ui" }
-jellylogic = { path = "../logic" }
anyhow = { workspace = true }
async-recursion = "1.1.1"
@@ -30,9 +29,5 @@ serde_yaml_ng = "0.10.0"
tokio = { workspace = true }
tokio-util = { version = "0.7.17", features = ["io", "io-util"] }
-[build-dependencies]
-glob = "0.3.3"
-
[features]
bypass-auth = []
-hot-css = []
diff --git a/server/src/ui/style.rs b/server/src/ui/style.rs
index 4d458c9..5226b6a 100644
--- a/server/src/ui/style.rs
+++ b/server/src/ui/style.rs
@@ -60,13 +60,6 @@ impl<'r, 'o: 'r, T: Responder<'r, 'o>> Responder<'r, 'o> for CachedAsset<T> {
}
}
-fn js_bundle() -> String {
- concat_files!([env!("OUT_DIR")], "bundle.js")
-}
-fn js_bundle_map() -> String {
- concat_files!([env!("OUT_DIR")], "bundle.js.map")
-}
-
#[get("/assets/style.css")]
pub fn r_assets_style() -> CachedAsset<(ContentType, String)> {
CachedAsset((ContentType::CSS, css_bundle()))
diff --git a/ui/client-scripts/Cargo.toml b/ui/client-scripts/Cargo.toml
new file mode 100644
index 0000000..1332388
--- /dev/null
+++ b/ui/client-scripts/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "jellyui-client-scripts"
+version = "0.1.0"
+edition = "2024"
+
+[dependencies]
+
+[build-dependencies]
+glob = "0.3.3"
diff --git a/server/build.rs b/ui/client-scripts/build.rs
index 6949c9b..256fa21 100644
--- a/server/build.rs
+++ b/ui/client-scripts/build.rs
@@ -8,7 +8,7 @@ use std::process::{Command, Stdio};
fn main() {
println!("cargo:rerun-if-changed=build.rs");
- for file in glob::glob("../web/script/**/*.ts")
+ for file in glob::glob("src/**/*.ts")
.unwrap()
.map(Result::unwrap)
{
@@ -16,9 +16,8 @@ fn main() {
}
let outpath = std::env::var("OUT_DIR").unwrap();
// this is great :)))
- println!("cargo:warning=\r\x1b[32m\x1b[1m Bundle\x1b[0m writing bundle.js ({outpath})");
let mut proc = Command::new("esbuild")
- .arg("../web/script/main.ts")
+ .arg("src/main.ts")
.arg("--bundle")
.arg(format!("--outfile={outpath}/bundle.js"))
.arg("--target=esnext")
diff --git a/web/script/backbutton.ts b/ui/client-scripts/src/backbutton.ts
index 28a889a..28a889a 100644
--- a/web/script/backbutton.ts
+++ b/ui/client-scripts/src/backbutton.ts
diff --git a/web/script/dangerbutton.ts b/ui/client-scripts/src/dangerbutton.ts
index b33b3dc..b33b3dc 100644
--- a/web/script/dangerbutton.ts
+++ b/ui/client-scripts/src/dangerbutton.ts
diff --git a/web/script/import_live.ts b/ui/client-scripts/src/import_live.ts
index 7e5209c..7e5209c 100644
--- a/web/script/import_live.ts
+++ b/ui/client-scripts/src/import_live.ts
diff --git a/ui/client-scripts/src/lib.rs b/ui/client-scripts/src/lib.rs
new file mode 100644
index 0000000..408799a
--- /dev/null
+++ b/ui/client-scripts/src/lib.rs
@@ -0,0 +1,13 @@
+/*
+ This file is part of jellything (https://codeberg.org/metamuffin/jellything)
+ which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
+ Copyright (C) 2026 metamuffin <metamuffin.org>
+*/
+use std::borrow::Cow;
+
+pub fn js_bundle() -> Cow<'static, str> {
+ include_str!(concat!(env!("OUT_DIR"), "/bundle.js")).into()
+}
+pub fn js_bundle_map() -> Cow<'static, str> {
+ include_str!(concat!(env!("OUT_DIR"), "/bundle.js.map")).into()
+}
diff --git a/web/script/log_live.ts b/ui/client-scripts/src/log_live.ts
index b8af11e..b8af11e 100644
--- a/web/script/log_live.ts
+++ b/ui/client-scripts/src/log_live.ts
diff --git a/web/script/main.ts b/ui/client-scripts/src/main.ts
index 303ac71..303ac71 100644
--- a/web/script/main.ts
+++ b/ui/client-scripts/src/main.ts
diff --git a/web/script/player/download.ts b/ui/client-scripts/src/player/download.ts
index 1c42bad..1c42bad 100644
--- a/web/script/player/download.ts
+++ b/ui/client-scripts/src/player/download.ts
diff --git a/web/script/player/mediacaps.ts b/ui/client-scripts/src/player/mediacaps.ts
index 9b0e934..9b0e934 100644
--- a/web/script/player/mediacaps.ts
+++ b/ui/client-scripts/src/player/mediacaps.ts
diff --git a/web/script/player/mod.ts b/ui/client-scripts/src/player/mod.ts
index dc9e51d..dc9e51d 100644
--- a/web/script/player/mod.ts
+++ b/ui/client-scripts/src/player/mod.ts
diff --git a/web/script/player/player.ts b/ui/client-scripts/src/player/player.ts
index 4f59f8a..4f59f8a 100644
--- a/web/script/player/player.ts
+++ b/ui/client-scripts/src/player/player.ts
diff --git a/web/script/player/popup.ts b/ui/client-scripts/src/player/popup.ts
index 2c406ba..2c406ba 100644
--- a/web/script/player/popup.ts
+++ b/ui/client-scripts/src/player/popup.ts
diff --git a/web/script/player/sync.ts b/ui/client-scripts/src/player/sync.ts
index 5f33a8e..5f33a8e 100644
--- a/web/script/player/sync.ts
+++ b/ui/client-scripts/src/player/sync.ts
diff --git a/web/script/player/track/create.ts b/ui/client-scripts/src/player/track/create.ts
index a83a26a..a83a26a 100644
--- a/web/script/player/track/create.ts
+++ b/ui/client-scripts/src/player/track/create.ts
diff --git a/web/script/player/track/mod.ts b/ui/client-scripts/src/player/track/mod.ts
index 57f6820..57f6820 100644
--- a/web/script/player/track/mod.ts
+++ b/ui/client-scripts/src/player/track/mod.ts
diff --git a/web/script/player/track/mse.ts b/ui/client-scripts/src/player/track/mse.ts
index efcd0d5..efcd0d5 100644
--- a/web/script/player/track/mse.ts
+++ b/ui/client-scripts/src/player/track/mse.ts
diff --git a/web/script/player/track/vtt.ts b/ui/client-scripts/src/player/track/vtt.ts
index 2152b97..2152b97 100644
--- a/web/script/player/track/vtt.ts
+++ b/ui/client-scripts/src/player/track/vtt.ts
diff --git a/web/script/player/types_node.ts b/ui/client-scripts/src/player/types_node.ts
index 64f01e5..64f01e5 100644
--- a/web/script/player/types_node.ts
+++ b/ui/client-scripts/src/player/types_node.ts
diff --git a/web/script/player/types_stream.ts b/ui/client-scripts/src/player/types_stream.ts
index 272f98b..272f98b 100644
--- a/web/script/player/types_stream.ts
+++ b/ui/client-scripts/src/player/types_stream.ts
diff --git a/web/script/transition.ts b/ui/client-scripts/src/transition.ts
index dadb266..dadb266 100644
--- a/web/script/transition.ts
+++ b/ui/client-scripts/src/transition.ts
diff --git a/web/script/jshelper b/web/script/jshelper
deleted file mode 160000
-Subproject 26b8e17daac3ef21d97c25e55c0812bc9e59286