chore: update project configuration and dependencies

- Adds new path aliases for improved code organization
- Updates dependencies to latest versions including vue-sonner v2.0.0
- Removes sourcemap configuration from Nuxt config
- Enhances API documentation with OpenAPI schemas
- Removes unused security schemes and Wrangler configuration

These changes modernize the project setup while improving documentation and removing unnecessary configurations.
This commit is contained in:
ccbikai 2025-05-22 19:41:25 +08:00
parent e933a6cfd5
commit 0b9960b5d8
9 changed files with 68 additions and 38 deletions

View file

@ -10,6 +10,9 @@
},
"aliases": {
"components": "@/components",
"utils": "@/utils"
"utils": "@/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"composables": "@/composables"
}
}

View file

@ -53,8 +53,6 @@ export default defineNuxtConfig({
},
},
sourcemap: false,
future: {
compatibilityVersion: 4,
},

View file

@ -45,12 +45,12 @@
"vaul-vue": "^0.4.1",
"vee-validate": "^4.15.0",
"virtua": "^0.41.2",
"vue-sonner": "^1.3.2",
"vue-sonner": "^2.0.0",
"vue3-simple-icons": "^13.2.0",
"zod": "^3.25.7"
"zod": "^3.25.20"
},
"devDependencies": {
"@antfu/eslint-config": "^4.13.1",
"@antfu/eslint-config": "^4.13.2",
"@nuxt/eslint": "^1.4.1",
"@nuxt/eslint-config": "^1.4.1",
"@nuxthub/core": "^0.8.27",
@ -62,13 +62,13 @@
"clsx": "^2.1.1",
"eslint": "^9.27.0",
"lint-staged": "^16.0.0",
"nuxt": "^3.17.3",
"nuxt": "^3.17.4",
"shadcn-nuxt": "^2.1.0",
"simple-git-hooks": "^2.13.0",
"tailwind-merge": "^3.3.0",
"tailwindcss-animate": "^1.0.7",
"vue-tsc": "^2.2.10",
"wrangler": "^4.15.2"
"wrangler": "^4.16.1"
},
"simple-git-hooks": {
"pre-commit": "npm run lint-staged"

View file

@ -1,5 +1,29 @@
import { LinkSchema } from '@@/schemas/link'
defineRouteMeta({
openAPI: {
description: 'Create a new short link',
requestBody: {
required: true,
content: {
'application/json': {
// Need: https://github.com/nitrojs/nitro/issues/2974
schema: {
type: 'object',
required: ['url'],
properties: {
url: {
type: 'string',
description: 'The URL to shorten',
},
},
},
},
},
},
},
})
export default eventHandler(async (event) => {
const link = await readValidatedBody(event, LinkSchema.parse)

View file

@ -1,7 +1,11 @@
defineRouteMeta({
openAPI: {
description: 'Get the location of the user',
security: securitySchemes,
responses: {
200: {
description: 'The location of the user',
},
},
},
})

View file

@ -1,7 +1,6 @@
defineRouteMeta({
openAPI: {
description: 'Verify the site token',
security: securitySchemes,
responses: {
200: {
description: 'The site token is valid',

View file

@ -1,5 +0,0 @@
export const securitySchemes = [{
type: 'http',
scheme: 'bearer',
description: 'The site\'s token',
}]

30
wrangler.jsonc Normal file
View file

@ -0,0 +1,30 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "sink",
"main": "dist/server/index.mjs",
"assets": {
"binding": "ASSETS",
"directory": "dist/public"
},
"compatibility_date": "2025-05-08",
"compatibility_flags": [
"nodejs_compat"
],
"keep_vars": true,
"upload_source_maps": true,
"ai": {
"binding": "AI"
},
"analytics_engine_datasets": [
{
"binding": "ANALYTICS",
"dataset": "sink"
}
],
"kv_namespaces": [
{
"binding": "KV",
"id": "ef93d42dc4b34969bab404d2e80f8dd3" // IMPORTANT: Change this to your KV namespace ID
}
]
}

View file

@ -1,23 +0,0 @@
name = "sink"
main = "dist/server/index.mjs"
compatibility_date = "2025-05-08"
compatibility_flags = [ "nodejs_compat" ]
keep_vars = true
[dev]
port = 3000
[assets]
directory = "dist/public"
binding = "ASSETS"
[ai]
binding = "AI"
[[kv_namespaces]]
binding = "KV"
id = "ef93d42dc4b34969bab404d2e80f8dd3"
[[analytics_engine_datasets]]
binding = "ANALYTICS"
dataset = "sink"