Make it build

This commit is contained in:
Zerebos
2026-05-23 22:32:17 -04:00
parent 0e93908bb2
commit d74790c3a0
16 changed files with 82 additions and 24 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"version": "0.9.4", "version": "0.9.4",
"identifier": "io.github.MokuProject.Moku", "identifier": "io.github.MokuProject.Moku",
"build": { "build": {
"frontendDist": "../dist", "frontendDist": "../build",
"beforeBuildCommand": "pnpm build" "beforeBuildCommand": "pnpm build"
}, },
"app": { "app": {
+6 -5
View File
@@ -43,10 +43,10 @@ async function resolvePlatformAdapter() {
const {TauriAdapter} = await import('$lib/platform-adapters/tauri'); const {TauriAdapter} = await import('$lib/platform-adapters/tauri');
return new TauriAdapter(); return new TauriAdapter();
} }
if (isCapacitor()) { // if (isCapacitor()) {
const {CapacitorAdapter} = await import('$lib/platform-adapters/capacitor'); // const {CapacitorAdapter} = await import('$lib/platform-adapters/capacitor');
return new CapacitorAdapter(); // return new CapacitorAdapter();
} // }
const {WebAdapter} = await import('$lib/platform-adapters/web'); const {WebAdapter} = await import('$lib/platform-adapters/web');
return new WebAdapter(); return new WebAdapter();
} }
@@ -73,7 +73,8 @@ async function boot() {
initHistoryState(), initHistoryState(),
]); ]);
appState.platform = isTauri() ? 'tauri' : isCapacitor() ? 'capacitor' : 'web'; // appState.platform = isTauri() ? 'tauri' : isCapacitor() ? 'capacitor' : 'web';
appState.platform = isTauri() ? 'tauri' : 'web';
appState.version = await platformAdapter.getVersion(); appState.version = await platformAdapter.getVersion();
const legacyAuth = loadSavedAuth(); const legacyAuth = loadSavedAuth();
+15 -3
View File
@@ -5,12 +5,24 @@ export const downloadsState = $state({
error: null as string | null, error: null as string | null,
}) })
export const activeDownloads = $derived( const activeDownloadsValue = $derived(
downloadsState.items.filter(d => d.state === 'downloading') downloadsState.items.filter(d => d.state === 'downloading')
) )
export const queuedDownloads = $derived( const queuedDownloadsValue = $derived(
downloadsState.items.filter(d => d.state === 'queued') downloadsState.items.filter(d => d.state === 'queued')
) )
export const downloadCount = $derived(downloadsState.items.length) const downloadCountValue = $derived(downloadsState.items.length)
export function activeDownloads() {
return activeDownloadsValue
}
export function queuedDownloads() {
return queuedDownloadsValue
}
export function downloadCount() {
return downloadCountValue
}
+5 -1
View File
@@ -20,7 +20,7 @@ export const extensionsState = $state({
browseHasMore: false, browseHasMore: false,
}); });
export const filteredExtensions = $derived.by(() => { const filteredExtensionsValue = $derived.by(() => {
let result = extensionsState.items; let result = extensionsState.items;
if (extensionsState.filter.installed) { if (extensionsState.filter.installed) {
@@ -36,3 +36,7 @@ export const filteredExtensions = $derived.by(() => {
return result; return result;
}); });
export function filteredExtensions() {
return filteredExtensionsValue;
}
+5 -1
View File
@@ -22,7 +22,7 @@ export const libraryState = $state({
selected: new Set<string>(), selected: new Set<string>(),
}); });
export const filteredItems = $derived.by(() => { const filteredItemsValue = $derived.by(() => {
let result = libraryState.items; let result = libraryState.items;
result = result.filter(m => !shouldHideNsfw(m, settingsState)); result = result.filter(m => !shouldHideNsfw(m, settingsState));
@@ -55,3 +55,7 @@ export const filteredItems = $derived.by(() => {
return libraryState.sortDesc ? sorted.reverse() : sorted; return libraryState.sortDesc ? sorted.reverse() : sorted;
}); });
export function filteredItems() {
return filteredItemsValue;
}
+20 -4
View File
@@ -34,17 +34,33 @@ export const readerState = $state({
fullscreen: false, fullscreen: false,
}); });
export const currentPageData = $derived( const currentPageDataValue = $derived(
readerState.pages[readerState.currentPage] ?? null readerState.pages[readerState.currentPage] ?? null
); );
export const progress = $derived( const progressValue = $derived(
readerState.pages.length > 0 readerState.pages.length > 0
? (readerState.currentPage + 1) / readerState.pages.length ? (readerState.currentPage + 1) / readerState.pages.length
: 0 : 0
); );
export const hasPrev = $derived(readerState.currentPage > 0); const hasPrevValue = $derived(readerState.currentPage > 0);
export const hasNext = $derived( const hasNextValue = $derived(
readerState.currentPage < readerState.pages.length - 1 readerState.currentPage < readerState.pages.length - 1
); );
export function currentPageData() {
return currentPageDataValue;
}
export function progress() {
return progressValue;
}
export function hasPrev() {
return hasPrevValue;
}
export function hasNext() {
return hasNextValue;
}
+5 -1
View File
@@ -17,7 +17,7 @@ export const seriesState = $state({
chapterSortDesc: true, chapterSortDesc: true,
}) })
export const filteredChapters = $derived.by(() => { const filteredChaptersValue = $derived.by(() => {
let result = seriesState.chapters let result = seriesState.chapters
if (seriesState.chapterFilter.unread) { if (seriesState.chapterFilter.unread) {
@@ -34,3 +34,7 @@ export const filteredChapters = $derived.by(() => {
const sorted = [...result].sort((a, b) => a.chapterNumber - b.chapterNumber) const sorted = [...result].sort((a, b) => a.chapterNumber - b.chapterNumber)
return seriesState.chapterSortDesc ? sorted.reverse() : sorted return seriesState.chapterSortDesc ? sorted.reverse() : sorted
}) })
export function filteredChapters() {
return filteredChaptersValue
}
+1 -1
View File
@@ -1,2 +1,2 @@
export const ssr = false export const ssr = false
export const prerender = true // export const prerender = true
+2 -1
View File
@@ -2,11 +2,12 @@
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { BookOpen, Books, ClockCounterClockwise, DownloadSimple } from 'phosphor-svelte' import { BookOpen, Books, ClockCounterClockwise, DownloadSimple } from 'phosphor-svelte'
import { loadLibrary } from '$lib/request-manager/manga' import { loadLibrary } from '$lib/request-manager/manga'
import { downloadCount } from '$lib/state/downloads.svelte' import { downloadCount as getDownloadCount } from '$lib/state/downloads.svelte'
import { historyState, initHistoryState } from '$lib/state/history.svelte' import { historyState, initHistoryState } from '$lib/state/history.svelte'
import { libraryState } from '$lib/state/library.svelte' import { libraryState } from '$lib/state/library.svelte'
const recentHistory = $derived(historyState.history.slice(0, 8)) const recentHistory = $derived(historyState.history.slice(0, 8))
const downloadCount = $derived(getDownloadCount())
const stats = $derived.by(() => [ const stats = $derived.by(() => [
{ {
+10 -1
View File
@@ -2,10 +2,19 @@
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { ArrowsClockwise, DownloadSimple, TrashSimple, XCircle } from 'phosphor-svelte' import { ArrowsClockwise, DownloadSimple, TrashSimple, XCircle } from 'phosphor-svelte'
import { clearDownloads, dequeueDownload, loadDownloads } from '$lib/request-manager/downloads' import { clearDownloads, dequeueDownload, loadDownloads } from '$lib/request-manager/downloads'
import { activeDownloads, downloadCount, downloadsState, queuedDownloads } from '$lib/state/downloads.svelte' import {
activeDownloads as getActiveDownloads,
downloadCount as getDownloadCount,
downloadsState,
queuedDownloads as getQueuedDownloads,
} from '$lib/state/downloads.svelte'
let busy = $state(false) let busy = $state(false)
const activeDownloads = $derived(getActiveDownloads())
const queuedDownloads = $derived(getQueuedDownloads())
const downloadCount = $derived(getDownloadCount())
onMount(async () => { onMount(async () => {
await loadDownloads() await loadDownloads()
}) })
+3 -1
View File
@@ -7,10 +7,12 @@
uninstallExtension, uninstallExtension,
updateExtension, updateExtension,
} from '$lib/request-manager/extensions' } from '$lib/request-manager/extensions'
import { extensionsState, filteredExtensions } from '$lib/state/extensions.svelte' import { extensionsState, filteredExtensions as getFilteredExtensions } from '$lib/state/extensions.svelte'
let busyIds = $state<string[]>([]) let busyIds = $state<string[]>([])
const filteredExtensions = $derived(getFilteredExtensions())
const languageOptions = $derived.by(() => { const languageOptions = $derived.by(() => {
const values: string[] = [] const values: string[] = []
for (const extension of extensionsState.items) { for (const extension of extensionsState.items) {
+2 -1
View File
@@ -2,7 +2,7 @@
import { onMount } from 'svelte' import { onMount } from 'svelte'
import { Funnel, ArrowsDownUp, SquaresFour, ListBullets, X } from 'phosphor-svelte' import { Funnel, ArrowsDownUp, SquaresFour, ListBullets, X } from 'phosphor-svelte'
import { loadLibrary } from '$lib/request-manager/manga' import { loadLibrary } from '$lib/request-manager/manga'
import { libraryState, filteredItems } from '$lib/state/library.svelte' import { libraryState, filteredItems as getFilteredItems } from '$lib/state/library.svelte'
import type { LibrarySortOption } from '$lib/state/library.svelte' import type { LibrarySortOption } from '$lib/state/library.svelte'
import type { MangaStatus } from '$lib/server-adapters/types' import type { MangaStatus } from '$lib/server-adapters/types'
import MangaCard from '$lib/ui/manga/MangaCard.svelte' import MangaCard from '$lib/ui/manga/MangaCard.svelte'
@@ -46,6 +46,7 @@
return count return count
}) })
const filteredItems = $derived(getFilteredItems())
const hasResults = $derived(filteredItems.length > 0) const hasResults = $derived(filteredItems.length > 0)
onMount(async () => { onMount(async () => {
@@ -2,7 +2,7 @@
import { goto } from '$app/navigation' import { goto } from '$app/navigation'
import { page } from '$app/stores' import { page } from '$app/stores'
import { ArrowArcLeft, CaretLeft, CaretRight, Columns, List, MagnifyingGlass, SpinnerGap, TextAlignRight } from 'phosphor-svelte' import { ArrowArcLeft, CaretLeft, CaretRight, Columns, List, MagnifyingGlass, SpinnerGap, TextAlignRight } from 'phosphor-svelte'
import { currentPageData, progress, readerState } from '$lib/state/reader.svelte' import { currentPageData as getCurrentPageData, progress as getProgress, readerState } from '$lib/state/reader.svelte'
import { ensureReaderSession } from '$lib/core/reader/chapterLoader' import { ensureReaderSession } from '$lib/core/reader/chapterLoader'
import { getAdjacentChapters, goToNextReaderPage, goToPreviousReaderPage, setCurrentReaderPage } from '$lib/core/reader/navigation' import { getAdjacentChapters, goToNextReaderPage, goToPreviousReaderPage, setCurrentReaderPage } from '$lib/core/reader/navigation'
import { createReaderKeyHandler } from '$lib/core/reader/readerKeybinds' import { createReaderKeyHandler } from '$lib/core/reader/readerKeybinds'
@@ -16,6 +16,9 @@
let routeError = $state<string | null>(null) let routeError = $state<string | null>(null)
let requestVersion = 0 let requestVersion = 0
const currentPageData = $derived(getCurrentPageData())
const progress = $derived(getProgress())
const mangaId = $derived($page.params.mangaId ?? '') const mangaId = $derived($page.params.mangaId ?? '')
const chapterId = $derived($page.params.chapterId ?? '') const chapterId = $derived($page.params.chapterId ?? '')
const chapterNeighbors = $derived.by(() => getAdjacentChapters()) const chapterNeighbors = $derived.by(() => getAdjacentChapters())
+2 -1
View File
@@ -3,13 +3,14 @@
import { BookOpen, DownloadSimple, Circle, CheckCircle } from 'phosphor-svelte' import { BookOpen, DownloadSimple, Circle, CheckCircle } from 'phosphor-svelte'
import type { Chapter } from '$lib/types/chapter' import type { Chapter } from '$lib/types/chapter'
import { markRead } from '$lib/request-manager/chapters' import { markRead } from '$lib/request-manager/chapters'
import { filteredChapters, seriesState } from '$lib/state/series.svelte' import { filteredChapters as getFilteredChapters, seriesState } from '$lib/state/series.svelte'
import { readerState } from '$lib/state/reader.svelte' import { readerState } from '$lib/state/reader.svelte'
import Thumbnail from '$lib/ui/manga/Thumbnail.svelte' import Thumbnail from '$lib/ui/manga/Thumbnail.svelte'
import type { PageData } from './$types' import type { PageData } from './$types'
let { data }: { data: PageData } = $props() let { data }: { data: PageData } = $props()
const filteredChapters = $derived(getFilteredChapters())
const totalCount = $derived(seriesState.chapters.length) const totalCount = $derived(seriesState.chapters.length)
const readCount = $derived(seriesState.chapters.filter(ch => ch.read).length) const readCount = $derived(seriesState.chapters.filter(ch => ch.read).length)
const downloadedCount = $derived(seriesState.chapters.filter(ch => ch.downloaded).length) const downloadedCount = $derived(seriesState.chapters.filter(ch => ch.downloaded).length)
+1 -1
View File
@@ -15,7 +15,7 @@ const config = {
kit: { kit: {
adapter, adapter,
files: { files: {
assets: 'static', assets: 'src/lib/assets',
}, },
}, },
}; };