From e771ca591f0cead9df6be5c66fcadd113ebdc670 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 12 Mar 2026 10:38:24 +0100 Subject: [PATCH] Remove yoshiki, fix ts issues --- api/src/controllers/videos.ts | 2 +- front/bun.lock | 9 - front/package.json | 1 - front/src/app/(app)/(tabs)/index.tsx | 3 +- front/src/models/resources/person.ts | 25 --- front/src/models/resources/server-info.ts | 71 ------ front/src/models/video.ts | 14 +- front/src/primitives/image/image.tsx | 7 - front/src/primitives/index.ts | 1 - front/src/primitives/theme/catppuccin.tsx | 69 ------ front/src/primitives/theme/index.ts | 2 - front/src/primitives/theme/theme.tsx | 215 ------------------ front/src/primitives/tooltip.web.tsx | 14 +- front/src/primitives/utils/breakpoint.ts | 30 ++- front/src/providers/index.tsx | 31 +-- front/src/query/fetch-infinite.tsx | 9 +- front/src/query/fetch.tsx | 2 +- front/src/ui/browse/index.tsx | 2 +- front/src/ui/login/oidc.tsx | 254 +++++++++++----------- front/src/ui/settings/oidc.tsx | 2 - front/src/utils.ts | 2 +- front/tsconfig.json | 23 +- 22 files changed, 201 insertions(+), 587 deletions(-) delete mode 100644 front/src/models/resources/person.ts delete mode 100644 front/src/models/resources/server-info.ts delete mode 100644 front/src/primitives/theme/catppuccin.tsx delete mode 100644 front/src/primitives/theme/index.ts delete mode 100644 front/src/primitives/theme/theme.tsx diff --git a/api/src/controllers/videos.ts b/api/src/controllers/videos.ts index 9fbd762a..a592bcd9 100644 --- a/api/src/controllers/videos.ts +++ b/api/src/controllers/videos.ts @@ -322,7 +322,7 @@ export async function getVideos({ .with(...cte) .select({ ...getColumns(videos), - ...buildRelations(["slugs", ...relations], videoRelations, { + ...buildRelations(["slugs", "progress", ...relations], videoRelations, { languages, preferOriginal, }), diff --git a/front/bun.lock b/front/bun.lock index 8a4d8112..95c1d1ad 100644 --- a/front/bun.lock +++ b/front/bun.lock @@ -64,7 +64,6 @@ "uniwind": "^1.2.6", "uuid": "^13.0.0", "video.js": "^8.23.4", - "yoshiki": "1.2.14", "zod": "^4.3.5", }, "devDependencies": { @@ -629,8 +628,6 @@ "@types/graceful-fs": ["@types/graceful-fs@4.1.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ=="], - "@types/inline-style-prefixer": ["@types/inline-style-prefixer@5.0.3", "", {}, "sha512-GOiSoBwH2U8LmbCnOLU6ZRPtm+qycO9sNXCvP+ahG0abpHrYTd1rm6ZPX4qYTFf1mTB6tqTQ9fYaJPcQWGFMSQ=="], - "@types/istanbul-lib-coverage": ["@types/istanbul-lib-coverage@2.0.6", "", {}, "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w=="], "@types/istanbul-lib-report": ["@types/istanbul-lib-report@3.0.3", "", { "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA=="], @@ -641,8 +638,6 @@ "@types/node": ["@types/node@18.19.130", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="], - "@types/prop-types": ["@types/prop-types@15.7.15", "", {}, "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw=="], - "@types/react": ["@types/react@19.1.17", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-Qec1E3mhALmaspIrhWt9jkQMNdw6bReVu64mjvhbhq2NFPftLPVr+l1SZgmw/66WwBNpDh7ao5AT6gF5v41PFA=="], "@types/react-dom": ["@types/react-dom@19.1.11", "", { "peerDependencies": { "@types/react": "^19.0.0" } }, "sha512-3BKc/yGdNTYQVVw4idqHtSOcFsgGuBbMveKCOgF8wQ5QtrYOc3jDIlzg3jef04zcXFIHLelyGlj0T+BJ8+KN+w=="], @@ -1675,8 +1670,6 @@ "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], - "yoshiki": ["yoshiki@1.2.14", "", { "dependencies": { "@types/inline-style-prefixer": "^5.0.0", "@types/node": "18.x.x", "@types/react": "18.x.x", "inline-style-prefixer": "^7.0.0" }, "peerDependencies": { "react": "*", "react-native": "*", "react-native-web": "*" }, "optionalPeers": ["react-native", "react-native-web"] }, "sha512-TQoaB1C8/rUCuz/856eDv1BUxN+/OYL0f7RG+MwqIv260BEQQeUrsGGaMfN2GHdy86geNkn9wQArJqsjut/3Lg=="], - "zod": ["zod@4.3.6", "", {}, "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg=="], "@babel/core/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], @@ -1857,8 +1850,6 @@ "xml2js/xmlbuilder": ["xmlbuilder@11.0.1", "", {}, "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="], - "yoshiki/@types/react": ["@types/react@18.3.27", "", { "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" } }, "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w=="], - "@babel/highlight/chalk/ansi-styles": ["ansi-styles@3.2.1", "", { "dependencies": { "color-convert": "^1.9.0" } }, "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA=="], "@babel/highlight/chalk/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="], diff --git a/front/package.json b/front/package.json index 534794d5..fa30bc09 100644 --- a/front/package.json +++ b/front/package.json @@ -74,7 +74,6 @@ "uniwind": "^1.2.6", "uuid": "^13.0.0", "video.js": "^8.23.4", - "yoshiki": "1.2.14", "zod": "^4.3.5" }, "devDependencies": { diff --git a/front/src/app/(app)/(tabs)/index.tsx b/front/src/app/(app)/(tabs)/index.tsx index 720937bb..725dd18b 100644 --- a/front/src/app/(app)/(tabs)/index.tsx +++ b/front/src/app/(app)/(tabs)/index.tsx @@ -1,6 +1,5 @@ -import { HomePage, loader } from "~/ui/home"; +import { HomePage } from "~/ui/home"; export { ErrorBoundary } from "~/ui/error-boundary"; -export { loader }; export default HomePage; diff --git a/front/src/models/resources/person.ts b/front/src/models/resources/person.ts deleted file mode 100644 index 7d666181..00000000 --- a/front/src/models/resources/person.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { z } from "zod"; -import { ImagesP, ResourceP } from "../traits"; - -export const PersonP = ResourceP("people").merge(ImagesP).extend({ - /** - * The name of this person. - */ - name: z.string(), - /** - * The type of work the person has done for the show. That can be something like "Actor", - * "Writer", "Music", "Voice Actor"... - */ - type: z.string().optional(), - - /** - * The role the People played. This is mostly used to inform witch character was played for actor - * and voice actors. - */ - role: z.string().optional(), -}); - -/** - * A studio that make shows. - */ -export type Person = z.infer; diff --git a/front/src/models/resources/server-info.ts b/front/src/models/resources/server-info.ts deleted file mode 100644 index 972a8b3e..00000000 --- a/front/src/models/resources/server-info.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Platform } from "react-native"; -import { z } from "zod"; - -export const OidcInfoP = z.object({ - /* - * The name of this oidc service. Human readable. - */ - displayName: z.string(), - /* - * A url returning a square logo for this provider. - */ - logoUrl: z.string().nullable(), -}); - -export enum SetupStep { - MissingAdminAccount = "MissingAdminAccount", - NoVideoFound = "NoVideoFound", - Done = "Done", -} - -export const ServerInfoP = z - .object({ - /* - * True if guest accounts are allowed on this instance. - */ - allowGuests: z.boolean(), - /* - * The list of permissions available for the guest account. - */ - guestPermissions: z.array(z.string()), - /* - * The url to reach the homepage of kyoo (add /api for the api). - */ - publicUrl: z.string(), - /* - * The list of oidc providers configured for this instance of kyoo. - */ - oidc: z.record(z.string(), OidcInfoP), - /* - * Check if kyoo's setup is finished. - */ - setupStatus: z.nativeEnum(SetupStep), - /* - * True if password login is enabled on this instance. - */ - passwordLoginEnabled: z.boolean(), - /* - * True if registration is enabled on this instance. - */ - registrationEnabled: z.boolean(), - }) - .transform((x) => { - const baseUrl = Platform.OS === "web" ? x.publicUrl : "kyoo://"; - return { - ...x, - oidc: Object.fromEntries( - Object.entries(x.oidc).map(([provider, info]) => [ - provider, - { - ...info, - link: `/auth/login/${provider}?redirectUrl=${baseUrl}/login/callback`, - }, - ]), - ), - }; - }); - -/** - * A season of a Show. - */ -export type ServerInfo = z.infer; diff --git a/front/src/models/video.ts b/front/src/models/video.ts index 1632cceb..04bf917a 100644 --- a/front/src/models/video.ts +++ b/front/src/models/video.ts @@ -42,14 +42,12 @@ export const FullVideo = Video.extend({ Special.omit({ progress: true, videos: true }), ]), ), - progress: z.optional( - z.object({ - percent: z.int().min(0).max(100), - time: z.int().min(0), - playedDate: zdate().nullable(), - videoId: z.string().nullable(), - }), - ), + progress: z.object({ + percent: z.int().min(0).max(100), + time: z.int().min(0), + playedDate: zdate().nullable(), + videoId: z.string().nullable(), + }), previous: z.object({ video: z.string(), entry: Entry }).nullable().optional(), next: z.object({ video: z.string(), entry: Entry }).nullable().optional(), show: Show.optional(), diff --git a/front/src/primitives/image/image.tsx b/front/src/primitives/image/image.tsx index c253cc33..82bcd969 100644 --- a/front/src/primitives/image/image.tsx +++ b/front/src/primitives/image/image.tsx @@ -3,18 +3,11 @@ import KyooLogo from "public/icon.svg"; import type { ComponentProps } from "react"; import { type ImageStyle, Platform, View, type ViewProps } from "react-native"; import { withUniwind } from "uniwind"; -import type { YoshikiStyle } from "yoshiki/src/type"; import type { KImage } from "~/models"; import { useToken } from "~/providers/account-context"; import { cn } from "~/utils"; import { Skeleton } from "../skeleton"; -export type YoshikiEnhanced