mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 01:09:56 -05:00
Make it build
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"version": "0.9.4",
|
||||
"identifier": "io.github.MokuProject.Moku",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
"frontendDist": "../build",
|
||||
"beforeBuildCommand": "pnpm build"
|
||||
},
|
||||
"app": {
|
||||
|
||||
+6
-5
@@ -43,10 +43,10 @@ async function resolvePlatformAdapter() {
|
||||
const {TauriAdapter} = await import('$lib/platform-adapters/tauri');
|
||||
return new TauriAdapter();
|
||||
}
|
||||
if (isCapacitor()) {
|
||||
const {CapacitorAdapter} = await import('$lib/platform-adapters/capacitor');
|
||||
return new CapacitorAdapter();
|
||||
}
|
||||
// if (isCapacitor()) {
|
||||
// const {CapacitorAdapter} = await import('$lib/platform-adapters/capacitor');
|
||||
// return new CapacitorAdapter();
|
||||
// }
|
||||
const {WebAdapter} = await import('$lib/platform-adapters/web');
|
||||
return new WebAdapter();
|
||||
}
|
||||
@@ -73,7 +73,8 @@ async function boot() {
|
||||
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();
|
||||
|
||||
const legacyAuth = loadSavedAuth();
|
||||
|
||||
@@ -5,12 +5,24 @@ export const downloadsState = $state({
|
||||
error: null as string | null,
|
||||
})
|
||||
|
||||
export const activeDownloads = $derived(
|
||||
const activeDownloadsValue = $derived(
|
||||
downloadsState.items.filter(d => d.state === 'downloading')
|
||||
)
|
||||
|
||||
export const queuedDownloads = $derived(
|
||||
const queuedDownloadsValue = $derived(
|
||||
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
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export const extensionsState = $state({
|
||||
browseHasMore: false,
|
||||
});
|
||||
|
||||
export const filteredExtensions = $derived.by(() => {
|
||||
const filteredExtensionsValue = $derived.by(() => {
|
||||
let result = extensionsState.items;
|
||||
|
||||
if (extensionsState.filter.installed) {
|
||||
@@ -36,3 +36,7 @@ export const filteredExtensions = $derived.by(() => {
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
export function filteredExtensions() {
|
||||
return filteredExtensionsValue;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export const libraryState = $state({
|
||||
selected: new Set<string>(),
|
||||
});
|
||||
|
||||
export const filteredItems = $derived.by(() => {
|
||||
const filteredItemsValue = $derived.by(() => {
|
||||
let result = libraryState.items;
|
||||
|
||||
result = result.filter(m => !shouldHideNsfw(m, settingsState));
|
||||
@@ -55,3 +55,7 @@ export const filteredItems = $derived.by(() => {
|
||||
|
||||
return libraryState.sortDesc ? sorted.reverse() : sorted;
|
||||
});
|
||||
|
||||
export function filteredItems() {
|
||||
return filteredItemsValue;
|
||||
}
|
||||
|
||||
@@ -34,17 +34,33 @@ export const readerState = $state({
|
||||
fullscreen: false,
|
||||
});
|
||||
|
||||
export const currentPageData = $derived(
|
||||
const currentPageDataValue = $derived(
|
||||
readerState.pages[readerState.currentPage] ?? null
|
||||
);
|
||||
|
||||
export const progress = $derived(
|
||||
const progressValue = $derived(
|
||||
readerState.pages.length > 0
|
||||
? (readerState.currentPage + 1) / readerState.pages.length
|
||||
: 0
|
||||
);
|
||||
|
||||
export const hasPrev = $derived(readerState.currentPage > 0);
|
||||
export const hasNext = $derived(
|
||||
const hasPrevValue = $derived(readerState.currentPage > 0);
|
||||
const hasNextValue = $derived(
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export const seriesState = $state({
|
||||
chapterSortDesc: true,
|
||||
})
|
||||
|
||||
export const filteredChapters = $derived.by(() => {
|
||||
const filteredChaptersValue = $derived.by(() => {
|
||||
let result = seriesState.chapters
|
||||
|
||||
if (seriesState.chapterFilter.unread) {
|
||||
@@ -34,3 +34,7 @@ export const filteredChapters = $derived.by(() => {
|
||||
const sorted = [...result].sort((a, b) => a.chapterNumber - b.chapterNumber)
|
||||
return seriesState.chapterSortDesc ? sorted.reverse() : sorted
|
||||
})
|
||||
|
||||
export function filteredChapters() {
|
||||
return filteredChaptersValue
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export const ssr = false
|
||||
export const prerender = true
|
||||
// export const prerender = true
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
import { onMount } from 'svelte'
|
||||
import { BookOpen, Books, ClockCounterClockwise, DownloadSimple } from 'phosphor-svelte'
|
||||
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 { libraryState } from '$lib/state/library.svelte'
|
||||
|
||||
const recentHistory = $derived(historyState.history.slice(0, 8))
|
||||
const downloadCount = $derived(getDownloadCount())
|
||||
|
||||
const stats = $derived.by(() => [
|
||||
{
|
||||
|
||||
@@ -2,10 +2,19 @@
|
||||
import { onMount } from 'svelte'
|
||||
import { ArrowsClockwise, DownloadSimple, TrashSimple, XCircle } from 'phosphor-svelte'
|
||||
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)
|
||||
|
||||
const activeDownloads = $derived(getActiveDownloads())
|
||||
const queuedDownloads = $derived(getQueuedDownloads())
|
||||
const downloadCount = $derived(getDownloadCount())
|
||||
|
||||
onMount(async () => {
|
||||
await loadDownloads()
|
||||
})
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
uninstallExtension,
|
||||
updateExtension,
|
||||
} 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[]>([])
|
||||
|
||||
const filteredExtensions = $derived(getFilteredExtensions())
|
||||
|
||||
const languageOptions = $derived.by(() => {
|
||||
const values: string[] = []
|
||||
for (const extension of extensionsState.items) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { onMount } from 'svelte'
|
||||
import { Funnel, ArrowsDownUp, SquaresFour, ListBullets, X } from 'phosphor-svelte'
|
||||
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 { MangaStatus } from '$lib/server-adapters/types'
|
||||
import MangaCard from '$lib/ui/manga/MangaCard.svelte'
|
||||
@@ -46,6 +46,7 @@
|
||||
return count
|
||||
})
|
||||
|
||||
const filteredItems = $derived(getFilteredItems())
|
||||
const hasResults = $derived(filteredItems.length > 0)
|
||||
|
||||
onMount(async () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
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 { getAdjacentChapters, goToNextReaderPage, goToPreviousReaderPage, setCurrentReaderPage } from '$lib/core/reader/navigation'
|
||||
import { createReaderKeyHandler } from '$lib/core/reader/readerKeybinds'
|
||||
@@ -16,6 +16,9 @@
|
||||
let routeError = $state<string | null>(null)
|
||||
let requestVersion = 0
|
||||
|
||||
const currentPageData = $derived(getCurrentPageData())
|
||||
const progress = $derived(getProgress())
|
||||
|
||||
const mangaId = $derived($page.params.mangaId ?? '')
|
||||
const chapterId = $derived($page.params.chapterId ?? '')
|
||||
const chapterNeighbors = $derived.by(() => getAdjacentChapters())
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
import { BookOpen, DownloadSimple, Circle, CheckCircle } from 'phosphor-svelte'
|
||||
import type { Chapter } from '$lib/types/chapter'
|
||||
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 Thumbnail from '$lib/ui/manga/Thumbnail.svelte'
|
||||
import type { PageData } from './$types'
|
||||
|
||||
let { data }: { data: PageData } = $props()
|
||||
|
||||
const filteredChapters = $derived(getFilteredChapters())
|
||||
const totalCount = $derived(seriesState.chapters.length)
|
||||
const readCount = $derived(seriesState.chapters.filter(ch => ch.read).length)
|
||||
const downloadedCount = $derived(seriesState.chapters.filter(ch => ch.downloaded).length)
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ const config = {
|
||||
kit: {
|
||||
adapter,
|
||||
files: {
|
||||
assets: 'static',
|
||||
assets: 'src/lib/assets',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user