From 1ae051f06663b4a318c7a6684dc905b3d6c8fe4c Mon Sep 17 00:00:00 2001 From: Husky <39809509+Huskydog9988@users.noreply.github.com> Date: Fri, 25 Jul 2025 07:28:00 -0400 Subject: [PATCH] Update Prisma to 6.11 (#133) * chore: update prisma to 6.11 more prisma future proofing due to experimental features * chore: update dependencies twemoji - new unicode update argon2 - bux fixes vue3-carousel - improve mobile experiance vue-tsc - more stable * fix: incorrect prisma version in docker Also remove default value for BUILD_DROP_VERSION, that is now handled in nuxt config * fix: no logging in prod * chore: optimize docker builds even more * fix: revert adoption of prisma driverAdapters see: https://github.com/prisma/prisma/issues/27486 * chore: optimize dockerignore some more * Fix `pino-pretty` not being included in build (#135) * Remove `pino` from frontend * Fix for downloads and removing of library source (#136) * fix: downloads and removing library source * fix: linting * Fix max file size of 4GB (update droplet) (#137) * Fix manual metadata import (#138) * chore(deps): bump vue-i18n from 10.0.7 to 10.0.8 (#140) Bumps [vue-i18n](https://github.com/intlify/vue-i18n/tree/HEAD/packages/vue-i18n) from 10.0.7 to 10.0.8. - [Release notes](https://github.com/intlify/vue-i18n/releases) - [Changelog](https://github.com/intlify/vue-i18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/intlify/vue-i18n/commits/v10.0.8/packages/vue-i18n) --- updated-dependencies: - dependency-name: vue-i18n dependency-version: 10.0.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump @intlify/core from 10.0.7 to 10.0.8 (#139) --- updated-dependencies: - dependency-name: "@intlify/core" dependency-version: 10.0.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Small fixes (#141) * fix: save task as Json rather than string * fix: pull objects before creating game in database * fix: strips relative dirs from version information * fix: #132 * fix: lint * fix: news object ids and small tweaks * fix: notification styling errors * fix: lint * fix: build issues by regenerating lockfile --------- Signed-off-by: dependabot[bot] Co-authored-by: DecDuck Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .dockerignore | 14 +- Dockerfile | 11 +- components/Auth/Simple.vue | 4 +- components/CreateCollectionModal.vue | 4 +- components/DeleteCollectionModal.vue | 4 +- components/DeleteUserModal.vue | 4 +- components/GameCarousel.vue | 6 +- components/GameEditor/Metadata.vue | 12 +- components/GameEditor/Version.vue | 8 +- components/NotificationItem.vue | 4 +- .../UserHeader/NotificationWidgetPanel.vue | 4 +- composables/collection.ts | 10 +- composables/news.ts | 4 +- composables/notifications.ts | 6 +- composables/user.ts | 6 +- composables/users.ts | 5 +- nuxt.config.ts | 2 +- package.json | 15 +- pages/account/notifications.vue | 16 +- pages/admin/library/sources/index.vue | 2 +- pages/admin/users/auth/index.vue | 2 +- pages/admin/users/auth/simple/index.vue | 4 +- pages/admin/users/index.vue | 4 +- pages/auth/signin.vue | 2 +- pages/library/index.vue | 4 +- pages/news/index.vue | 4 +- prisma/schema.prisma | 5 +- server/api/v1/admin/auth/index.get.ts | 2 +- server/api/v1/admin/game/metadata.post.ts | 2 +- .../api/v1/admin/library/sources/index.get.ts | 4 +- .../v1/admin/library/sources/index.post.ts | 2 +- server/api/v1/auth/signin/simple.post.ts | 2 +- server/api/v1/auth/signup/simple.post.ts | 2 +- .../[gameid]/[slotindex]/index.delete.ts | 2 +- .../saves/[gameid]/[slotindex]/index.get.ts | 2 +- .../saves/[gameid]/[slotindex]/push.post.ts | 2 +- .../api/v1/client/saves/[gameid]/index.get.ts | 2 +- .../v1/client/saves/[gameid]/index.post.ts | 2 +- server/api/v1/client/saves/index.get.ts | 2 +- server/api/v1/client/saves/settings.get.ts | 2 +- server/api/v1/client/user/webtoken.post.ts | 2 +- server/api/v1/user/token/[id]/index.delete.ts | 2 +- server/api/v1/user/token/index.get.ts | 2 +- server/api/v1/user/token/index.post.ts | 2 +- server/internal/acls/index.ts | 2 +- server/internal/auth/index.ts | 2 +- server/internal/auth/oidc/index.ts | 6 +- server/internal/clients/capabilities.ts | 2 +- server/internal/clients/event-handler.ts | 6 +- server/internal/clients/handler.ts | 2 +- .../config/application-configuration.ts | 14 +- server/internal/db/database.ts | 8 +- server/internal/downloads/manifest.ts | 4 +- server/internal/library/provider.ts | 2 +- .../internal/library/providers/filesystem.ts | 2 +- server/internal/library/providers/flat.ts | 2 +- server/internal/logging/index.ts | 7 +- server/internal/metadata/giantbomb.ts | 7 +- server/internal/metadata/igdb.ts | 8 +- server/internal/metadata/index.ts | 3 +- server/internal/metadata/manual.ts | 2 +- server/internal/metadata/pcgamingwiki.ts | 8 +- server/internal/notifications/index.ts | 13 +- server/internal/utils/parseplatform.ts | 2 +- server/plugins/05.library-init.ts | 2 +- yarn.lock | 3401 +++++++++-------- 66 files changed, 1942 insertions(+), 1765 deletions(-) diff --git a/.dockerignore b/.dockerignore index 4078721..615017f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,9 @@ +Dockerfile +.github +.vscode +*.md + +#### gitignore below # Nuxt dev/build outputs .output .data @@ -24,8 +30,14 @@ logs .env.* !.env.example +.data + + # deploy template -deploy-template/ +deploy-template/* + +!deploy-template/compose.yml # generated prisma client /prisma/client +/prisma/validate diff --git a/Dockerfile b/Dockerfile index 3ac6b7a..19e6a84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM node:lts-alpine AS deps WORKDIR /app COPY package.json yarn.lock ./ -RUN yarn install --network-timeout 1000000 --ignore-scripts +RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --network-timeout 1000000 --ignore-scripts # Build for app FROM node:lts-alpine AS build-system @@ -13,6 +13,7 @@ WORKDIR /app ENV NODE_ENV=production ENV NUXT_TELEMETRY_DISABLED=1 +ENV YARN_CACHE_FOLDER=/root/.yarn # add git so drop can determine its git ref at build RUN apk add --no-cache git @@ -21,12 +22,12 @@ RUN apk add --no-cache git COPY --from=deps /app/node_modules ./node_modules COPY . . -ARG BUILD_DROP_VERSION="v0.0.0-unknown.1" +ARG BUILD_DROP_VERSION ARG BUILD_GIT_REF # build -RUN yarn postinstall -RUN yarn build +RUN --mount=type=cache,target=/root/.yarn yarn postinstall && \ + yarn build # create run environment for Drop FROM node:lts-alpine AS run-system @@ -35,7 +36,7 @@ WORKDIR /app ENV NODE_ENV=production ENV NUXT_TELEMETRY_DISABLED=1 -RUN yarn add --network-timeout 1000000 --no-lockfile prisma@6.7.0 +RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn add --network-timeout 1000000 --no-lockfile --ignore-scripts prisma@6.11.1 COPY --from=build-system /app/package.json ./ COPY --from=build-system /app/.output ./app diff --git a/components/Auth/Simple.vue b/components/Auth/Simple.vue index e2dfebc..7324467 100644 --- a/components/Auth/Simple.vue +++ b/components/Auth/Simple.vue @@ -86,7 +86,7 @@ diff --git a/components/CreateCollectionModal.vue b/components/CreateCollectionModal.vue index 62dd59b..e38230e 100644 --- a/components/CreateCollectionModal.vue +++ b/components/CreateCollectionModal.vue @@ -46,7 +46,7 @@ diff --git a/composables/collection.ts b/composables/collection.ts index 64b5ad2..98d1ed8 100644 --- a/composables/collection.ts +++ b/composables/collection.ts @@ -1,8 +1,12 @@ -import type { Collection, CollectionEntry, Game } from "~/prisma/client"; +import type { + CollectionModel, + CollectionEntryModel, + GameModel, +} from "~/prisma/client/models"; import type { SerializeObject } from "nitropack"; -type FullCollection = Collection & { - entries: Array }>; +type FullCollection = CollectionModel & { + entries: Array }>; }; export const useCollections = async () => { diff --git a/composables/news.ts b/composables/news.ts index cec5e4a..7179bf5 100644 --- a/composables/news.ts +++ b/composables/news.ts @@ -1,11 +1,11 @@ -import type { Article } from "~/prisma/client"; +import type { ArticleModel } from "~/prisma/client/models"; import type { SerializeObject } from "nitropack"; export const useNews = () => useState< | Array< SerializeObject< - Article & { + ArticleModel & { tags: Array<{ id: string; name: string }>; author: { displayName: string; id: string } | null; } diff --git a/composables/notifications.ts b/composables/notifications.ts index 44d2832..ede125b 100644 --- a/composables/notifications.ts +++ b/composables/notifications.ts @@ -1,12 +1,12 @@ -import type { Notification } from "~/prisma/client"; +import type { NotificationModel } from "~/prisma/client/models"; const ws = new WebSocketHandler("/api/v1/notifications/ws"); export const useNotifications = () => - useState>("notifications", () => []); + useState>("notifications", () => []); ws.listen((e) => { - const notification = JSON.parse(e) as Notification; + const notification = JSON.parse(e) as NotificationModel; const notifications = useNotifications(); notifications.value.push(notification); }); diff --git a/composables/user.ts b/composables/user.ts index ae604da..6851398 100644 --- a/composables/user.ts +++ b/composables/user.ts @@ -1,13 +1,13 @@ -import type { User } from "~/prisma/client"; +import type { UserModel } from "~/prisma/client/models"; // undefined = haven't check // null = check, no user // {} = check, user -export const useUser = () => useState(undefined); +export const useUser = () => useState(undefined); export const updateUser = async () => { const user = useUser(); if (user.value === null) return; - user.value = await $dropFetch("/api/v1/user"); + user.value = await $dropFetch("/api/v1/user"); }; diff --git a/composables/users.ts b/composables/users.ts index 28761c5..8e44c6a 100644 --- a/composables/users.ts +++ b/composables/users.ts @@ -1,11 +1,12 @@ import type { SerializeObject } from "nitropack"; -import type { User, AuthMec } from "~/prisma/client"; +import type { UserModel } from "~/prisma/client/models"; +import type { AuthMec } from "~/prisma/client/enums"; export const useUsers = () => useState< | Array< SerializeObject< - User & { + UserModel & { authMecs?: Array<{ id: string; mec: AuthMec }>; } > diff --git a/nuxt.config.ts b/nuxt.config.ts index 8b09e3a..e3384e1 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -280,7 +280,7 @@ function getDropVersion(): string { path.dirname(import.meta.url.replace("file://", "")), "package.json", ); - console.log(`Reading package.json from ${packageJsonPath}`); + if (!existsSync(packageJsonPath)) { console.error("Could not find package.json, using default version."); return defaultVersion; diff --git a/package.json b/package.json index db98221..479038f 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "lint:fix": "eslint . --fix && prettier --write --list-different ." }, "dependencies": { - "@discordapp/twemoji": "^15.1.0", + "@discordapp/twemoji": "^16.0.1", "@drop-oss/droplet": "1.6.0", "@headlessui/vue": "^1.7.23", "@heroicons/vue": "^2.1.5", @@ -25,9 +25,9 @@ "@nuxt/fonts": "^0.11.0", "@nuxt/image": "^1.10.0", "@nuxtjs/i18n": "^9.5.5", - "@prisma/client": "^6.7.0", + "@prisma/client": "^6.11.1", "@tailwindcss/vite": "^4.0.6", - "argon2": "^0.41.1", + "argon2": "^0.43.0", "arktype": "^2.1.10", "axios": "^1.7.7", "bcryptjs": "^3.0.2", @@ -43,7 +43,7 @@ "nuxt-security": "2.2.0", "pino": "^9.7.0", "pino-pretty": "^13.0.0", - "prisma": "^6.7.0", + "prisma": "^6.11.1", "sanitize-filename": "^1.6.3", "semver": "^7.7.1", "stream-mime-type": "^2.0.0", @@ -52,7 +52,7 @@ "vite-plugin-static-copy": "^3.0.0", "vue": "latest", "vue-router": "latest", - "vue3-carousel": "^0.15.0", + "vue3-carousel": "^0.16.0", "vue3-carousel-nuxt": "^1.1.5", "vuedraggable": "^4.1.0" }, @@ -72,17 +72,16 @@ "h3": "^1.15.3", "nitropack": "^2.11.12", "ofetch": "^1.4.1", - "postcss": "^8.4.47", "prettier": "^3.5.3", "sass": "^1.79.4", "tailwindcss": "^4.0.0", "typescript": "^5.8.3", - "vue-tsc": "^2.2.8" + "vue-tsc": "^3.0.1" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", "overrides": { "vue3-carousel-nuxt": { - "vue3-carousel": "^0.15.0" + "vue3-carousel": "^0.16.0" } }, "prisma": { diff --git a/pages/account/notifications.vue b/pages/account/notifications.vue index 9b83be5..f625ab4 100644 --- a/pages/account/notifications.vue +++ b/pages/account/notifications.vue @@ -92,7 +92,7 @@ diff --git a/pages/auth/signin.vue b/pages/auth/signin.vue index 813b1c7..4feba93 100644 --- a/pages/auth/signin.vue +++ b/pages/auth/signin.vue @@ -43,7 +43,7 @@