fix: tsc -b project refs + move shared types, was clobbering preload d.ts
This commit is contained in:
parent
a75157a45c
commit
4494a53c2c
21 changed files with 42 additions and 33 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,7 +1,9 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
out/
|
out/
|
||||||
dist/
|
dist/
|
||||||
|
.tsc-out/
|
||||||
_research/
|
_research/
|
||||||
.claude/
|
.claude/
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,34 @@
|
||||||
import { contextBridge, ipcRenderer } from 'electron'
|
import { contextBridge, ipcRenderer } from 'electron'
|
||||||
|
import type { CatalogResponse, CollectionType, HistoryItem, TimecodeItem, UserProfile } from '../shared/types'
|
||||||
|
|
||||||
const api = {
|
const api = {
|
||||||
openExternal: (url: string) => ipcRenderer.invoke('shell:openExternal', url),
|
openExternal: (url: string): Promise<void> => ipcRenderer.invoke('shell:openExternal', url),
|
||||||
|
|
||||||
login: (login: string, password: string, remember: boolean) =>
|
login: (login: string, password: string, remember: boolean): Promise<UserProfile> =>
|
||||||
ipcRenderer.invoke('auth:login', login, password, remember),
|
ipcRenderer.invoke('auth:login', login, password, remember),
|
||||||
loadSavedSession: () => ipcRenderer.invoke('auth:loadSaved'),
|
loadSavedSession: (): Promise<UserProfile | null> => ipcRenderer.invoke('auth:loadSaved'),
|
||||||
logout: () => ipcRenderer.invoke('auth:logout'),
|
logout: (): Promise<void> => ipcRenderer.invoke('auth:logout'),
|
||||||
|
|
||||||
favoritesList: (page: number, limit: number) =>
|
favoritesList: (page: number, limit: number): Promise<CatalogResponse> =>
|
||||||
ipcRenderer.invoke('account:favoritesList', page, limit),
|
ipcRenderer.invoke('account:favoritesList', page, limit),
|
||||||
favoriteAdd: (releaseId: number) => ipcRenderer.invoke('account:favoriteAdd', releaseId),
|
favoriteAdd: (releaseId: number): Promise<void> => ipcRenderer.invoke('account:favoriteAdd', releaseId),
|
||||||
favoriteRemove: (releaseId: number) => ipcRenderer.invoke('account:favoriteRemove', releaseId),
|
favoriteRemove: (releaseId: number): Promise<void> =>
|
||||||
|
ipcRenderer.invoke('account:favoriteRemove', releaseId),
|
||||||
|
|
||||||
collectionList: (typeOfCollection: string, page: number, limit: number) =>
|
collectionList: (typeOfCollection: string, page: number, limit: number): Promise<CatalogResponse> =>
|
||||||
ipcRenderer.invoke('account:collectionList', typeOfCollection, page, limit),
|
ipcRenderer.invoke('account:collectionList', typeOfCollection, page, limit),
|
||||||
collectionAdd: (releaseId: number, typeOfCollection: string) =>
|
collectionAdd: (releaseId: number, typeOfCollection: string): Promise<void> =>
|
||||||
ipcRenderer.invoke('account:collectionAdd', releaseId, typeOfCollection),
|
ipcRenderer.invoke('account:collectionAdd', releaseId, typeOfCollection),
|
||||||
collectionRemove: (releaseId: number) => ipcRenderer.invoke('account:collectionRemove', releaseId),
|
collectionRemove: (releaseId: number): Promise<void> =>
|
||||||
collectionIds: () => ipcRenderer.invoke('account:collectionIds'),
|
ipcRenderer.invoke('account:collectionRemove', releaseId),
|
||||||
favoriteIds: () => ipcRenderer.invoke('account:favoriteIds'),
|
collectionIds: (): Promise<Array<{ release_id: number; type_of_collection: CollectionType }>> =>
|
||||||
|
ipcRenderer.invoke('account:collectionIds'),
|
||||||
|
favoriteIds: (): Promise<unknown> => ipcRenderer.invoke('account:favoriteIds'),
|
||||||
|
|
||||||
historyList: () => ipcRenderer.invoke('account:historyList'),
|
historyList: (): Promise<{ data: HistoryItem[] }> => ipcRenderer.invoke('account:historyList'),
|
||||||
|
|
||||||
timecodes: () => ipcRenderer.invoke('account:timecodes'),
|
timecodes: (): Promise<TimecodeItem[]> => ipcRenderer.invoke('account:timecodes'),
|
||||||
timecodeSave: (releaseEpisodeId: string, time: number, isWatched: boolean) =>
|
timecodeSave: (releaseEpisodeId: string, time: number, isWatched: boolean): Promise<void> =>
|
||||||
ipcRenderer.invoke('account:timecodeSave', releaseEpisodeId, time, isWatched),
|
ipcRenderer.invoke('account:timecodeSave', releaseEpisodeId, time, isWatched),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { motion, AnimatePresence } from 'framer-motion'
|
import { motion, AnimatePresence } from 'framer-motion'
|
||||||
import { useAuth } from '../lib/AuthContext'
|
import { useAuth } from '../lib/AuthContext'
|
||||||
import type { CollectionType } from '../lib/types'
|
import type { CollectionType } from '../../../shared/types'
|
||||||
|
|
||||||
const LABELS: Record<CollectionType, string> = {
|
const LABELS: Record<CollectionType, string> = {
|
||||||
WATCHING: 'Смотрю',
|
WATCHING: 'Смотрю',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import type { Release } from '../lib/types'
|
import type { Release } from '../../../shared/types'
|
||||||
import { imageUrl } from '../lib/api'
|
import { imageUrl } from '../lib/api'
|
||||||
import WishlistButton from './WishlistButton'
|
import WishlistButton from './WishlistButton'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { useEffect, useRef, useState, useCallback } from 'react'
|
import { useEffect, useRef, useState, useCallback } from 'react'
|
||||||
import Hls from 'hls.js'
|
import Hls from 'hls.js'
|
||||||
import type { Episode } from '../lib/types'
|
import type { Episode } from '../../../shared/types'
|
||||||
import { loadPlayerPrefs, savePlayerPrefs, PlayerPrefs } from '../lib/playerPrefs'
|
import { loadPlayerPrefs, savePlayerPrefs, PlayerPrefs } from '../lib/playerPrefs'
|
||||||
|
|
||||||
const QUALITIES = [
|
const QUALITIES = [
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import type { Release } from '../lib/types'
|
import type { Release } from '../../../shared/types'
|
||||||
import AnimeCard from './AnimeCard'
|
import AnimeCard from './AnimeCard'
|
||||||
|
|
||||||
const container = {
|
const container = {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import { isInWishlist, toggleWishlist, onWishlistChange } from '../lib/wishlist'
|
import { isInWishlist, toggleWishlist, onWishlistChange } from '../lib/wishlist'
|
||||||
import type { Release } from '../lib/types'
|
import type { Release } from '../../../shared/types'
|
||||||
|
|
||||||
export default function WishlistButton({
|
export default function WishlistButton({
|
||||||
release,
|
release,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { createContext, useContext, useEffect, useState, ReactNode } from 'react'
|
import { createContext, useContext, useEffect, useState, ReactNode } from 'react'
|
||||||
import type { UserProfile } from './types'
|
import type { UserProfile } from '../../../shared/types'
|
||||||
|
|
||||||
interface AuthState {
|
interface AuthState {
|
||||||
user: UserProfile | null
|
user: UserProfile | null
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import type {
|
||||||
ScheduleDay,
|
ScheduleDay,
|
||||||
ScheduleNow,
|
ScheduleNow,
|
||||||
ValueDescription,
|
ValueDescription,
|
||||||
} from './types'
|
} from '../../../shared/types'
|
||||||
|
|
||||||
const GATEWAY = 'https://api.savsis.xyz/api/anilibria'
|
const GATEWAY = 'https://api.savsis.xyz/api/anilibria'
|
||||||
const API_BASE = `${GATEWAY}/api/v1`
|
const API_BASE = `${GATEWAY}/api/v1`
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Release } from './types'
|
import type { Release } from '../../../shared/types'
|
||||||
|
|
||||||
const KEY = 'anisav:wishlist'
|
const KEY = 'anisav:wishlist'
|
||||||
const EVENT = 'anisav:wishlist-changed'
|
const EVENT = 'anisav:wishlist-changed'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react'
|
||||||
import { useSearchParams } from 'react-router-dom'
|
import { useSearchParams } from 'react-router-dom'
|
||||||
import { motion, AnimatePresence } from 'framer-motion'
|
import { motion, AnimatePresence } from 'framer-motion'
|
||||||
import { api } from '../lib/api'
|
import { api } from '../lib/api'
|
||||||
import type { CatalogFilters, Genre, Release, ValueDescription } from '../lib/types'
|
import type { CatalogFilters, Genre, Release, ValueDescription } from '../../../shared/types'
|
||||||
import AnimeCard from '../components/AnimeCard'
|
import AnimeCard from '../components/AnimeCard'
|
||||||
import { GridSkeleton } from '../components/Skeleton'
|
import { GridSkeleton } from '../components/Skeleton'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import { api, imageUrl } from '../lib/api'
|
import { api, imageUrl } from '../lib/api'
|
||||||
import type { Genre } from '../lib/types'
|
import type { Genre } from '../../../shared/types'
|
||||||
import Loader from '../components/Loader'
|
import Loader from '../components/Loader'
|
||||||
|
|
||||||
const container = { hidden: {}, show: { transition: { staggerChildren: 0.035 } } }
|
const container = { hidden: {}, show: { transition: { staggerChildren: 0.035 } } }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { useAuth } from '../lib/AuthContext'
|
import { useAuth } from '../lib/AuthContext'
|
||||||
import type { HistoryItem } from '../lib/types'
|
import type { HistoryItem } from '../../../shared/types'
|
||||||
import { imageUrl } from '../lib/api'
|
import { imageUrl } from '../lib/api'
|
||||||
import Loader from '../components/Loader'
|
import Loader from '../components/Loader'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import { api, imageUrl } from '../lib/api'
|
import { api, imageUrl } from '../lib/api'
|
||||||
import type { Release, ScheduleDay } from '../lib/types'
|
import type { Release, ScheduleDay } from '../../../shared/types'
|
||||||
import Row from '../components/Row'
|
import Row from '../components/Row'
|
||||||
import { GridSkeleton } from '../components/Skeleton'
|
import { GridSkeleton } from '../components/Skeleton'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { motion, AnimatePresence } from 'framer-motion'
|
import { motion, AnimatePresence } from 'framer-motion'
|
||||||
import { useAuth } from '../lib/AuthContext'
|
import { useAuth } from '../lib/AuthContext'
|
||||||
import type { CollectionType, Release } from '../lib/types'
|
import type { CollectionType, Release } from '../../../shared/types'
|
||||||
import AnimeCard from '../components/AnimeCard'
|
import AnimeCard from '../components/AnimeCard'
|
||||||
import Loader from '../components/Loader'
|
import Loader from '../components/Loader'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { api } from '../lib/api'
|
import { api } from '../lib/api'
|
||||||
import type { ScheduleDay } from '../lib/types'
|
import type { ScheduleDay } from '../../../shared/types'
|
||||||
import AnimeCard from '../components/AnimeCard'
|
import AnimeCard from '../components/AnimeCard'
|
||||||
import Loader from '../components/Loader'
|
import Loader from '../components/Loader'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import { api, imageUrl } from '../lib/api'
|
import { api, imageUrl } from '../lib/api'
|
||||||
import type { Episode, Release, TimecodeItem } from '../lib/types'
|
import type { Episode, Release, TimecodeItem } from '../../../shared/types'
|
||||||
import { useAuth } from '../lib/AuthContext'
|
import { useAuth } from '../lib/AuthContext'
|
||||||
import { getAllLocalProgress, saveLocalProgress } from '../lib/localProgress'
|
import { getAllLocalProgress, saveLocalProgress } from '../lib/localProgress'
|
||||||
import Loader from '../components/Loader'
|
import Loader from '../components/Loader'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { motion } from 'framer-motion'
|
import { motion } from 'framer-motion'
|
||||||
import { getWishlist, onWishlistChange } from '../lib/wishlist'
|
import { getWishlist, onWishlistChange } from '../lib/wishlist'
|
||||||
import type { Release } from '../lib/types'
|
import type { Release } from '../../../shared/types'
|
||||||
import AnimeCard from '../components/AnimeCard'
|
import AnimeCard from '../components/AnimeCard'
|
||||||
|
|
||||||
const container = { hidden: {}, show: { transition: { staggerChildren: 0.04 } } }
|
const container = { hidden: {}, show: { transition: { staggerChildren: 0.04 } } }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
{
|
{
|
||||||
"include": ["electron.vite.config.*", "src/main/**/*", "src/preload/**/*"],
|
"include": ["electron.vite.config.*", "src/main/**/*", "src/preload/**/*", "src/shared/**/*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
"outDir": "./.tsc-out/node",
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"include": ["src/renderer/src/**/*", "src/preload/*.d.ts"],
|
"include": ["src/renderer/src/**/*", "src/preload/*.d.ts", "src/shared/**/*"],
|
||||||
|
"references": [{ "path": "./tsconfig.node.json" }],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
"outDir": "./.tsc-out/web",
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue