update to nuxt 4

This commit is contained in:
DecDuck
2025-09-20 11:20:49 +10:00
parent b4f9b77809
commit 2db8e753b7
313 changed files with 508 additions and 512 deletions

View File

@ -1,7 +1,7 @@
@import "tailwindcss"; @import "tailwindcss";
@plugin "@tailwindcss/typography"; @plugin "@tailwindcss/typography";
@plugin "@tailwindcss/forms"; @plugin "@tailwindcss/forms";
@config "../tailwind.config.js"; @config "../../tailwind.config.js";
@layer base { @layer base {
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-outer-spin-button,

View File

@ -86,7 +86,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { XCircleIcon } from "@heroicons/vue/20/solid"; import { XCircleIcon } from "@heroicons/vue/20/solid";
import type { UserModel } from "~/prisma/client/models"; import type { UserModel } from "~~/prisma/client/models";
const username = ref(""); const username = ref("");
const password = ref(""); const password = ref("");

View File

@ -35,7 +35,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { GameModel } from "~/prisma/client/models"; import type { GameModel } from "~~/prisma/client/models";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
const props = defineProps<{ const props = defineProps<{

View File

@ -444,7 +444,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { GameModel, GameTagModel } from "~/prisma/client/models"; import type { GameModel, GameTagModel } from "~~/prisma/client/models";
import { micromark } from "micromark"; import { micromark } from "micromark";
import { import {
CheckIcon, CheckIcon,

View File

@ -77,7 +77,7 @@ const {
}> }>
| undefined | undefined
| null; | null;
href?: string; href?: string | undefined;
showTitleDescription?: boolean; showTitleDescription?: boolean;
animate?: boolean; animate?: boolean;
defaultPlaceholder?: boolean; defaultPlaceholder?: boolean;

View File

@ -16,7 +16,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { GameMetadataSearchResult } from "~/server/internal/metadata/types"; import type { GameMetadataSearchResult } from "~~/server/internal/metadata/types";
const { game } = defineProps<{ const { game } = defineProps<{
game: Omit<GameMetadataSearchResult, "year"> & { sourceName?: string }; game: Omit<GameMetadataSearchResult, "year"> & { sourceName?: string };

View File

@ -9,14 +9,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { HardwarePlatform } from "~/prisma/client/enums"; import { HardwarePlatform } from "~~/prisma/client/enums";
import type { Component } from "vue"; import type { Component } from "vue";
import LinuxLogo from "./LinuxLogo.vue"; import LinuxLogo from "./LinuxLogo.vue";
import WindowsLogo from "./WindowsLogo.vue"; import WindowsLogo from "./WindowsLogo.vue";
import MacLogo from "./MacLogo.vue"; import MacLogo from "./MacLogo.vue";
import DropLogo from "../DropLogo.vue"; import DropLogo from "../DropLogo.vue";
const props = defineProps<{ platform: string; fallback?: string }>(); const props = defineProps<{ platform: string; fallback?: string | undefined }>();
const platformIcons: { [key in HardwarePlatform]: Component } = { const platformIcons: { [key in HardwarePlatform]: Component } = {
[HardwarePlatform.Linux]: LinuxLogo, [HardwarePlatform.Linux]: LinuxLogo,

View File

@ -191,7 +191,7 @@ import {
import { XCircleIcon } from "@heroicons/vue/16/solid"; import { XCircleIcon } from "@heroicons/vue/16/solid";
import { ChevronUpDownIcon } from "@heroicons/vue/20/solid"; import { ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { MagnifyingGlassIcon } from "@heroicons/vue/24/outline"; import { MagnifyingGlassIcon } from "@heroicons/vue/24/outline";
import type { GameMetadataSearchResult } from "~/server/internal/metadata/types"; import type { GameMetadataSearchResult } from "~~/server/internal/metadata/types";
const model = ref<GameMetadataSearchResult | undefined>(undefined); const model = ref<GameMetadataSearchResult | undefined>(undefined);

View File

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

View File

@ -15,7 +15,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { TaskLog } from "~/server/internal/tasks"; import type { TaskLog } from "~~/server/internal/tasks";
defineProps<{ log: typeof TaskLog.infer; short?: boolean }>(); defineProps<{ log: typeof TaskLog.infer; short?: boolean }>();

View File

@ -162,7 +162,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import type { GameModel } from "~/prisma/client/models"; import type { GameModel } from "~~/prisma/client/models";
import { import {
DialogTitle, DialogTitle,
Listbox, Listbox,
@ -171,7 +171,7 @@ import {
ListboxOption, ListboxOption,
ListboxOptions, ListboxOptions,
} from "@headlessui/vue"; } from "@headlessui/vue";
import type { GameMetadataSearchResult } from "~/server/internal/metadata/types"; import type { GameMetadataSearchResult } from "~~/server/internal/metadata/types";
import { FetchError } from "ofetch"; import { FetchError } from "ofetch";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import { XCircleIcon } from "@heroicons/vue/24/solid"; import { XCircleIcon } from "@heroicons/vue/24/solid";
@ -208,7 +208,7 @@ const { t } = useI18n();
const open = defineModel<boolean>({ required: true }); const open = defineModel<boolean>({ required: true });
const currentGame = ref<(typeof metadataGames.value)[number]>(); const currentGame = ref<NonNullable<(typeof metadataGames.value)[number]> | null>(null);
const developed = ref(false); const developed = ref(false);
const published = ref(false); const published = ref(false);
const addGameLoading = ref(false); const addGameLoading = ref(false);
@ -236,7 +236,7 @@ async function addGame() {
throw e; throw e;
} }
} finally { } finally {
currentGame.value = undefined; currentGame.value = null;
developed.value = false; developed.value = false;
published.value = false; published.value = false;
addGameLoading.value = false; addGameLoading.value = false;

View File

@ -46,7 +46,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { DialogTitle } from "@headlessui/vue"; import { DialogTitle } from "@headlessui/vue";
import type { CollectionEntryModel, GameModel } from "~/prisma/client/models"; import type { CollectionEntryModel, GameModel } from "~~/prisma/client/models";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
const props = defineProps<{ const props = defineProps<{

View File

@ -110,7 +110,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { CompanyModel } from "~/prisma/client/models"; import type { CompanyModel } from "~~/prisma/client/models";
const open = defineModel<boolean>({ required: true }); const open = defineModel<boolean>({ required: true });

View File

@ -45,7 +45,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import { DialogTitle } from "@headlessui/vue"; import { DialogTitle } from "@headlessui/vue";
import type { GameTagModel } from "~/prisma/client/models"; import type { GameTagModel } from "~~/prisma/client/models";
const emit = defineEmits<{ const emit = defineEmits<{
created: [tag: GameTagModel]; created: [tag: GameTagModel];

View File

@ -35,7 +35,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { CollectionModel } from "~/prisma/client/models"; import type { CollectionModel } from "~~/prisma/client/models";
import { DialogTitle } from "@headlessui/vue"; import { DialogTitle } from "@headlessui/vue";
const collection = defineModel<CollectionModel | undefined>(); const collection = defineModel<CollectionModel | undefined>();

View File

@ -36,7 +36,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { DialogTitle } from "@headlessui/vue"; import { DialogTitle } from "@headlessui/vue";
import type { UserModel } from "~/prisma/client/models"; import type { UserModel } from "~~/prisma/client/models";
const user = defineModel<UserModel | undefined>(); const user = defineModel<UserModel | undefined>();
const deleteLoading = ref(false); const deleteLoading = ref(false);

View File

@ -44,7 +44,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { XMarkIcon } from "@heroicons/vue/24/solid"; import { XMarkIcon } from "@heroicons/vue/24/solid";
import type { NotificationModel } from "~/prisma/client/models"; import type { NotificationModel } from "~~/prisma/client/models";
const props = defineProps<{ notification: NotificationModel }>(); const props = defineProps<{ notification: NotificationModel }>();

View File

@ -4,7 +4,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import type { RedistModel, UserPlatformModel } from "~/prisma/client/models"; import type { RedistModel, UserPlatformModel } from "~~/prisma/client/models";
type ModelType = SerializeObject< type ModelType = SerializeObject<
RedistModel & { platform?: UserPlatformModel } RedistModel & { platform?: UserPlatformModel }

View File

@ -5,7 +5,7 @@
</template> </template>
<script setup lang="ts"> <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 }); const complete = defineModel<boolean>({ required: true });
// Only runs on component load, so it's fine // Only runs on component load, so it's fine

View File

@ -365,7 +365,7 @@ import {
Squares2X2Icon, Squares2X2Icon,
} from "@heroicons/vue/20/solid"; } from "@heroicons/vue/20/solid";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import type { GameModel, GameTagModel } from "~/prisma/client/models"; import type { GameModel, GameTagModel } from "~~/prisma/client/models";
import MultiItemSelector from "./MultiItemSelector.vue"; import MultiItemSelector from "./MultiItemSelector.vue";
const { showGamePanelTextDecoration } = await $dropFetch(`/api/v1/settings`); const { showGamePanelTextDecoration } = await $dropFetch(`/api/v1/settings`);

View File

@ -49,7 +49,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { CheckCircleIcon, XMarkIcon } from "@heroicons/vue/24/solid"; import { CheckCircleIcon, XMarkIcon } from "@heroicons/vue/24/solid";
import type { TaskMessage } from "~/server/internal/tasks"; import type { TaskMessage } from "~~/server/internal/tasks";
defineProps<{ task: TaskMessage | undefined; active?: boolean }>(); defineProps<{ task: TaskMessage | undefined; active?: boolean }>();
</script> </script>

View File

@ -46,7 +46,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { NotificationModel } from "~/prisma/client/models"; import type { NotificationModel } from "~~/prisma/client/models";
const props = defineProps<{ notifications: Array<NotificationModel> }>(); const props = defineProps<{ notifications: Array<NotificationModel> }>();
</script> </script>

View File

@ -81,8 +81,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue"; import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/vue";
import { ChevronDownIcon } from "@heroicons/vue/16/solid"; import { ChevronDownIcon } from "@heroicons/vue/16/solid";
import { useObject } from "~/composables/objects";
import type { NavigationItem } from "~/composables/types";
const user = useUser(); const user = useUser();

View File

@ -2,7 +2,7 @@ import type {
CollectionModel, CollectionModel,
CollectionEntryModel, CollectionEntryModel,
GameModel, GameModel,
} from "~/prisma/client/models"; } from "~~/prisma/client/models";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
type FullCollection = CollectionModel & { type FullCollection = CollectionModel & {

View File

@ -1,4 +1,4 @@
import type { ArticleModel } from "~/prisma/client/models"; import type { ArticleModel } from "~~/prisma/client/models";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
export const useNews = () => export const useNews = () =>

View File

@ -1,4 +1,4 @@
import type { NotificationModel } from "~/prisma/client/models"; import type { NotificationModel } from "~~/prisma/client/models";
const ws = new WebSocketHandler("/api/v1/notifications/ws"); const ws = new WebSocketHandler("/api/v1/notifications/ws");

View File

@ -1,5 +1,5 @@
import type { UserPlatform } from "~/prisma/client/client"; import type { UserPlatform } from "~~/prisma/client/client";
import { HardwarePlatform } from "~/prisma/client/enums"; import { HardwarePlatform } from "~~/prisma/client/enums";
export type PlatformRenderable = { export type PlatformRenderable = {
name: string; name: string;

View File

@ -1,4 +1,4 @@
import type { TaskMessage } from "~/server/internal/tasks"; import type { TaskMessage } from "~~/server/internal/tasks";
import { WebSocketHandler } from "./ws"; import { WebSocketHandler } from "./ws";
const websocketHandler = new WebSocketHandler("/api/v1/task"); const websocketHandler = new WebSocketHandler("/api/v1/task");

View File

@ -1,4 +1,4 @@
import type { UserModel } from "~/prisma/client/models"; import type { UserModel } from "~~/prisma/client/models";
// undefined = haven't check // undefined = haven't check
// null = check, no user // null = check, no user

View File

@ -1,6 +1,6 @@
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import type { UserModel } from "~/prisma/client/models"; import type { UserModel } from "~~/prisma/client/models";
import type { AuthMec } from "~/prisma/client/enums"; import type { AuthMec } from "~~/prisma/client/enums";
export const useUsers = () => export const useUsers = () =>
useState< useState<

View File

@ -166,8 +166,6 @@ import {
RectangleStackIcon, RectangleStackIcon,
DocumentIcon, DocumentIcon,
} from "@heroicons/vue/24/outline"; } from "@heroicons/vue/24/outline";
import type { NavigationItem } from "~/composables/types";
import { useCurrentNavigationIndex } from "~/composables/current-page-engine";
import { ArrowLeftIcon } from "@heroicons/vue/16/solid"; import { ArrowLeftIcon } from "@heroicons/vue/16/solid";
import { XMarkIcon } from "@heroicons/vue/24/solid"; import { XMarkIcon } from "@heroicons/vue/24/solid";

View File

@ -92,7 +92,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { CheckIcon, TrashIcon } from "@heroicons/vue/24/outline"; import { CheckIcon, TrashIcon } from "@heroicons/vue/24/outline";
import type { NotificationModel } from "~/prisma/client/models"; import type { NotificationModel } from "~~/prisma/client/models";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
definePageMeta({ definePageMeta({

View File

@ -463,7 +463,7 @@ import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { PlusIcon, TrashIcon } from "@heroicons/vue/24/outline"; import { PlusIcon, TrashIcon } from "@heroicons/vue/24/outline";
import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/vue/24/solid"; import { ChevronDownIcon, ChevronUpIcon } from "@heroicons/vue/24/solid";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import type { ImportVersion } from "~/server/api/v1/admin/import/version/index.post"; import type { ImportVersion } from "~~/server/api/v1/admin/import/version/index.post";
definePageMeta({ definePageMeta({
layout: "admin", layout: "admin",

View File

@ -219,7 +219,7 @@ import {
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid"; import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
import { PuzzlePieceIcon, ArchiveBoxIcon } from "@heroicons/vue/24/solid"; import { PuzzlePieceIcon, ArchiveBoxIcon } from "@heroicons/vue/24/solid";
import type { FetchError } from "ofetch"; import type { FetchError } from "ofetch";
import type { GameMetadataSearchResult } from "~/server/internal/metadata/types"; import type { GameMetadataSearchResult } from "~~/server/internal/metadata/types";
definePageMeta({ definePageMeta({
layout: "admin", layout: "admin",

View File

@ -316,8 +316,8 @@ import {
import { BackwardIcon, CheckIcon, XMarkIcon } from "@heroicons/vue/24/outline"; import { BackwardIcon, CheckIcon, XMarkIcon } from "@heroicons/vue/24/outline";
import { FetchError } from "ofetch"; import { FetchError } from "ofetch";
import type { Component } from "vue"; import type { Component } from "vue";
import type { LibraryBackend } from "~/prisma/client/enums"; import type { LibraryBackend } from "~~/prisma/client/enums";
import type { WorkingLibrarySource } from "~/server/api/v1/admin/library/sources/index.get"; import type { WorkingLibrarySource } from "~~/server/api/v1/admin/library/sources/index.get";
definePageMeta({ definePageMeta({
layout: "admin", layout: "admin",

View File

@ -238,7 +238,7 @@
import { MagnifyingGlassIcon } from "@heroicons/vue/24/outline"; import { MagnifyingGlassIcon } from "@heroicons/vue/24/outline";
import { ArrowUpTrayIcon, PencilIcon, PlusIcon } from "@heroicons/vue/24/solid"; import { ArrowUpTrayIcon, PencilIcon, PlusIcon } from "@heroicons/vue/24/solid";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import type { GameModel } from "~/prisma/client/models"; import type { GameModel } from "~~/prisma/client/models";
definePageMeta({ definePageMeta({
layout: "admin", layout: "admin",

View File

@ -106,7 +106,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { MagnifyingGlassIcon } from "@heroicons/vue/24/outline"; import { MagnifyingGlassIcon } from "@heroicons/vue/24/outline";
import type { CompanyModel } from "~/prisma/client/models"; import type { CompanyModel } from "~~/prisma/client/models";
const { t } = useI18n(); const { t } = useI18n();

View File

@ -39,7 +39,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { TrashIcon } from "@heroicons/vue/24/outline"; import { TrashIcon } from "@heroicons/vue/24/outline";
import type { SerializeObject } from "nitropack"; import type { SerializeObject } from "nitropack";
import type { GameTagModel } from "~/prisma/client/models"; import type { GameTagModel } from "~~/prisma/client/models";
definePageMeta({ definePageMeta({
layout: "admin", layout: "admin",

Some files were not shown because too many files have changed in this diff Show More