Quellcode durchsuchen

Fix TypeScript build errors in webui

Remove unused Card import in TimeSlotsEditor, use import.meta.url
instead of __dirname in vite.config.ts, and add @types/node to
devDependencies for Node.js type definitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fszontagh vor 2 Monaten
Ursprung
Commit
2644d1639f

+ 73 - 0
webui/package-lock.json

@@ -19,6 +19,7 @@
                 "zustand": "^5.0.10"
             },
             "devDependencies": {
+                "@types/node": "^22.15.0",
                 "@types/react": "^19.2.5",
                 "@types/react-dom": "^19.2.3",
                 "@vitejs/plugin-react": "^5.1.1",
@@ -1313,6 +1314,60 @@
                 "node": ">=14.0.0"
             }
         },
+        "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": {
+            "version": "1.7.1",
+            "inBundle": true,
+            "license": "MIT",
+            "optional": true,
+            "dependencies": {
+                "@emnapi/wasi-threads": "1.1.0",
+                "tslib": "^2.4.0"
+            }
+        },
+        "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": {
+            "version": "1.7.1",
+            "inBundle": true,
+            "license": "MIT",
+            "optional": true,
+            "dependencies": {
+                "tslib": "^2.4.0"
+            }
+        },
+        "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
+            "version": "1.1.0",
+            "inBundle": true,
+            "license": "MIT",
+            "optional": true,
+            "dependencies": {
+                "tslib": "^2.4.0"
+            }
+        },
+        "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": {
+            "version": "1.1.0",
+            "inBundle": true,
+            "license": "MIT",
+            "optional": true,
+            "dependencies": {
+                "@emnapi/core": "^1.7.1",
+                "@emnapi/runtime": "^1.7.1",
+                "@tybys/wasm-util": "^0.10.1"
+            }
+        },
+        "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": {
+            "version": "0.10.1",
+            "inBundle": true,
+            "license": "MIT",
+            "optional": true,
+            "dependencies": {
+                "tslib": "^2.4.0"
+            }
+        },
+        "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": {
+            "version": "2.8.1",
+            "inBundle": true,
+            "license": "0BSD",
+            "optional": true
+        },
         "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
             "version": "4.1.18",
             "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.18.tgz",
@@ -1436,6 +1491,17 @@
             "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
             "license": "MIT"
         },
+        "node_modules/@types/node": {
+            "version": "22.19.9",
+            "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.9.tgz",
+            "integrity": "sha512-PD03/U8g1F9T9MI+1OBisaIARhSzeidsUjQaf51fOxrfjeiKN9bLVO06lHuHYjxdnqLWJijJHfqXPSJri2EM2A==",
+            "devOptional": true,
+            "license": "MIT",
+            "peer": true,
+            "dependencies": {
+                "undici-types": "~6.21.0"
+            }
+        },
         "node_modules/@types/react": {
             "version": "19.2.13",
             "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.13.tgz",
@@ -2318,6 +2384,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==",
+            "devOptional": true,
+            "license": "MIT"
+        },
         "node_modules/update-browserslist-db": {
             "version": "1.2.3",
             "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",

+ 1 - 0
webui/package.json

@@ -20,6 +20,7 @@
         "zustand": "^5.0.10"
     },
     "devDependencies": {
+        "@types/node": "^22.15.0",
         "@types/react": "^19.2.5",
         "@types/react-dom": "^19.2.3",
         "@vitejs/plugin-react": "^5.1.1",

+ 0 - 1
webui/src/pages/calendar/TimeSlotsEditor.tsx

@@ -2,7 +2,6 @@ import { useState, type FormEvent } from "react";
 import { useParams, useNavigate } from "react-router-dom";
 import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
 import { ArrowLeft, Plus, Pencil, Trash2 } from "lucide-react";
-import { Card } from "@/components/ui/Card";
 import { Button } from "@/components/ui/Button";
 import { Modal } from "@/components/ui/Modal";
 import { Spinner } from "@/components/ui/Spinner";

+ 1 - 0
webui/tsconfig.node.json

@@ -3,6 +3,7 @@
         "target": "ES2022",
         "lib": ["ES2023"],
         "module": "ESNext",
+        "types": ["node"],
         "skipLibCheck": true,
         "moduleResolution": "bundler",
         "allowImportingTsExtensions": true,

+ 2 - 2
webui/vite.config.ts

@@ -1,13 +1,13 @@
 import { defineConfig } from "vite";
 import react from "@vitejs/plugin-react";
 import tailwindcss from "@tailwindcss/vite";
-import { resolve } from "path";
+import { fileURLToPath, URL } from "node:url";
 
 export default defineConfig({
     plugins: [react(), tailwindcss()],
     resolve: {
         alias: {
-            "@": resolve(__dirname, "src"),
+            "@": fileURLToPath(new URL("./src", import.meta.url)),
         },
     },
     server: {