From 0e896e69ab8477a998f1957cd878a1c3fb026537 Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Sat, 21 Feb 2026 15:06:00 -0600 Subject: [PATCH] [BETA] Added Source Switching & Fixed Extensions Filter --- README.md | 7 ++++++- flake.nix | 29 +++++++++++++++++++++------ src/components/pages/SeriesDetail.tsx | 2 +- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b9d4806..4e6d95f 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,14 @@ - Full manga reader with keyboard navigation - Chapter download queue - Extension and source management +- Source migration with read progress transfer +- Cross-source search - Reading history tracking ## Requirements [Suwayomi-Server](https://github.com/Suwayomi/Suwayomi-Server) must be running at `http://127.0.0.1:4567`. + > Note: The application does also launch the server on start-up by itself, so only the package is required on path. ## Installation @@ -59,9 +62,11 @@ nix build ```bash nix develop pnpm install -pnpm tauri dev +pnpm tauri:dev ``` +> `tauri:dev` uses `src-tauri/tauri.dev.conf.json` to set the Vite dev server URL, keeping the release build config clean for `nix build`. + ## Stack | | | diff --git a/flake.nix b/flake.nix index 01eaed9..9df2f32 100644 --- a/flake.nix +++ b/flake.nix @@ -51,13 +51,30 @@ gsettings-desktop-schemas ]; - # Frontend (Vite/TypeScript) built as a separate derivation. - # Update `hash` whenever pnpm-lock.yaml changes: - # nix build .#frontend 2>&1 | grep "got:" + # Only rebuild the frontend when files that actually affect the output change. + # Changing flake.nix, README.md, src-tauri/*, etc. won't invalidate the cache. + frontendSrc = lib.cleanSourceWith { + src = ./.; + filter = path: type: + let base = builtins.baseNameOf path; + in + (lib.hasInfix "/src" path) + || base == "index.html" + || base == "package.json" + || base == "pnpm-lock.yaml" + || base == "tsconfig.json" + || base == "tsconfig.node.json" + || base == "vite.config.ts" + || base == "postcss.config.js" + || base == "postcss.config.cjs" + || base == "tailwind.config.js" + || base == "tailwind.config.ts"; + }; + frontend = pkgs.stdenv.mkDerivation { pname = "moku-frontend"; version = "0.1.0"; - src = lib.cleanSource ./.; + src = frontendSrc; nativeBuildInputs = with pkgs; [ nodejs_22 @@ -68,7 +85,7 @@ pnpmDeps = pkgs.fetchPnpmDeps { pname = "moku-frontend"; version = "0.1.0"; - src = lib.cleanSource ./.; + src = frontendSrc; fetcherVersion = 1; hash = "sha256-2Hdzsjwbb+CKiRn/nGHwLeysKvpvEhd5C213YgWmOSU="; }; @@ -152,7 +169,7 @@ export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" echo "Moku dev shell" - echo " pnpm install && pnpm tauri dev" + echo " pnpm install && pnpm tauri:dev" ''; }; diff --git a/src/components/pages/SeriesDetail.tsx b/src/components/pages/SeriesDetail.tsx index ed79565..8f0b1b3 100644 --- a/src/components/pages/SeriesDetail.tsx +++ b/src/components/pages/SeriesDetail.tsx @@ -486,7 +486,7 @@ export default function SeriesDetail() { manga={manga} currentChapters={chapters} onClose={() => setMigrateOpen(false)} - onMigrated={(newManga) => { + onMigrated={(newManga: Manga) => { setMigrateOpen(false); setActiveManga(newManga); }}