fix: fixes for Nuxt v4 update

This commit is contained in:
DecDuck
2025-09-25 09:15:29 +10:00
parent 2db8e753b7
commit 55878bdf5f
12 changed files with 1086 additions and 1407 deletions

View File

@ -92,7 +92,7 @@ import type { Locale } from "vue-i18n";
const { showText = true } = defineProps<{ showText?: boolean }>();
const { availableLocales, locale: currLocale, setLocale } = useI18n();
const { locale: currLocale, setLocale, locales } = useI18n();
function changeLocale(locale: Locale) {
setLocale(locale);
@ -102,7 +102,7 @@ function changeLocale(locale: Locale) {
useHead({
htmlAttrs: {
lang: locale,
// dir: availableLocales.find((l) => l === locale)?.dir || "ltr",
dir: locales.value.find((l) => l.code === locale)?.dir || "ltr",
},
});
}
@ -150,6 +150,6 @@ const wiredLocale = computed({
},
});
const currentLocaleInformation = computed(() =>
availableLocales.find((e) => e == wiredLocale.value),
locales.value.find((e) => e.code == wiredLocale.value),
);
</script>

View File

@ -106,7 +106,7 @@ const emit = defineEmits<{
}>();
const props = defineProps<{
value?: string;
value?: string | undefined;
guesses?: Array<{ platform: PlatformRenderable; filename: string }>;
}>();

View File

@ -5,7 +5,7 @@
</template>
<script setup lang="ts">
import AdminSourcesPage from "~~/pages/admin/library/sources/index.vue";
import AdminSourcesPage from "~/pages/admin/library/sources/index.vue";
const complete = defineModel<boolean>({ required: true });
// Only runs on component load, so it's fine

View File

@ -1,10 +1,10 @@
<template>
<div v-if="!noWrapper" class="flex flex-col w-full min-h-screen bg-zinc-900">
<UserHeader class="z-50" hydrate-on-idle />
<LazyUserHeader class="z-50" hydrate-on-idle />
<div class="grow flex">
<NuxtPage />
</div>
<UserFooter class="z-50" hydrate-on-interaction />
<LazyUserFooter class="z-50" hydrate-on-interaction />
</div>
<div v-else class="flex w-full min-h-screen bg-zinc-900">
<NuxtPage />

View File

@ -252,7 +252,8 @@
>Uninstall command</label
>
<p class="text-zinc-400 text-xs">
Executable to be run on uninstalling a game. Useful for installer-only games.
Executable to be run on uninstalling a game. Useful for installer-only
games.
</p>
<div class="mt-2">
<div
@ -301,7 +302,8 @@
</SwitchDescription>
</span>
<Switch
v-model="versionSettings.delta"
:model-value="versionSettings.delta || false"
@update:model-value="(v) => (versionSettings.delta = v)"
:class="[
versionSettings.delta ? 'bg-blue-600' : 'bg-zinc-800',
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2',
@ -489,7 +491,6 @@ const versionGuesses =
Array<SerializeObject<{ platform: PlatformRenderable; filename: string }>>
>();
function updateLaunchCommand(idx: number, value: string) {
versionSettings.value.launches![idx].launchCommand = value;
autosetPlatform(value);

View File

@ -44,7 +44,6 @@
<script setup lang="ts">
import type { AuthMec } from "~~/prisma/client/enums";
import DropLogo from "~~/components/DropLogo.vue";
const { t } = useI18n();
const enabledAuths = await $dropFetch("/api/v1/auth");

View File

@ -19,6 +19,7 @@ export default withNuxt([
},
],
"@intlify/vue-i18n/no-missing-keys": "error",
"vue/multi-word-component-names": "ignore",
},
settings: {
"vue-i18n": {

View File

@ -18,6 +18,7 @@ const twemojiJson = module.findPackageJSON(
if (!twemojiJson) {
throw new Error("Could not find @discordapp/twemoji package.");
}
const svgSrcDir = path.join(path.dirname(twemojiJson), "dist", "svg");
// get drop version
const dropVersion = getDropVersion();
@ -74,14 +75,13 @@ export default defineNuxtConfig({
vite: {
plugins: [
// eslint-disable-next-line @typescript-eslint/no-explicit-any
tailwindcss() as any,
tailwindcss(),
// only used in dev server, not build because nitro sucks
// see build hook below
viteStaticCopy({
targets: [
{
src: "node_modules/@discordapp/twemoji/dist/svg/*",
src: `${svgSrcDir}/*`,
dest: "twemoji",
},
],
@ -96,7 +96,7 @@ export default defineNuxtConfig({
// https://github.com/nuxt/nuxt/issues/18918#issuecomment-1925774964
// copy emojis to .output/public/twemoji
const targetDir = path.join(nitro.options.output.publicDir, "twemoji");
cpSync(path.join(path.dirname(twemojiJson), "dist", "svg"), targetDir, {
cpSync(svgSrcDir, targetDir, {
recursive: true,
});
},

View File

@ -24,7 +24,6 @@
"@drop-oss/droplet": "3.0.1",
"@headlessui/vue": "^1.7.23",
"@heroicons/vue": "^2.1.5",
"@lobomfz/prismark": "0.0.3",
"@nuxt/fonts": "^0.11.0",
"@nuxt/image": "^1.10.0",
"@nuxtjs/i18n": "^9.5.5",
@ -40,7 +39,7 @@
"fast-fuzzy": "^1.12.0",
"file-type-mime": "^0.4.3",
"jdenticon": "^3.3.0",
"jsdom": "^26.1.0",
"jsdom": "^27.0.0",
"luxon": "^3.6.1",
"micromark": "^4.0.1",
"normalize-url": "^8.0.2",
@ -48,7 +47,7 @@
"nuxt-security": "2.2.0",
"pino": "^9.7.0",
"pino-pretty": "^13.0.0",
"prisma": "^6.14.0",
"prisma": "^6.11.1",
"sanitize-filename": "^1.6.3",
"semver": "^7.7.1",
"stream-mime-type": "^2.0.0",
@ -88,5 +87,8 @@
"vue3-carousel": "^0.16.0"
}
},
"prisma": {
"schema": "./prisma"
},
"packageManager": "pnpm@10.15.0+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b"
}

2439
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
import { defineConfig } from "prisma/config";
import path from "node:path";
export default defineConfig({
schema: path.join("prisma", "schema.prisma"),
});

View File

@ -10,15 +10,6 @@ generator client {
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
/**
* generator arktype {
* provider = "yarn prismark"
* output = "./validate"
* fileName = "schema.ts"
* nullish = true
* }
*/
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")