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 @@