Enhance build process and add TypeScript configuration
- Update package.json to include separate build scripts for frontend and types, and add a build server script. - Introduce tsconfig.json for TypeScript configuration, enabling declaration files and source maps. - Add TypeScript and Node types as development dependencies. - Include TypeScript declaration files in the package distribution.
This commit is contained in:
+7
-1
@@ -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"
|
||||
]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user