updating nuxt and fixing errors

This commit is contained in:
2023-09-01 22:21:38 +02:00
parent 13af88dd7c
commit 0ce808ac19
20 changed files with 177 additions and 272 deletions

3
.gitignore vendored
View File

@@ -25,6 +25,3 @@ logs
# Vercel
.vercel
# VSCode
.vscode

20
.vscode/settings.json vendored
View File

@@ -1,4 +1,5 @@
{
// TailwindCSS
"files.associations": {
"*.css": "tailwindcss"
},
@@ -13,5 +14,24 @@
"tailwindCSS.classAttributes": [
"class",
"ui"
],
// Prettier & ESLint
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}

View File

@@ -1,4 +1,9 @@
export default defineNuxtConfig({
experimental: {
typedPages: true,
componentIslands: true,
},
srcDir: 'src',
build: {
@@ -33,10 +38,6 @@ export default defineNuxtConfig({
'components/resume',
],
tailwindcss: {
viewer: true,
},
ui: {
icons: 'all',
},

View File

@@ -11,7 +11,7 @@
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@nuxt/content": "2.8.1",
"@nuxt/content": "2.8.2",
"@nuxt/image": "1.0.0-rc.1",
"@pinia/nuxt": "0.4.11",
"@prisma/client": "5.2.0",
@@ -25,13 +25,13 @@
"superjson": "1.13.1",
"tailwindcss": "3.3.3",
"trpc-nuxt": "0.10.12",
"valibot": "0.13.1"
"zod": "^3.22.2"
},
"devDependencies": {
"@antfu/eslint-config": "0.41.0",
"@iconify/json": "2.2.108",
"@iconify/json": "2.2.109",
"@nuxt/devtools": "0.8.2",
"@nuxthq/studio": "^0.13.4",
"@nuxthq/studio": "0.13.4",
"@nuxthq/ui": "2.7.0",
"@pinia-plugin-persistedstate/nuxt": "1.1.1",
"@types/node": "20.5.7",

132
pnpm-lock.yaml generated
View File

@@ -4,6 +4,9 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
'@nuxt/content':
specifier: 2.8.2
@@ -50,7 +53,6 @@ dependencies:
zod:
specifier: ^3.22.2
version: 3.22.2
devDependencies:
'@antfu/eslint-config':
specifier: 0.41.0
@@ -82,9 +84,6 @@ devDependencies:
eslint:
specifier: 8.48.0
version: 8.48.0
lint-staged:
specifier: 14.0.1
version: 14.0.1
nuxt:
specifier: 3.7.0
version: 3.7.0(@types/node@20.5.7)(eslint@8.48.0)(sass@1.66.1)(typescript@5.2.2)
@@ -3077,13 +3076,6 @@ packages:
type-fest: 0.21.3
dev: true
/ansi-escapes@5.0.0:
resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==}
engines: {node: '>=12'}
dependencies:
type-fest: 1.4.0
dev: true
/ansi-regex@5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
@@ -3679,21 +3671,6 @@ packages:
engines: {node: '>=10'}
dev: true
/cli-cursor@4.0.0:
resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
restore-cursor: 4.0.0
dev: true
/cli-truncate@3.1.0:
resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
slice-ansi: 5.0.0
string-width: 5.1.2
dev: true
/clipboardy@3.0.0:
resolution: {integrity: sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
@@ -3779,11 +3756,6 @@ packages:
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
dev: false
/commander@11.0.0:
resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==}
engines: {node: '>=16'}
dev: true
/commander@2.20.3:
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
@@ -4941,10 +4913,6 @@ packages:
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
engines: {node: '>= 0.6'}
/eventemitter3@5.0.1:
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
dev: true
/events@3.3.0:
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
engines: {node: '>=0.8.x'}
@@ -6010,11 +5978,6 @@ packages:
engines: {node: '>=8'}
dev: true
/is-fullwidth-code-point@4.0.0:
resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==}
engines: {node: '>=12'}
dev: true
/is-generator-function@1.0.10:
resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==}
engines: {node: '>= 0.4'}
@@ -6387,26 +6350,6 @@ packages:
/lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
/lint-staged@14.0.1:
resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==}
engines: {node: ^16.14.0 || >=18.0.0}
hasBin: true
dependencies:
chalk: 5.3.0
commander: 11.0.0
debug: 4.3.4
execa: 7.2.0
lilconfig: 2.1.0
listr2: 6.6.1
micromatch: 4.0.5
pidtree: 0.6.0
string-argv: 0.3.2
yaml: 2.3.1
transitivePeerDependencies:
- enquirer
- supports-color
dev: true
/listhen@1.4.4:
resolution: {integrity: sha512-xoZWbfziou7xPWj9nlFXeroFTJZVIyJ6wKrLea2jxvWgMkcz/vLMoZACYHLRmcLGi5hZkcDF48tmkmv1Y6Y42Q==}
hasBin: true
@@ -6428,23 +6371,6 @@ packages:
untun: 0.1.2
uqr: 0.1.2
/listr2@6.6.1:
resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==}
engines: {node: '>=16.0.0'}
peerDependencies:
enquirer: '>= 2.3.0 < 3'
peerDependenciesMeta:
enquirer:
optional: true
dependencies:
cli-truncate: 3.1.0
colorette: 2.0.20
eventemitter3: 5.0.1
log-update: 5.0.1
rfdc: 1.3.0
wrap-ansi: 8.1.0
dev: true
/loader-runner@4.3.0:
resolution: {integrity: sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==}
engines: {node: '>=6.11.5'}
@@ -6548,17 +6474,6 @@ packages:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
dev: true
/log-update@5.0.1:
resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
ansi-escapes: 5.0.0
cli-cursor: 4.0.0
slice-ansi: 5.0.0
strip-ansi: 7.1.0
wrap-ansi: 8.1.0
dev: true
/longest-streak@3.1.0:
resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==}
dev: false
@@ -8376,12 +8291,6 @@ packages:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
/pidtree@0.6.0:
resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
engines: {node: '>=0.10'}
hasBin: true
dev: true
/pify@2.3.0:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'}
@@ -9328,14 +9237,6 @@ packages:
path-parse: 1.0.7
supports-preserve-symlinks-flag: 1.0.0
/restore-cursor@4.0.0:
resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
onetime: 5.1.2
signal-exit: 3.0.7
dev: true
/retry@0.12.0:
resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==}
engines: {node: '>= 4'}
@@ -9345,10 +9246,6 @@ packages:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
/rfdc@1.3.0:
resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==}
dev: true
/rimraf@3.0.2:
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
hasBin: true
@@ -9641,14 +9538,6 @@ packages:
resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==}
engines: {node: '>=12'}
/slice-ansi@5.0.0:
resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==}
engines: {node: '>=12'}
dependencies:
ansi-styles: 6.2.1
is-fullwidth-code-point: 4.0.0
dev: true
/slugify@1.6.6:
resolution: {integrity: sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==}
engines: {node: '>=8.0.0'}
@@ -9799,11 +9688,6 @@ packages:
dev: false
optional: true
/string-argv@0.3.2:
resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==}
engines: {node: '>=0.6.19'}
dev: true
/string-width@4.2.3:
resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
engines: {node: '>=8'}
@@ -10308,11 +10192,6 @@ packages:
engines: {node: '>=8'}
dev: true
/type-fest@1.4.0:
resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
engines: {node: '>=10'}
dev: true
/type-fest@2.19.0:
resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
engines: {node: '>=12.20'}
@@ -11273,11 +11152,6 @@ packages:
engines: {node: '>= 6'}
dev: true
/yaml@2.3.1:
resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==}
engines: {node: '>= 14'}
dev: true
/yaml@2.3.2:
resolution: {integrity: sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg==}
engines: {node: '>= 14'}

