From cff5e3488e14d5ef52052b9618d387d9a6d09367 Mon Sep 17 00:00:00 2001 From: Vladimir Zagainov Date: Thu, 19 Jun 2025 00:49:17 +0300 Subject: [PATCH] fix(buidl): fixed build --- package-lock.json | 18 ++++++++++++++++++ package.json | 1 + src/api/auth.ts | 2 +- src/router/index.ts | 2 +- src/stores/auth.ts | 2 +- tsconfig.node.json | 21 +++++---------------- vite.config.ts | 4 ++-- 7 files changed, 29 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2ddc2c9..16b39cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "vue-router": "^4.5.1" }, "devDependencies": { + "@types/node": "^20.14.9", "@vitejs/plugin-vue": "^5.2.3", "@vue/tsconfig": "^0.7.0", "typescript": "~5.8.3", @@ -786,6 +787,16 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/node": { + "version": "20.19.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.1.tgz", + "integrity": "sha512-jJD50LtlD2dodAEO653i3YF04NWak6jN3ky+Ri3Em3mGR39/glWiboM/IePaRbgwSfqM1TpGXfAg8ohn/4dTgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, "node_modules/@types/stats.js": { "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz", @@ -1777,6 +1788,13 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, "node_modules/vite": { "version": "6.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", diff --git a/package.json b/package.json index 6714109..ad40882 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "vue-router": "^4.5.1" }, "devDependencies": { + "@types/node": "^20.14.9", "@vitejs/plugin-vue": "^5.2.3", "@vue/tsconfig": "^0.7.0", "typescript": "~5.8.3", diff --git a/src/api/auth.ts b/src/api/auth.ts index aa913c0..7b5de10 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -1,4 +1,4 @@ -import type { RegisterRequest } from "@/types"; +import type { RegisterRequest, LoginRequest, LoginResponse } from "@/types"; import apiClient from "./axios"; export const registerUser = (userData: RegisterRequest) => { diff --git a/src/router/index.ts b/src/router/index.ts index 2408f07..3d16e72 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -59,7 +59,7 @@ const router = createRouter({ routes, }); -router.beforeEach((to, from, next) => { +router.beforeEach((to, _from, next) => { const authStore = useAuthStore(); if (to.meta.requiresAuth && !authStore.isAuthenticated) { next({ name: "login" }); diff --git a/src/stores/auth.ts b/src/stores/auth.ts index 46bac7f..728d079 100644 --- a/src/stores/auth.ts +++ b/src/stores/auth.ts @@ -2,7 +2,7 @@ import { defineStore } from "pinia"; import { ref, computed } from "vue"; import { registerUser as apiRegisterUser, loginUser as apiLoginUser } from "@/api/auth"; import { getUserProfile as apiGetUserProfile } from "@/api/user"; -import type { RegisterRequest } from "@/types"; +import type { RegisterRequest, User, LoginRequest } from "@/types"; import router from "@/router"; import apiClient from "@/api/axios"; diff --git a/tsconfig.node.json b/tsconfig.node.json index 9728af2..90edf4b 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -1,25 +1,14 @@ { "compilerOptions": { + "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "target": "ES2022", - "lib": ["ES2023"], - "module": "ESNext", "skipLibCheck": true, - - /* Bundler mode */ + "module": "ESNext", "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "verbatimModuleSyntax": true, - "moduleDetection": "force", - "noEmit": true, - - /* Linting */ + "target": "ES2022", + "allowSyntheticDefaultImports": true, "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "erasableSyntaxOnly": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true + "types": ["node"] }, "include": ["vite.config.ts"] } diff --git a/vite.config.ts b/vite.config.ts index 5b45a85..d1597b9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,13 +1,13 @@ import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; -import path from "path"; +import { URL, fileURLToPath } from "node:url"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], resolve: { alias: { - "@": path.resolve(__dirname, "./src"), + "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, server: {