diff --git a/components.json b/components.json index ac20ed7..e4952ff 100644 --- a/components.json +++ b/components.json @@ -10,6 +10,9 @@ }, "aliases": { "components": "@/components", - "utils": "@/utils" + "utils": "@/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "composables": "@/composables" } } diff --git a/nuxt.config.ts b/nuxt.config.ts index 907214c..c49b4cd 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -53,8 +53,6 @@ export default defineNuxtConfig({ }, }, - sourcemap: false, - future: { compatibilityVersion: 4, }, diff --git a/package.json b/package.json index a8add35..6f932e6 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/server/api/link/create.post.ts b/server/api/link/create.post.ts index 439c0ab..ff24e41 100644 --- a/server/api/link/create.post.ts +++ b/server/api/link/create.post.ts @@ -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) diff --git a/server/api/location.ts b/server/api/location.ts index febd742..507f061 100644 --- a/server/api/location.ts +++ b/server/api/location.ts @@ -1,7 +1,11 @@ defineRouteMeta({ openAPI: { description: 'Get the location of the user', - security: securitySchemes, + responses: { + 200: { + description: 'The location of the user', + }, + }, }, }) diff --git a/server/api/verify.ts b/server/api/verify.ts index 1481c94..e6a60e6 100644 --- a/server/api/verify.ts +++ b/server/api/verify.ts @@ -1,7 +1,6 @@ defineRouteMeta({ openAPI: { description: 'Verify the site token', - security: securitySchemes, responses: { 200: { description: 'The site token is valid', diff --git a/server/utils/openapi.ts b/server/utils/openapi.ts deleted file mode 100644 index 453fac0..0000000 --- a/server/utils/openapi.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const securitySchemes = [{ - type: 'http', - scheme: 'bearer', - description: 'The site\'s token', -}] diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 0000000..defa90e --- /dev/null +++ b/wrangler.jsonc @@ -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 + } + ] +} diff --git a/wrangler.toml b/wrangler.toml deleted file mode 100644 index d0d85d5..0000000 --- a/wrangler.toml +++ /dev/null @@ -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"