From 86b421c790e88c2fbb5866bf5a43051213077cb3 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Fri, 30 Jan 2026 17:14:03 +0300 Subject: [PATCH] feat: setup TypeScript with configuration and type definitions --- package-lock.json | 33 +++++++++++++++++++++++++++++++++ package.json | 3 +++ src/vite-env.d.ts | 1 + tsconfig.json | 20 ++++++++++++++++++++ 4 files changed, 57 insertions(+) create mode 100644 src/vite-env.d.ts create mode 100644 tsconfig.json diff --git a/package-lock.json b/package-lock.json index 2f287a5..8fdf854 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,7 @@ "cloudcli": "server/cli.js" }, "devDependencies": { + "@types/node": "^22.19.7", "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@vitejs/plugin-react": "^4.6.0", @@ -79,6 +80,7 @@ "release-it": "^19.0.5", "sharp": "^0.34.2", "tailwindcss": "^3.4.0", + "typescript": "^5.9.3", "vite": "^7.0.4" } }, @@ -2906,6 +2908,16 @@ "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "license": "MIT" }, + "node_modules/@types/node": { + "version": "22.19.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.7.tgz", + "integrity": "sha512-MciR4AKGHWl7xwxkBa6xUGxQJ4VBOmPTF7sL+iGzuahOFaO0jHCsuEfS80pan1ef4gWId1oWOweIhrDEYLuaOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, "node_modules/@types/parse-path": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/@types/parse-path/-/parse-path-7.0.3.tgz", @@ -11662,6 +11674,20 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "license": "MIT" }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uglify-js": { "version": "3.19.3", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", @@ -11686,6 +11712,13 @@ "node": ">=18.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/unified": { "version": "11.0.5", "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", diff --git a/package.json b/package.json index fdc47ae..d2858e5 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "client": "vite --host", "build": "vite build", "preview": "vite preview", + "typecheck": "tsc --noEmit -p tsconfig.json", "start": "npm run build && npm run server", "release": "./release.sh" }, @@ -96,6 +97,7 @@ "ws": "^8.14.2" }, "devDependencies": { + "@types/node": "^22.19.7", "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@vitejs/plugin-react": "^4.6.0", @@ -107,6 +109,7 @@ "release-it": "^19.0.5", "sharp": "^0.34.2", "tailwindcss": "^3.4.0", + "typescript": "^5.9.3", "vite": "^7.0.4" } } diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..86012e5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true, + "checkJs": true, + "types": ["vite/client"] + }, + "include": ["src", "shared", "vite.config.js"] +}