feat: update dependencies and enhance API documentation in Nuxt configuration

This commit is contained in:
ccbikai 2025-05-20 19:27:27 +08:00
parent 9106881448
commit 55753ec8bc
5 changed files with 4668 additions and 5232 deletions

View file

@ -61,9 +61,25 @@ export default defineNuxtConfig({
nitro: { nitro: {
experimental: { experimental: {
// Enable Server API documentation within NuxtHub
openAPI: true, openAPI: true,
}, },
timing: true,
openAPI: {
production: 'runtime',
meta: {
title: 'Sink API',
description: 'A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.',
},
route: '/_docs/openapi.json',
ui: {
scalar: {
route: '/_docs/scalar',
},
swagger: {
route: '/_docs/swagger',
},
},
},
}, },
hub: { hub: {

View file

@ -3,7 +3,7 @@
"type": "module", "type": "module",
"version": "0.1.11", "version": "0.1.11",
"private": true, "private": true,
"packageManager": "pnpm@9.15.1", "packageManager": "pnpm@10.11.0",
"engines": { "engines": {
"node": ">=20.11" "node": ">=20.11"
}, },
@ -23,52 +23,52 @@
}, },
"dependencies": { "dependencies": {
"@intlify/message-compiler": "^11.1.3", "@intlify/message-compiler": "^11.1.3",
"@number-flow/vue": "^0.3.3", "@number-flow/vue": "^0.4.7",
"@unovis/ts": "^1.5.0", "@unovis/ts": "^1.5.1",
"@unovis/vue": "^1.5.0", "@unovis/vue": "^1.5.1",
"@vee-validate/zod": "^4.15.0", "@vee-validate/zod": "^4.15.0",
"@vueuse/core": "^12.2.0", "@vueuse/core": "^13.2.0",
"@vueuse/motion": "^3.0.3", "@vueuse/motion": "^3.0.3",
"d3-scale": "^4.0.2", "d3-scale": "^4.0.2",
"d3-scale-chromatic": "^3.1.0", "d3-scale-chromatic": "^3.1.0",
"fuse.js": "^7.0.0", "fuse.js": "^7.1.0",
"globe.gl": "^2.41.4", "globe.gl": "^2.41.4",
"intl-parse-accept-language": "^1.0.0", "intl-parse-accept-language": "^1.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"lucide-vue-next": "^0.469.0", "lucide-vue-next": "^0.511.0",
"mysql-bricks": "^1.1.2", "mysql-bricks": "^2.0.0",
"nanoid": "^5.0.9", "nanoid": "^5.1.5",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
"qr-code-styling": "1.6.0-rc.1", "qr-code-styling": "^1.9.2",
"radix-vue": "^1.9.11", "radix-vue": "^1.9.17",
"ua-parser-js": "^2.0.3", "ua-parser-js": "^2.0.3",
"vaul-vue": "^0.3.0", "vaul-vue": "^0.4.1",
"vee-validate": "^4.15.0", "vee-validate": "^4.15.0",
"virtua": "^0.39.2", "virtua": "^0.41.2",
"vue-sonner": "^1.3.0", "vue-sonner": "^1.3.2",
"vue3-simple-icons": "^13.2.0", "vue3-simple-icons": "^13.2.0",
"zod": "^3.24.1" "zod": "^3.25.7"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^3.12.1", "@antfu/eslint-config": "^4.13.1",
"@nuxt/eslint": "^0.7.4", "@nuxt/eslint": "^1.4.1",
"@nuxt/eslint-config": "^0.7.4", "@nuxt/eslint-config": "^1.4.1",
"@nuxthub/core": "0.7.11", "@nuxthub/core": "^0.8.27",
"@nuxtjs/color-mode": "^3.5.2", "@nuxtjs/color-mode": "^3.5.2",
"@nuxtjs/i18n": "^9.0.0", "@nuxtjs/i18n": "^9.5.4",
"@nuxtjs/tailwindcss": "^6.12.2", "@nuxtjs/tailwindcss": "^6.14.0",
"@vueuse/integrations": "^12.2.0", "@vueuse/integrations": "^13.2.0",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"eslint": "^9.17.0", "eslint": "^9.27.0",
"lint-staged": "^15.2.11", "lint-staged": "^16.0.0",
"nuxt": "~3.13.2", "nuxt": "^3.17.3",
"shadcn-nuxt": "^0.11.3", "shadcn-nuxt": "^2.1.0",
"simple-git-hooks": "^2.11.1", "simple-git-hooks": "^2.13.0",
"tailwind-merge": "^2.6.0", "tailwind-merge": "^3.3.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"vue-tsc": "^2.2.0", "vue-tsc": "^2.2.10",
"wrangler": "^3.99.0" "wrangler": "^4.15.2"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "npm run lint-staged" "pre-commit": "npm run lint-staged"

File diff suppressed because it is too large Load diff

5
pnpm-workspace.yaml Normal file
View file

@ -0,0 +1,5 @@
onlyBuiltDependencies:
- sharp
- simple-git-hooks
- unrs-resolver
- workerd

View file

@ -1,5 +1,5 @@
export default eventHandler((event) => { export default eventHandler((event) => {
const token = getHeader(event, 'Authorization')?.replace('Bearer ', '') const token = getHeader(event, 'Authorization')?.replace(/^Bearer\s+/, '')
if (event.path.startsWith('/api/') && !event.path.startsWith('/api/_') && token !== useRuntimeConfig(event).siteToken) { if (event.path.startsWith('/api/') && !event.path.startsWith('/api/_') && token !== useRuntimeConfig(event).siteToken) {
throw createError({ throw createError({
status: 401, status: 401,