diff --git a/package.json b/package.json index a7cf20a..2e10f8e 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,10 @@ "scripts": { "start": "node src/index.js", "canvas": "node src/server.js", - "build": "vite build", + "build": "npm run build:frontend && npm run build:types", + "build:frontend": "vite build", + "build:types": "npx tsc --emitDeclarationOnly", + "build:server": "npx tsc", "dev": "concurrently \"npm run canvas\" \"vite\"", "production": "npm run build && npm run canvas", "prepublishOnly": "npm run build" @@ -30,8 +33,10 @@ "zod-to-json-schema": "^3.22.3" }, "devDependencies": { + "@types/node": "^20.19.7", "@vitejs/plugin-react": "^4.6.0", "concurrently": "^9.2.0", + "typescript": "^5.8.3", "vite": "^6.3.5" }, "keywords": [ @@ -72,6 +77,7 @@ "files": [ "src/**/*", "dist/**/*", + "*.d.ts", "README.md", "LICENSE" ] diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..7bcf949 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,38 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "node", + "allowJs": true, + "checkJs": false, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist", + "rootDir": "./src", + "strict": false, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmitOnError": false, + "preserveConstEnums": true, + "removeComments": false, + "types": ["node"] + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "node_modules", + "dist", + "frontend", + "**/*.test.js", + "**/*.spec.js" + ], + "ts-node": { + "esm": true + } +} \ No newline at end of file