Chore: Fix Nix Build (Improper)

This commit is contained in:
Youwes09
2026-06-03 21:37:34 -05:00
parent db8a984270
commit 3e4d322fb7
24 changed files with 308 additions and 275 deletions
Generated
-16
View File
@@ -1,20 +1,5 @@
{ {
"nodes": { "nodes": {
"crane": {
"locked": {
"lastModified": 1773857772,
"narHash": "sha256-5xsK26KRHf0WytBtsBnQYC/lTWDhQuT57HJ7SzuqZcM=",
"owner": "ipetkov",
"repo": "crane",
"rev": "b556d7bbae5ff86e378451511873dfd07e4504cd",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
@@ -66,7 +51,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"crane": "crane",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
+30 -37
View File
@@ -4,7 +4,6 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
crane.url = "github:ipetkov/crane";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -12,7 +11,7 @@
}; };
outputs = outputs =
inputs@{ flake-parts, crane, rust-overlay, ... }: inputs@{ flake-parts, rust-overlay, ... }:
flake-parts.lib.mkFlake { inherit inputs; } { flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
@@ -22,7 +21,8 @@
perSystem = perSystem =
{ system, lib, ... }: { system, lib, ... }:
let let
version = "0.9.4"; versions = import ./nix/versions.nix;
version = versions.moku;
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit system; inherit system;
@@ -36,8 +36,6 @@
]; ];
}; };
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
runtimeLibs = with pkgs; [ runtimeLibs = with pkgs; [
webkitgtk_4_1 webkitgtk_4_1
gtk3 gtk3
@@ -53,7 +51,7 @@
gsettings-desktop-schemas gsettings-desktop-schemas
]; ];
frontendSrc = lib.cleanSourceWith { src = lib.cleanSourceWith {
src = ./.; src = ./.;
filter = filter =
path: type: path: type:
@@ -61,51 +59,46 @@
base = builtins.baseNameOf path; base = builtins.baseNameOf path;
in in
(lib.hasInfix "/src" path) (lib.hasInfix "/src" path)
|| (lib.hasInfix "/src-tauri/src" path)
|| (lib.hasInfix "/src-tauri/icons" path)
|| (lib.hasInfix "/src-tauri/capabilities" path)
|| (lib.hasInfix "/static" path)
|| base == "index.html" || base == "index.html"
|| base == "package.json" || base == "package.json"
|| base == "pnpm-lock.yaml" || base == "pnpm-lock.yaml"
|| base == "pnpm-workspace.yaml"
|| base == "tsconfig.json" || base == "tsconfig.json"
|| base == "vite.config.ts"; || base == "vite.config.ts"
|| base == "svelte.config.js"
|| base == "Cargo.toml"
|| base == "Cargo.lock"
|| base == "build.rs"
|| base == "tauri.conf.json";
}; };
cargoSrc = lib.cleanSourceWith { suwayomiServer = pkgs.callPackage ./nix/server.nix { inherit versions; };
src = ./src-tauri;
filter = moku = pkgs.callPackage ./nix/moku.nix {
path: type: inherit lib pkgs rustToolchain runtimeLibs suwayomiServer version src versions;
(craneLib.filterCargoSources path type) appIcon = ./src/lib/assets/moku-icon.svg;
|| (lib.hasInfix "/icons/" path)
|| (lib.hasInfix "/capabilities/" path)
|| (builtins.baseNameOf path == "tauri.conf.json");
}; };
suwayomiServer = pkgs.callPackage ./nix/server.nix { }; scripts = import ./nix/scripts.nix { inherit pkgs rustToolchain version versions; };
frontend = pkgs.callPackage ./nix/frontend.nix {
inherit version;
src = frontendSrc;
};
moku = import ./nix/moku.nix {
inherit lib craneLib pkgs runtimeLibs frontend suwayomiServer version cargoSrc;
appIcon = ./src/assets/moku-icon.svg;
};
scripts = import ./nix/scripts.nix { inherit pkgs rustToolchain version; };
in in
{ {
packages = { packages = {
inherit moku frontend suwayomiServer; inherit moku suwayomiServer;
default = moku; default = moku;
}; };
apps = { apps = {
default = { type = "app"; program = "${moku}/bin/moku"; }; default = { type = "app"; program = "${moku}/bin/moku"; };
moku = { type = "app"; program = "${moku}/bin/moku"; }; moku = { type = "app"; program = "${moku}/bin/moku"; };
bump = { type = "app"; program = "${scripts.bump}/bin/moku-bump"; }; bump = { type = "app"; program = "${scripts.bump}/bin/moku-bump"; };
post-tag-bump = { type = "app"; program = "${scripts.postTagBump}/bin/moku-post-tag-bump"; }; update = { type = "app"; program = "${scripts.update}/bin/moku-update"; };
flatpak = { type = "app"; program = "${scripts.flatpak}/bin/moku-flatpak"; }; flatpak = { type = "app"; program = "${scripts.flatpak}/bin/moku-flatpak"; };
tunnel = { type = "app"; program = "${scripts.tunnel}/bin/moku-tunnel"; }; tunnel = { type = "app"; program = "${scripts.tunnel}/bin/moku-tunnel"; };
}; };
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
@@ -132,11 +125,11 @@
echo "Moku dev shell pnpm install && pnpm tauri:dev" echo "Moku dev shell pnpm install && pnpm tauri:dev"
echo "" echo ""
echo " nix run .#bump -- <ver>" echo " nix run .#bump -- <ver> bump version + rebuild frontend"
echo " git commit && git tag && git push" echo " git commit && git tag && git push"
echo " nix run .#post-tag-bump -- <ver>" echo " nix run .#update -- <ver> fetch hashes + patch all configs"
echo " nix run .#flatpak -- <ver>" echo " nix run .#flatpak build flatpak bundle"
echo " nix run .#tunnel -- [port]" echo " nix run .#tunnel -- [port] expose local server via cloudflare"
''; '';
}; };
+8 -4
View File
@@ -1,4 +1,4 @@
{ lib, stdenv, nodejs_22, pnpm, pnpmConfigHook, fetchPnpmDeps, version, src }: { lib, stdenv, nodejs_22, pnpm, pnpmConfigHook, fetchPnpmDeps, version, src, versions }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "moku-frontend"; pname = "moku-frontend";
@@ -10,9 +10,13 @@ stdenv.mkDerivation {
pname = "moku-frontend"; pname = "moku-frontend";
inherit version src; inherit version src;
fetcherVersion = 1; fetcherVersion = 1;
hash = "sha256-vM//1/qe9nKDwwlmFbqvBFqF8cCjIIdNKEtktyzBFB8="; hash = versions.frontend.pnpmHash;
}; };
buildPhase = "pnpm build"; buildPhase = ''
export HOME=$(mktemp -d)
pnpm build:static
'';
installPhase = "cp -r dist $out"; installPhase = "cp -r dist $out";
} }
+51 -26
View File
@@ -1,38 +1,61 @@
{ {
lib, lib,
craneLib,
pkgs, pkgs,
rustToolchain,
runtimeLibs, runtimeLibs,
frontend,
suwayomiServer, suwayomiServer,
version, version,
cargoSrc, versions,
src,
appIcon, appIcon,
}: }:
let pkgs.stdenv.mkDerivation {
commonArgs = { pname = "moku";
src = cargoSrc; inherit version src;
nativeBuildInputs = with pkgs; [
rustToolchain
nodejs_22
pnpm
pnpmConfigHook
pkg-config
wrapGAppsHook3
rustPlatform.cargoSetupHook
];
buildInputs = runtimeLibs;
pnpmDeps = pkgs.fetchPnpmDeps {
pname = "moku"; pname = "moku";
inherit version; inherit version src;
strictDeps = true; fetcherVersion = 1;
buildInputs = runtimeLibs; hash = versions.frontend.pnpmHash;
nativeBuildInputs = with pkgs; [ pkg-config wrapGAppsHook3 ];
preBuild = ''
cp -r ${frontend} ../dist
'';
}; };
cargoArtifacts = craneLib.buildDepsOnly commonArgs; cargoDeps = pkgs.rustPlatform.importCargoLock {
in lockFile = ../src-tauri/Cargo.lock;
craneLib.buildPackage (commonArgs // { outputHashes = {
inherit cargoArtifacts; "tauri-plugin-discord-rpc-0.1.0" = versions.gitDeps.tauri-plugin-discord-rpc;
};
};
meta.mainProgram = "moku"; env = {
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
TAURI_SKIP_DEVSERVER_CHECK = "true";
cargoRoot = "src-tauri";
};
buildPhase = ''
export HOME=$(mktemp -d)
pnpm tauri:build
'';
installPhase = ''
install -Dm755 src-tauri/target/release/moku $out/bin/moku
postInstall = ''
mkdir -p "$out/share/applications" mkdir -p "$out/share/applications"
cat > "$out/share/applications/moku.desktop" << EOF cat > "$out/share/applications/moku.desktop" << EOF2
[Desktop Entry] [Desktop Entry]
Version=1.0 Version=1.0
Type=Application Type=Application
@@ -44,17 +67,17 @@ Terminal=false
Categories=Graphics;Viewer; Categories=Graphics;Viewer;
Keywords=manga;comic;reader;suwayomi; Keywords=manga;comic;reader;suwayomi;
StartupWMClass=moku StartupWMClass=moku
EOF EOF2
for size in 32x32 128x128 256x256 512x512; do for size in 32x32 128x128 256x256 512x512; do
src="icons/$size.png" f="src-tauri/icons/$size.png"
[ -f "$src" ] && install -Dm644 "$src" \ [ -f "$f" ] && install -Dm644 "$f" \
"$out/share/icons/hicolor/$size/apps/moku.png" "$out/share/icons/hicolor/$size/apps/moku.png"
done done
for size in 128x128 256x256; do for size in 128x128 256x256; do
src="icons/''${size}@2x.png" f="src-tauri/icons/''${size}@2x.png"
[ -f "$src" ] && install -Dm644 "$src" \ [ -f "$f" ] && install -Dm644 "$f" \
"$out/share/icons/hicolor/''${size}@2/apps/moku.png" "$out/share/icons/hicolor/''${size}@2/apps/moku.png"
done done
@@ -71,4 +94,6 @@ EOF
--set GDK_BACKEND wayland \ --set GDK_BACKEND wayland \
--set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS 1 --set WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS 1
''; '';
})
meta.mainProgram = "moku";
}
+68 -61
View File
@@ -1,4 +1,4 @@
{ pkgs, rustToolchain, version }: { pkgs, rustToolchain, version, versions }:
{ {
bump = pkgs.writeShellApplication { bump = pkgs.writeShellApplication {
@@ -17,87 +17,98 @@
VERSION="$1" VERSION="$1"
REPO="$(git rev-parse --show-toplevel)" REPO="$(git rev-parse --show-toplevel)"
echo " Bumping version fields to $VERSION " sed -i "s/moku = \"[^\"]*\"/moku = \"$VERSION\"/" "$REPO/nix/versions.nix"
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" \ sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" "$REPO/src-tauri/tauri.conf.json"
"$REPO/src-tauri/tauri.conf.json" sed -i "0,/^version = \"[^\"]*\"/s//version = \"$VERSION\"/" "$REPO/src-tauri/Cargo.toml"
sed -i "0,/^version = \"[^\"]*\"/s//version = \"$VERSION\"/" \
"$REPO/src-tauri/Cargo.toml"
sed -i "s/version = \"[^\"]*\";/version = \"$VERSION\";/g" \
"$REPO/flake.nix"
sed -i "s/^pkgver=.*/pkgver=$VERSION/" "$REPO/PKGBUILD" sed -i "s/^pkgver=.*/pkgver=$VERSION/" "$REPO/PKGBUILD"
sed -i "s/^pkgrel=.*/pkgrel=1/" "$REPO/PKGBUILD" sed -i "s/^pkgrel=.*/pkgrel=1/" "$REPO/PKGBUILD"
echo "Done"
echo " Regenerating Cargo.lock "
(cd "$REPO/src-tauri" && cargo generate-lockfile) (cd "$REPO/src-tauri" && cargo generate-lockfile)
echo "Done"
echo " Building frontend "
cd "$REPO" cd "$REPO"
pnpm install --frozen-lockfile pnpm install --frozen-lockfile
pnpm build pnpm build:static
echo "Done"
echo " Repacking frontend-dist.tar.gz "
tar -czf "$REPO/packaging/frontend-dist.tar.gz" -C "$REPO" dist tar -czf "$REPO/packaging/frontend-dist.tar.gz" -C "$REPO" dist
FRONTEND_SHA=$(sha256sum "$REPO/packaging/frontend-dist.tar.gz" | awk '{print $1}') FRONTEND_SHA_HEX=$(sha256sum "$REPO/packaging/frontend-dist.tar.gz" | awk '{print $1}')
echo "sha256: $FRONTEND_SHA" FRONTEND_SHA_SRI=$(echo "$FRONTEND_SHA_HEX" | xxd -r -p | base64 -w0 | sed 's/^/sha256-/')
sed -i "s|distHash = \"[^\"]*\"|distHash = \"$FRONTEND_SHA_HEX\"|" "$REPO/nix/versions.nix"
sed -i "s|distHashSri = \"[^\"]*\"|distHashSri = \"$FRONTEND_SHA_SRI\"|" "$REPO/nix/versions.nix"
MANIFEST="$REPO/io.github.moku_project.Moku.yml"
sed -i "s/tag: v[^[:space:]]*/tag: v$VERSION/" "$MANIFEST"
python3 - "$MANIFEST" "$FRONTEND_SHA_HEX" <<'PYEOF'
import re, sys
path, sha = sys.argv[1], sys.argv[2]
text = open(path).read()
updated, n = re.subn(
r'(path:\s*packaging/frontend-dist\.tar\.gz\s*\n\s*sha256:\s*)[0-9a-f]+',
r'\g<1>' + sha, text)
if n == 0:
sys.exit("ERROR: could not find frontend-dist sha256 in manifest")
open(path, 'w').write(updated)
PYEOF
echo " Regenerating cargo-sources.json "
python3 "$REPO/packaging/flatpak-cargo-generator.py" \ python3 "$REPO/packaging/flatpak-cargo-generator.py" \
"$REPO/src-tauri/Cargo.lock" \ "$REPO/src-tauri/Cargo.lock" \
-o "$REPO/packaging/cargo-sources.json" -o "$REPO/packaging/cargo-sources.json"
echo "Done"
echo " Patching flatpak manifest " echo "Bumped to v$VERSION commit, tag, push, then: nix run .#update -- $VERSION"
MANIFEST="$REPO/io.github.moku_project.Moku.yml"
sed -i "s/tag: v[^[:space:]]*/tag: v$VERSION/" "$MANIFEST"
python3 - "$MANIFEST" "$FRONTEND_SHA" <<'PYEOF'
import re, sys
path, sha = sys.argv[1], sys.argv[2]
text = open(path).read()
updated, n = re.subn(
r'(path:\s*packaging/frontend-dist\.tar\.gz\s*\n\s*sha256:\s*)[0-9a-f]+',
r'\g<1>' + sha, text)
if n == 0:
sys.exit("ERROR: could not find frontend-dist sha256 in manifest")
open(path, 'w').write(updated)
PYEOF
echo "Done"
echo ""
echo "Bumped to v$VERSION commit, tag, push, then: nix run .#post-tag-bump -- $VERSION"
''; '';
}; };
postTagBump = pkgs.writeShellApplication { update = pkgs.writeShellApplication {
name = "moku-post-tag-bump"; name = "moku-update";
runtimeInputs = with pkgs; [ gnused coreutils git curl ]; runtimeInputs = with pkgs; [ gnused coreutils git curl nix xxd ];
text = '' text = ''
[[ $# -lt 1 ]] && { echo "Usage: nix run .#post-tag-bump -- <version>"; exit 1; }
VERSION="$1"
REPO="$(git rev-parse --show-toplevel)" REPO="$(git rev-parse --show-toplevel)"
VERSIONS="$REPO/nix/versions.nix"
MANIFEST="$REPO/io.github.moku_project.Moku.yml" MANIFEST="$REPO/io.github.moku_project.Moku.yml"
PKGBUILD="$REPO/PKGBUILD" PKGBUILD="$REPO/PKGBUILD"
echo " Resolving commit for v$VERSION " if [[ $# -ge 1 ]]; then
COMMIT=$(git ls-remote https://github.com/moku-project/Moku.git "refs/tags/v$VERSION" \ VERSION="$1"
| awk '{print $1}') else
[[ -z "$COMMIT" ]] && { echo "ERROR: tag v$VERSION not found on remote"; exit 1; } VERSION=$(grep 'moku = "' "$VERSIONS" | head -1 | sed 's/.*"\(.*\)".*/\1/')
echo "commit: $COMMIT" fi
sed -i "s/commit: [0-9a-f]\{40\}/commit: $COMMIT/" "$MANIFEST"
echo "Done" COMMIT=$(git ls-remote https://github.com/moku-project/Moku.git "refs/tags/v$VERSION" | awk '{print $1}')
[[ -z "$COMMIT" ]] && { echo "ERROR: tag v$VERSION not found on remote"; exit 1; }
sed -i "s/gitCommit = \"[^\"]*\"/gitCommit = \"$COMMIT\"/" "$VERSIONS"
sed -i "s/commit: [0-9a-f]\{40\}/commit: $COMMIT/" "$MANIFEST"
echo " Fetching PKGBUILD tarball sha256 "
TARBALL_URL="https://github.com/moku-project/Moku/archive/refs/tags/v$VERSION.tar.gz" TARBALL_URL="https://github.com/moku-project/Moku/archive/refs/tags/v$VERSION.tar.gz"
TARBALL_SHA=$(curl -fsSL "$TARBALL_URL" | sha256sum | awk '{print $1}') TARBALL_SHA=$(curl -fsSL "$TARBALL_URL" | sha256sum | awk '{print $1}')
sed -i "s/tarballHash = \"[^\"]*\"/tarballHash = \"$TARBALL_SHA\"/" "$VERSIONS"
sed -i "/sha256sums=/,/)/{ 0,/'/s/'[^']*'/'$TARBALL_SHA'/ }" "$PKGBUILD" sed -i "/sha256sums=/,/)/{ 0,/'/s/'[^']*'/'$TARBALL_SHA'/ }" "$PKGBUILD"
grep -q "$TARBALL_SHA" "$PKGBUILD" \
|| { echo "ERROR: PKGBUILD sha256 replacement failed"; exit 1; }
echo "Done"
echo "" if [[ $# -ge 2 ]]; then
echo "post-tag-bump complete for v$VERSION" SUWA_VER="$2"
JAR_URL="https://github.com/Suwayomi/Suwayomi-Server-preview/releases/download/v${SUWA_VER}/Suwayomi-Server-v${SUWA_VER}.jar"
SUWA_SHA_HEX=$(curl -fsSL "$JAR_URL" | sha256sum | awk '{print $1}')
SUWA_SHA_SRI=$(echo "$SUWA_SHA_HEX" | xxd -r -p | base64 -w0 | sed 's/^/sha256-/')
sed -i "s/version = \"[^\"]*\"/version = \"$SUWA_VER\"/" "$VERSIONS"
sed -i "s|hash = \"sha256-[^\"]*\"|hash = \"$SUWA_SHA_SRI\"|" "$VERSIONS"
sed -i "s|Suwayomi-Server-preview/releases/download/v[^/]*/|Suwayomi-Server-preview/releases/download/v${SUWA_VER}/|" "$MANIFEST"
sed -i "s|Suwayomi-Server-v[0-9.]*\.jar|Suwayomi-Server-v${SUWA_VER}.jar|g" "$MANIFEST"
python3 - "$MANIFEST" "$SUWA_SHA_HEX" <<'PYEOF'
import re, sys
path, sha = sys.argv[1], sys.argv[2]
text = open(path).read()
updated, n = re.subn(
r'(dest-filename:\s*Suwayomi-Server\.jar\s*\n\s*sha256:\s*)[0-9a-f]+',
r'\g<1>' + sha, text)
if n == 0:
sys.exit("ERROR: could not find Suwayomi jar sha256 in manifest")
open(path, 'w').write(updated)
PYEOF
fi
echo "Done versions.nix, flatpak manifest, and PKGBUILD patched for v$VERSION"
''; '';
}; };
@@ -105,19 +116,15 @@
name = "moku-flatpak"; name = "moku-flatpak";
runtimeInputs = with pkgs; [ coreutils git appstream flatpak-builder flatpak ]; runtimeInputs = with pkgs; [ coreutils git appstream flatpak-builder flatpak ];
text = '' text = ''
[[ $# -lt 1 ]] && { echo "Usage: nix run .#flatpak -- <version>"; exit 1; }
REPO="$(git rev-parse --show-toplevel)" REPO="$(git rev-parse --show-toplevel)"
MANIFEST="$REPO/io.github.moku_project.Moku.yml"
rm -rf "$REPO/build-dir" "$REPO/repo" rm -rf "$REPO/build-dir" "$REPO/repo"
flatpak-builder \ flatpak-builder \
--repo="$REPO/repo" \ --repo="$REPO/repo" \
--force-clean \ --force-clean \
"$REPO/build-dir" \ "$REPO/build-dir" \
"$MANIFEST" "$REPO/io.github.moku_project.Moku.yml"
flatpak build-bundle "$REPO/repo" "$REPO/moku.flatpak" io.github.moku_project.Moku flatpak build-bundle "$REPO/repo" "$REPO/moku.flatpak" io.github.moku_project.Moku
rm -rf "$REPO/build-dir" "$REPO/repo" rm -rf "$REPO/build-dir" "$REPO/repo"
echo "moku.flatpak created" echo "moku.flatpak created"
''; '';
}; };
+8 -6
View File
@@ -4,17 +4,19 @@
fetchurl, fetchurl,
makeWrapper, makeWrapper,
jdk21_headless, jdk21_headless,
versions,
}: }:
let let
jdk = jdk21_headless; jdk = jdk21_headless;
ver = versions.suwayomi;
in in
stdenvNoCC.mkDerivation (finalAttrs: { stdenvNoCC.mkDerivation {
pname = "suwayomi-server"; pname = "suwayomi-server";
version = "2.1.2087"; version = ver.version;
src = fetchurl { src = fetchurl {
url = "https://github.com/Suwayomi/Suwayomi-Server-preview/releases/download/v${finalAttrs.version}/Suwayomi-Server-v${finalAttrs.version}.jar"; url = "https://github.com/Suwayomi/Suwayomi-Server-preview/releases/download/v${ver.version}/Suwayomi-Server-v${ver.version}.jar";
hash = "sha256-9YmkImdCUjlME7KJqci+aRkFv1g++39NXxUBrl6R5rM="; hash = ver.hash;
}; };
nativeBuildInputs = [ makeWrapper ]; nativeBuildInputs = [ makeWrapper ];
@@ -37,10 +39,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
description = "Free and open source manga reader server that runs extensions built for Mihon (Tachiyomi)"; description = "Free and open source manga reader server that runs extensions built for Mihon (Tachiyomi)";
homepage = "https://github.com/Suwayomi/Suwayomi-Server"; homepage = "https://github.com/Suwayomi/Suwayomi-Server";
downloadPage = "https://github.com/Suwayomi/Suwayomi-Server-preview/releases"; downloadPage = "https://github.com/Suwayomi/Suwayomi-Server-preview/releases";
changelog = "https://github.com/Suwayomi/Suwayomi-Server-preview/releases/tag/v${finalAttrs.version}"; changelog = "https://github.com/Suwayomi/Suwayomi-Server-preview/releases/tag/v${ver.version}";
license = lib.licenses.mpl20; license = lib.licenses.mpl20;
platforms = jdk.meta.platforms; platforms = jdk.meta.platforms;
sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
mainProgram = "suwayomi-server"; mainProgram = "suwayomi-server";
}; };
}) }
+21
View File
@@ -0,0 +1,21 @@
{
moku = "0.9.4";
suwayomi = {
version = "2.1.2087";
hash = "sha256-9YmkImdCUjlME7KJqci+aRkFv1g++39NXxUBrl6R5rM=";
};
frontend = {
pnpmHash = "sha256-8bkwONUrr+U2OXYXvcsGytKhcImnehu+2bI/hmoFjJ4=";
distHash = "7db288b4b54277aa82b6ec5b21fc31a1e71f8246c50a74777500083b806c1fa5";
distHashSri = "sha256-fbiiu0tCd6qCtu+SIfw+aR8Yj2bFCnR3dQAIO4BvwfM=";
};
gitDeps = {
tauri-plugin-discord-rpc = "sha256-xq0qyK2NrwSAFDhXo0vbvcygRD2/7uqBaLpqfpfxkrc=";
};
gitCommit = "239960683b6c7f1347e1798b0e179a8a46628728";
tarballHash = "";
}
-1
View File
@@ -11,7 +11,6 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"build:static": "MOKU_TARGET=static vite build", "build:static": "MOKU_TARGET=static vite build",
"build:node": "MOKU_TARGET=node vite build", "build:node": "MOKU_TARGET=node vite build",
"build:tauri": "MOKU_TARGET=static vite build",
"build:android": "MOKU_TARGET=static vite build", "build:android": "MOKU_TARGET=static vite build",
"tauri:dev": "tauri dev --config src-tauri/tauri.dev.conf.json", "tauri:dev": "tauri dev --config src-tauri/tauri.dev.conf.json",
"tauri:build": "tauri build" "tauri:build": "tauri build"
+1 -1
View File
@@ -6,7 +6,7 @@
"build": { "build": {
"devUrl": "http://localhost:1420", "devUrl": "http://localhost:1420",
"frontendDist": "../dist", "frontendDist": "../dist",
"beforeBuildCommand": "pnpm build" "beforeBuildCommand": "pnpm build:static"
}, },
"app": { "app": {
"windows": [ "windows": [
-22
View File
@@ -1,22 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" fill="#091209"/>
<g transform="translate(256,265) rotate(7) scale(0.098,-0.098) translate(-5000,-4800)" fill="#2d7a5f" stroke="none">
<path d="M4908 6615 c-597 -629 -935 -1264 -934 -1755 0 -508 195 -778 790
-1098 l194 -104 22 -114 c33 -164 76 -271 140 -347 80 -94 106 -62 77 94 -47
255 43 443 294 613 797 539 714 1392 -250 2551 -230 278 -224 275 -333 160z
m52 -945 c0 -472 -8 -850 -17 -850 -36 0 -693 703 -692 740 2 48 167 321 309
509 175 233 359 451 380 451 13 0 20 -304 20 -850z m183 775 c120 -126 357
-447 356 -482 0 -18 -47 -83 -105 -144 -57 -61 -151 -163 -208 -225 -151 -166
-146 -180 -146 406 0 286 7 520 16 520 9 0 48 -34 87 -75z m541 -750 c86 -150
196 -391 196 -430 0 -8 -25 -42 -55 -75 -31 -33 -149 -163 -264 -290 -339
-374 -480 -520 -501 -520 -13 0 -20 167 -20 465 l1 465 151 170 c83 94 193
217 244 275 122 138 137 135 248 -60z m-1098 -633 l374 -378 0 -462 c0 -254
-5 -462 -11 -462 -6 0 -55 23 -110 50 l-99 51 0 208 c0 259 -11 288 -176 457
-196 200 -188 199 -326 62 l-117 -116 -35 79 c-71 161 -39 569 64 816 42 100
20 116 436 -305z m1349 23 c109 -390 -87 -848 -475 -1111 -207 -139 -305 -262
-338 -420 -7 -31 -21 -56 -32 -56 -36 -1 -46 86 -48 405 l-2 313 123 137 c68
75 214 236 325 357 454 493 421 466 447 375z m-1292 -785 c12 -29 15 -118 7
-215 l-14 -166 -73 44 c-174 104 -403 341 -403 416 0 15 47 70 105 123 l104
98 127 -125 c70 -69 136 -147 147 -175z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

-21
View File
@@ -1,21 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<g transform="translate(256,265) rotate(7) scale(0.098,-0.098) translate(-5000,-4800)" fill="#2d7a5f" stroke="none">
<path d="M4908 6615 c-597 -629 -935 -1264 -934 -1755 0 -508 195 -778 790
-1098 l194 -104 22 -114 c33 -164 76 -271 140 -347 80 -94 106 -62 77 94 -47
255 43 443 294 613 797 539 714 1392 -250 2551 -230 278 -224 275 -333 160z
m52 -945 c0 -472 -8 -850 -17 -850 -36 0 -693 703 -692 740 2 48 167 321 309
509 175 233 359 451 380 451 13 0 20 -304 20 -850z m183 775 c120 -126 357
-447 356 -482 0 -18 -47 -83 -105 -144 -57 -61 -151 -163 -208 -225 -151 -166
-146 -180 -146 406 0 286 7 520 16 520 9 0 48 -34 87 -75z m541 -750 c86 -150
196 -391 196 -430 0 -8 -25 -42 -55 -75 -31 -33 -149 -163 -264 -290 -339
-374 -480 -520 -501 -520 -13 0 -20 167 -20 465 l1 465 151 170 c83 94 193
217 244 275 122 138 137 135 248 -60z m-1098 -633 l374 -378 0 -462 c0 -254
-5 -462 -11 -462 -6 0 -55 23 -110 50 l-99 51 0 208 c0 259 -11 288 -176 457
-196 200 -188 199 -326 62 l-117 -116 -35 79 c-71 161 -39 569 64 816 42 100
20 116 436 -305z m1349 23 c109 -390 -87 -848 -475 -1111 -207 -139 -305 -262
-338 -420 -7 -31 -21 -56 -32 -56 -36 -1 -46 86 -48 405 l-2 313 123 137 c68
75 214 236 325 357 454 493 421 466 447 375z m-1292 -785 c12 -29 15 -118 7
-215 l-14 -166 -73 44 c-174 104 -403 341 -403 416 0 15 47 70 105 123 l104
98 127 -125 c70 -69 136 -147 147 -175z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

-21
View File
@@ -1,21 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<g transform="translate(256,265) scale(0.098,-0.098) translate(-5000,-4800)" fill="#2d7a5f" stroke="none">
<path d="M4908 6615 c-597 -629 -935 -1264 -934 -1755 0 -508 195 -778 790
-1098 l194 -104 22 -114 c33 -164 76 -271 140 -347 80 -94 106 -62 77 94 -47
255 43 443 294 613 797 539 714 1392 -250 2551 -230 278 -224 275 -333 160z
m52 -945 c0 -472 -8 -850 -17 -850 -36 0 -693 703 -692 740 2 48 167 321 309
509 175 233 359 451 380 451 13 0 20 -304 20 -850z m183 775 c120 -126 357
-447 356 -482 0 -18 -47 -83 -105 -144 -57 -61 -151 -163 -208 -225 -151 -166
-146 -180 -146 406 0 286 7 520 16 520 9 0 48 -34 87 -75z m541 -750 c86 -150
196 -391 196 -430 0 -8 -25 -42 -55 -75 -31 -33 -149 -163 -264 -290 -339
-374 -480 -520 -501 -520 -13 0 -20 167 -20 465 l1 465 151 170 c83 94 193
217 244 275 122 138 137 135 248 -60z m-1098 -633 l374 -378 0 -462 c0 -254
-5 -462 -11 -462 -6 0 -55 23 -110 50 l-99 51 0 208 c0 259 -11 288 -176 457
-196 200 -188 199 -326 62 l-117 -116 -35 79 c-71 161 -39 569 64 816 42 100
20 116 436 -305z m1349 23 c109 -390 -87 -848 -475 -1111 -207 -139 -305 -262
-338 -420 -7 -31 -21 -56 -32 -56 -36 -1 -46 86 -48 405 l-2 313 123 137 c68
75 214 236 325 357 454 493 421 466 447 375z m-1292 -785 c12 -29 15 -118 7
-215 l-14 -166 -73 44 c-174 104 -403 341 -403 416 0 15 47 70 105 123 l104
98 127 -125 c70 -69 136 -147 147 -175z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

-22
View File
@@ -1,22 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="112" ry="112" fill="#091209"/>
<g transform="translate(256,265) rotate(7) scale(0.098,-0.098) translate(-5000,-4800)" fill="#2d7a5f" stroke="none">
<path d="M4908 6615 c-597 -629 -935 -1264 -934 -1755 0 -508 195 -778 790
-1098 l194 -104 22 -114 c33 -164 76 -271 140 -347 80 -94 106 -62 77 94 -47
255 43 443 294 613 797 539 714 1392 -250 2551 -230 278 -224 275 -333 160z
m52 -945 c0 -472 -8 -850 -17 -850 -36 0 -693 703 -692 740 2 48 167 321 309
509 175 233 359 451 380 451 13 0 20 -304 20 -850z m183 775 c120 -126 357
-447 356 -482 0 -18 -47 -83 -105 -144 -57 -61 -151 -163 -208 -225 -151 -166
-146 -180 -146 406 0 286 7 520 16 520 9 0 48 -34 87 -75z m541 -750 c86 -150
196 -391 196 -430 0 -8 -25 -42 -55 -75 -31 -33 -149 -163 -264 -290 -339
-374 -480 -520 -501 -520 -13 0 -20 167 -20 465 l1 465 151 170 c83 94 193
217 244 275 122 138 137 135 248 -60z m-1098 -633 l374 -378 0 -462 c0 -254
-5 -462 -11 -462 -6 0 -55 23 -110 50 l-99 51 0 208 c0 259 -11 288 -176 457
-196 200 -188 199 -326 62 l-117 -116 -35 79 c-71 161 -39 569 64 816 42 100
20 116 436 -305z m1349 23 c109 -390 -87 -848 -475 -1111 -207 -139 -305 -262
-338 -420 -7 -31 -21 -56 -32 -56 -36 -1 -46 86 -48 405 l-2 313 123 137 c68
75 214 236 325 357 454 493 421 466 447 375z m-1292 -785 c12 -29 15 -118 7
-215 l-14 -166 -73 44 c-174 104 -403 341 -403 416 0 15 47 70 105 123 l104
98 127 -125 c70 -69 136 -147 147 -175z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

+12 -2
View File
@@ -25,11 +25,11 @@ async function resolveServerAdapter() {
async function boot() { async function boot() {
try { try {
const platformAdapter = detectAdapter() const platformAdapter = detectAdapter()
initPlatformService(platformAdapter)
await platformAdapter.init() await platformAdapter.init()
const serverAdapter = await resolveServerAdapter() const serverAdapter = await resolveServerAdapter()
initPlatformService(platformAdapter)
initRequestManager(serverAdapter) initRequestManager(serverAdapter)
appState.platform = platformAdapter.platform appState.platform = platformAdapter.platform
@@ -53,6 +53,8 @@ async function boot() {
appState.serverUrl = savedUrl appState.serverUrl = savedUrl
appState.authMode = savedAuth.mode appState.authMode = savedAuth.mode
appState.authUser = savedAuth.user ?? ''
appState.authPass = savedAuth.pass ?? ''
configureAuth(savedUrl, savedAuth.mode, savedAuth.user, savedAuth.pass) configureAuth(savedUrl, savedAuth.mode, savedAuth.user, savedAuth.pass)
@@ -64,6 +66,14 @@ async function boot() {
: undefined, : undefined,
}) })
const isTauri = platformAdapter.platform === 'tauri'
const autoStartServer = settingsData.settings.autoStartServer ?? false
if (isTauri && autoStartServer) {
appState.status = 'booting'
return
}
const probe = await probeServer() const probe = await probeServer()
if (probe === 'auth_required') { appState.status = 'auth'; return } if (probe === 'auth_required') { appState.status = 'auth'; return }
-22
View File
@@ -1,22 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="112" ry="112" fill="#091209"/>
<g transform="translate(256,265) rotate(7) scale(0.098,-0.098) translate(-5000,-4800)" fill="#2d7a5f" stroke="none">
<path d="M4908 6615 c-597 -629 -935 -1264 -934 -1755 0 -508 195 -778 790
-1098 l194 -104 22 -114 c33 -164 76 -271 140 -347 80 -94 106 -62 77 94 -47
255 43 443 294 613 797 539 714 1392 -250 2551 -230 278 -224 275 -333 160z
m52 -945 c0 -472 -8 -850 -17 -850 -36 0 -693 703 -692 740 2 48 167 321 309
509 175 233 359 451 380 451 13 0 20 -304 20 -850z m183 775 c120 -126 357
-447 356 -482 0 -18 -47 -83 -105 -144 -57 -61 -151 -163 -208 -225 -151 -166
-146 -180 -146 406 0 286 7 520 16 520 9 0 48 -34 87 -75z m541 -750 c86 -150
196 -391 196 -430 0 -8 -25 -42 -55 -75 -31 -33 -149 -163 -264 -290 -339
-374 -480 -520 -501 -520 -13 0 -20 167 -20 465 l1 465 151 170 c83 94 193
217 244 275 122 138 137 135 248 -60z m-1098 -633 l374 -378 0 -462 c0 -254
-5 -462 -11 -462 -6 0 -55 23 -110 50 l-99 51 0 208 c0 259 -11 288 -176 457
-196 200 -188 199 -326 62 l-117 -116 -35 79 c-71 161 -39 569 64 816 42 100
20 116 436 -305z m1349 23 c109 -390 -87 -848 -475 -1111 -207 -139 -305 -262
-338 -420 -7 -31 -21 -56 -32 -56 -36 -1 -46 86 -48 405 l-2 313 123 137 c68
75 214 236 325 357 454 493 421 466 447 375z m-1292 -785 c12 -29 15 -118 7
-215 l-14 -166 -73 44 c-174 104 -403 341 -403 416 0 15 47 70 105 123 l104
98 127 -125 c70 -69 136 -147 147 -175z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

@@ -155,6 +155,9 @@
</button> </button>
{/if} {/if}
</div> </div>
<div class="s-row">
<div class="s-row-info"><span class="s-label">Platform</span><span class="s-desc">{platformService.platform}</span></div>
</div>
{#if onLatestVersion} {#if onLatestVersion}
<div class="s-row"> <div class="s-row">
<span class="s-desc" style="color:var(--accent-fg)">✓ You're on the latest version.</span> <span class="s-desc" style="color:var(--accent-fg)">✓ You're on the latest version.</span>
+2
View File
@@ -4,6 +4,7 @@ import * as chapters from "./chapters";
import * as downloads from "./downloads"; import * as downloads from "./downloads";
import * as manga from "./manga"; import * as manga from "./manga";
import * as tracking from "./tracking"; import * as tracking from "./tracking";
import * as meta from "./meta";
let adapter: ServerAdapter; let adapter: ServerAdapter;
@@ -21,6 +22,7 @@ export function clearPageCache(chapterId?: number): void {
} }
export const requestManager = { export const requestManager = {
meta,
extensions, extensions,
chapters, chapters,
downloads, downloads,
+9
View File
@@ -0,0 +1,9 @@
import { getAdapter } from "$lib/request-manager";
export async function getAboutServer() {
return getAdapter().getAboutServer();
}
export async function getAboutWebUI() {
return getAdapter().getAboutWebUI();
}
+16
View File
@@ -14,6 +14,8 @@ import type {
SetSocksProxyInput, SetSocksProxyInput,
SetFlareSolverrInput, SetFlareSolverrInput,
TrackRecordPatch, TrackRecordPatch,
AboutServer,
AboutWebUI,
} from '$lib/server-adapters/types' } from '$lib/server-adapters/types'
import type { DownloadStatus } from '$lib/types/api' import type { DownloadStatus } from '$lib/types/api'
import type { Manga, Chapter, Extension, Source, Tracker, TrackRecord, Category } from '$lib/types' import type { Manga, Chapter, Extension, Source, Tracker, TrackRecord, Category } from '$lib/types'
@@ -84,6 +86,10 @@ import {
TRACK_PROGRESS, TRACK_PROGRESS,
UPDATE_TRACK, UPDATE_TRACK,
} from './tracking' } from './tracking'
import {
GET_ABOUT_SERVER,
GET_ABOUT_WEBUI,
} from './meta'
import { import {
type GQLResponse, type GQLResponse,
mapManga, mapManga,
@@ -205,6 +211,16 @@ export class SuwayomiAdapter implements ServerAdapter {
return json.data return json.data
} }
async getAboutServer(): Promise<AboutServer> {
const data = await this.gql<{ aboutServer: AboutServer }>(GET_ABOUT_SERVER)
return data.aboutServer
}
async getAboutWebUI(): Promise<AboutWebUI> {
const data = await this.gql<{ aboutWebUI: AboutWebUI }>(GET_ABOUT_WEBUI)
return data.aboutWebUI
}
async getManga(id: string): Promise<Manga> { async getManga(id: string): Promise<Manga> {
const data = await this.gql<{ manga: Record<string, unknown> }>(GET_MANGA, { id: Number(id) }) const data = await this.gql<{ manga: Record<string, unknown> }>(GET_MANGA, { id: Number(id) })
return mapManga(data.manga) return mapManga(data.manga)
+39
View File
@@ -0,0 +1,39 @@
export const GET_ABOUT_SERVER = `
query GetAboutServer {
aboutServer {
name version buildType buildTime github discord
}
}
`
export const GET_ABOUT_WEBUI = `
query GetAboutWebUI {
aboutWebUI {
channel tag updateTimestamp
}
}
`
export const CHECK_FOR_SERVER_UPDATES = `
query CheckForServerUpdates {
checkForServerUpdates {
channel tag url
}
}
`
export const GET_META = `
query GetMeta($key: String!) {
meta(key: $key) {
key value
}
}
`
export const GET_METAS = `
query GetMetas {
metas {
nodes { key value }
}
}
`
+18
View File
@@ -43,6 +43,21 @@ export interface Page {
imageData?: string imageData?: string
} }
export interface AboutServer {
name: string
version: string
buildType: string
buildTime: number
github: string
discord: string
}
export interface AboutWebUI {
channel: string
tag: string
updateTimestamp: number
}
export interface DownloadItem { export interface DownloadItem {
chapterId: string chapterId: string
mangaId: string mangaId: string
@@ -140,6 +155,9 @@ export interface ServerAdapter {
setChapterMeta(chapterId: string, key: string, value: string): Promise<void> setChapterMeta(chapterId: string, key: string, value: string): Promise<void>
deleteChapterMeta(chapterId: string, key: string): Promise<void> deleteChapterMeta(chapterId: string, key: string): Promise<void>
getAboutServer(): Promise<AboutServer>
getAboutWebUI(): Promise<AboutWebUI>
getDownloads(): Promise<DownloadItem[]> getDownloads(): Promise<DownloadItem[]>
getDownloadStatus(): Promise<DownloadStatus> getDownloadStatus(): Promise<DownloadStatus>
enqueueDownload(chapterId: string): Promise<void> enqueueDownload(chapterId: string): Promise<void>
+5 -4
View File
@@ -4,8 +4,8 @@ import { platformService } from '$lib/platform-service'
import { probeServer, loginBasic, loginUI } from '$lib/core/auth' import { probeServer, loginBasic, loginUI } from '$lib/core/auth'
import { appState } from '$lib/state/app.svelte' import { appState } from '$lib/state/app.svelte'
const MAX_ATTEMPTS = 15 const MAX_ATTEMPTS = 40
const BG_MAX_ATTEMPTS = 60 const BG_MAX_ATTEMPTS = 120
export const boot = $state({ export const boot = $state({
failed: false, failed: false,
@@ -70,6 +70,7 @@ export function startProbe(
authMode: 'NONE' | 'BASIC_AUTH' | 'UI_LOGIN' = 'NONE', authMode: 'NONE' | 'BASIC_AUTH' | 'UI_LOGIN' = 'NONE',
user = '', user = '',
pass = '', pass = '',
initialDelay = 100,
) { ) {
const gen = ++probeGeneration const gen = ++probeGeneration
boot.failed = false boot.failed = false
@@ -89,10 +90,10 @@ export function startProbe(
if (result === 'auth_required') { handleAuthRequired(gen, authMode, user, pass); return } if (result === 'auth_required') { handleAuthRequired(gen, authMode, user, pass); return }
if (tries >= MAX_ATTEMPTS) { boot.failed = true; appState.status = 'error'; startBackgroundProbe(gen, authMode, user, pass); return } if (tries >= MAX_ATTEMPTS) { boot.failed = true; appState.status = 'error'; startBackgroundProbe(gen, authMode, user, pass); return }
setTimeout(probe, Math.min(300 + tries * 150, 1500)) setTimeout(probe, Math.min(500 + tries * 200, 2000))
} }
setTimeout(probe, 100) setTimeout(probe, initialDelay)
} }
function startBackgroundProbe( function startBackgroundProbe(
+13 -7
View File
@@ -50,15 +50,21 @@
const strippedLayout = $derived(isReaderRoute && !readerContainerized) const strippedLayout = $derived(isReaderRoute && !readerContainerized)
onMount(async () => { onMount(async () => {
// hooks.client.ts already ran detectAdapter(), initPlatformService(),
// loadSettingsIntoState(), and startProbe() — nothing to re-initialize here.
if (isTauri && settingsState.settings.autoStartServer) { if (isTauri && settingsState.settings.autoStartServer) {
const { startProbe } = await import('$lib/state/boot.svelte')
platformService.launchServer({ platformService.launchServer({
binary: settingsState.settings.serverBinary, binary: settingsState.settings.serverBinary,
binaryArgs: settingsState.settings.serverBinaryArgs, binaryArgs: settingsState.settings.serverBinaryArgs,
webUiEnabled: settingsState.settings.suwayomiWebUI, webUiEnabled: settingsState.settings.suwayomiWebUI,
}).catch(() => {}) }).catch(() => {})
startProbe(
appState.authMode ?? 'NONE',
appState.authUser ?? '',
appState.authPass ?? '',
2000,
)
} }
if (settingsState.settings.discordRpc) { if (settingsState.settings.discordRpc) {
@@ -209,4 +215,4 @@
contain: layout style; contain: layout style;
min-width: 0; min-width: 0;
} }
</style> </style>x
+4 -2
View File
@@ -5,15 +5,17 @@ const target = process.env.MOKU_TARGET ?? 'static';
const adapter = target === 'node' const adapter = target === 'node'
? adapterNode() ? adapterNode()
: adapterStatic({ fallback: 'index.html' }); : adapterStatic({ fallback: 'index.html', pages: 'dist', assets: 'dist' })
/** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
compilerOptions: { compilerOptions: {
runes: ({ filename }) => (filename.split(/[/\\]/).includes('node_modules') ? undefined : true), runes: ({ filename }) => (filename.split(/[/\\]/).includes('node_modules') ? undefined : true),
}, },
kit: { kit: {
adapter, adapter,
paths: {
relative: true,
},
files: { files: {
assets: 'static', assets: 'static',
}, },