View File

@@ -1,3 +0,0 @@
packages:
- 'src/**'
- '.nuxt/**'

View File

@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
datasource db {

View File

@@ -37,7 +37,9 @@ const { getColor, setColor } = useColorStore()
:variant="color === getColor ? 'solid' : 'ghost'"
@click.stop.prevent="setColor(color)"
>
<span class="inline-block w-3 h-3 rounded-full" :class="`bg-${color}-500`" />
<span class="flex items-center justify-center w-4 h-4 rounded-[4px] border text-white" :class="`bg-${color}-500/80 border-${color}-500`">
<UIcon v-if="color === getColor" name="i-ic-round-check" />
</span>
</UButton>
</UTooltip>
</div>

View File

@@ -1,5 +1,9 @@
<script setup lang="ts">
const error = useError()
import type { NuxtError } from 'nuxt/app'
defineProps({
error: Object as () => NuxtError,
})
const appConfig = useAppConfig()
const getColor = computed(() => appConfig.ui.primary)
</script>
@@ -8,10 +12,10 @@ const getColor = computed(() => appConfig.ui.primary)
<NuxtLayout name="default">
<div class="flex flex-col items-center gap-4 mt-12">
<h1 class="font-medium text-[8rem] md:text-[16rem] leading-none bg-error bg-clip-text tracking-wider font-error" :class="`text-${getColor}-500`">
{{ error.statusCode }}
{{ error?.statusCode }}
</h1>
<p class="text-lg md:text-2xl text-subtitle text-center">
Sorry, {{ error.statusCode === 404
Sorry, {{ error?.statusCode === 404
? "the page you are looking for doesn't exist or as been moved."
: "you have encountered a problem."
}}

View File

@@ -4,17 +4,19 @@ const getColor = computed(() => appConfig.ui.primary)
</script>
<template>
<div>
<NuxtLoadingIndicator :color="getColor" />
<section class="fixed inset-0 flex justify-center sm:px-8">
<div class="flex w-full max-w-7xl">
<div class="w-full bg-white ring-1 ring-zinc-100 dark:bg-zinc-900 dark:ring-zinc-300/20" />
</div>
</section>
<div class="relative z-50">
<div class="relative z-50 min-h-[100svh]">
<Header />
<UContainer>
<slot />
<NuxtPage />
</UContainer>
<Footer />
</div>
</div>
</template>

View File

@@ -1,3 +1,4 @@
import process from 'node:process'
import { loggerLink } from '@trpc/client'
import SuperJSON from 'superjson'
import { createTRPCNuxtClient, httpBatchLink } from 'trpc-nuxt/client'

View File

@@ -1,3 +1,4 @@
import process from 'node:process'
import { PrismaClient } from '@prisma/client/edge'
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient }

View File

@@ -1,6 +1,6 @@
import type { inferAsyncReturnType } from '@trpc/server'
import type { H3Event } from 'h3'
import { prisma } from '~/server/prisma'
import { prisma } from '../prisma'
export function createContext(_event: H3Event) {
return {

View File

@@ -1,4 +1,4 @@
import { publicProcedure, router } from '~/server/trpc/trpc'
import { publicProcedure, router } from '../trpc'
export default router({
get: publicProcedure

View File

@@ -1,8 +1,8 @@
import announcement from '~/server/trpc/routers/announcement'
import maintenance from '~/server/trpc/routers/maintenance'
import talents from '~/server/trpc/routers/talents'
import post from '~/server/trpc/routers/post'
import { router } from '~/server/trpc/trpc'
import { router } from '../trpc'
import announcement from './announcement'
import maintenance from './maintenance'
import post from './post'
import talents from './talents'
export const appRouter = router({
announcement,

View File

@@ -1,4 +1,4 @@
import { publicProcedure, router } from '~/server/trpc/trpc'
import { publicProcedure, router } from '../trpc'
export default router({
get: publicProcedure

View File

@@ -1,8 +1,8 @@
import { object, string } from 'valibot'
import { publicProcedure, router } from '~/server/trpc/trpc'
import { z } from 'zod'
import { publicProcedure, router } from '../trpc'
const PostSchema = object({
slug: string(),
const PostSchema = z.object({
slug: z.string(),
})
export default router({

View File

@@ -1,11 +1,11 @@
import { boolean, literal, object, string, union } from 'valibot'
import { publicProcedure, router } from '~/server/trpc/trpc'
import { z } from 'zod'
import { publicProcedure, router } from '../trpc'
export default router({
getTalents: publicProcedure
.input(object({
favorite: boolean(),
category: union([string(), literal('all')]),
.input(z.object({
favorite: z.boolean(),
category: z.union([z.string(), z.literal('all')]),
}))
.query(async ({ ctx, input }) => {
if (input.favorite) {

View File

@@ -1,6 +1,6 @@
import { initTRPC } from '@trpc/server'
import SuperJSON from 'superjson'
import type { Context } from '~/server/trpc/context'
import type { Context } from './context'
const trpc = initTRPC.context<Context>().create({
transformer: SuperJSON,

View File

@@ -1,7 +1,7 @@
import type { Config } from 'tailwindcss'
import { ColorsTheme } from './types'
export default <Partial<Config>>{
export default {
safelist: [
// Theme text colors
...Object.values(ColorsTheme).map(color => `text-${color}-500`),
@@ -12,6 +12,11 @@ export default <Partial<Config>>{
...Object.values(ColorsTheme).map(color => `bg-${color}-500`),
...Object.values(ColorsTheme).map(color => `hover:bg-${color}-500`),
...'text-black dark:text-white'.split(' '),
// Theme border colors
...Object.values(ColorsTheme).map(color => `border-${color}-500`),
...Object.values(ColorsTheme).map(color => `hover:border-${color}-500`),
...'border-black dark:border-white'.split(' '),
],
theme: {
extend: {
@@ -20,4 +25,4 @@ export default <Partial<Config>>{
},
},
},
}
} satisfies Partial<Config>