Update tsconfig: bundler resolution & path mappings

Switch moduleResolution to "bundler" in base and package tsconfigs and consolidate path aliases for monorepo packages. Remove several package-level baseUrl entries and update package paths to reference ../../packages/* (add explicit napcat-common/src and napcat-image-size/src mappings). Also add a rootDir override for napcat-core. These changes unify module resolution and path aliases so TypeScript and bundlers resolve workspace packages consistently.
This commit is contained in:
手瓜一十雪
2026-05-21 19:16:44 +08:00
parent b058604077
commit 33cc11ba84
6 changed files with 77 additions and 19 deletions
+8 -3
View File
@@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2021",
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"lib": [
"ES2021"
],
@@ -34,10 +34,15 @@
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"napcat-common/src/*": [
"../../packages/napcat-common/src/*"
],
"napcat-image-size/src/*": [
"../../packages/napcat-image-size/src/*"
],
"@/*": [
"../*"
"../../packages/*"
]
},
"skipLibCheck": true,
+1 -1
View File
@@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
+1 -2
View File
@@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2021",
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"lib": [
"ES2021"
],
@@ -34,7 +34,6 @@
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"baseUrl": ".",
"skipLibCheck": true,
"skipDefaultLibCheck": true
},
+1 -2
View File
@@ -4,10 +4,9 @@
"outDir": "./dist",
"rootDir": "./src",
"noEmit": true,
"baseUrl": ".",
"paths": {
"@/*": [
"../*/"
"../../packages/*"
]
}
},
+13 -8
View File
@@ -3,7 +3,6 @@
"compilerOptions": {
"outDir": "./dist",
"rootDir": "..",
"baseUrl": ".",
"declaration": true,
"emitDeclarationOnly": true,
"skipLibCheck": true,
@@ -11,25 +10,31 @@
"noEmitOnError": false,
"paths": {
"napcat-core": [
"../napcat-core/index.ts"
"../../packages/napcat-core/index.ts"
],
"napcat-onebot": [
"../napcat-onebot/index.ts"
"../../packages/napcat-onebot/index.ts"
],
"napcat-common/src/*": [
"../../packages/napcat-common/src/*"
],
"napcat-image-size/src/*": [
"../../packages/napcat-image-size/src/*"
],
"@/napcat-core/*": [
"../napcat-core/*"
"../../packages/napcat-core/*"
],
"@/napcat-onebot/*": [
"../napcat-onebot/*"
"../../packages/napcat-onebot/*"
],
"@/napcat-common/*": [
"../napcat-common/*"
"../../packages/napcat-common/*"
],
"@/napcat-webui-backend/*": [
"../napcat-webui-backend/*"
"../../packages/napcat-webui-backend/*"
],
"@/*": [
"../*"
"../../packages/*"
]
}
},
+53 -3
View File
@@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2021",
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"lib": [
"ES2021"
],
@@ -30,10 +30,60 @@
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"napcat-core": [
"./packages/napcat-core/index.ts"
],
"napcat-core/*": [
"./packages/napcat-core/*"
],
"napcat-onebot": [
"./packages/napcat-onebot/index.ts"
],
"napcat-onebot/*": [
"./packages/napcat-onebot/*"
],
"napcat-common": [
"./packages/napcat-common/src/index.ts"
],
"napcat-common/src/*": [
"./packages/napcat-common/src/*"
],
"napcat-image-size": [
"./packages/napcat-image-size/src/index.ts"
],
"napcat-image-size/src/*": [
"./packages/napcat-image-size/src/*"
],
"napcat-database": [
"./packages/napcat-database/src/index.ts"
],
"napcat-database/src/*": [
"./packages/napcat-database/src/*"
],
"napcat-protocol": [
"./packages/napcat-protocol/index.ts"
],
"napcat-protocol/*": [
"./packages/napcat-protocol/*"
],
"napcat-qrcode": [
"./packages/napcat-qrcode/index.ts"
],
"napcat-qrcode/*": [
"./packages/napcat-qrcode/*"
],
"napcat-webui-backend": [
"./packages/napcat-webui-backend/index.ts"
],
"napcat-webui-backend/*": [
"./packages/napcat-webui-backend/*"
],
"napcat-pty": [
"./packages/napcat-pty/node-pty.d.ts"
],
"@/*": [
"packages/*"
"./packages/*"
]
},
"skipLibCheck": true,