Removed custom build scripts for copying and inlining types, consolidating all post-build logic into a single enhanced post-build.mjs script. The new script processes .d.ts files, inlines external module types, updates imports, and copies necessary files to dist, eliminating the need for external-shims and simplifying the build process. Updated package.json scripts accordingly. Refactor type inlining: remove shims, auto-extract types Removed external-shims.d.ts and its references, replacing manual shims with an automated script that extracts type definitions from node_modules. Updated build scripts, dependencies, and test files to support the new inlining process. The inline-types.mjs script now scans for external imports, generates inline type files, and rewrites imports as import type, eliminating the need for hand-written shims. Add type inlining script and update build process Introduced a new script (inline-types.mjs) to inline external type dependencies into the dist directory, updated the build process to use this script, and removed the now-unnecessary external-shims.d.ts from the copy-dist script. Added a test file to verify inlined types, updated dependencies to include ts-morph, and adjusted package.json and pnpm-lock.yaml accordingly.
46 lines
930 B
JSON
46 lines
930 B
JSON
{
|
|
"extends": "../../tsconfig.base.json",
|
|
"compilerOptions": {
|
|
"outDir": "./dist",
|
|
"rootDir": "..",
|
|
"baseUrl": ".",
|
|
"declaration": true,
|
|
"emitDeclarationOnly": true,
|
|
"skipLibCheck": true,
|
|
"stripInternal": true,
|
|
"noEmitOnError": false,
|
|
"paths": {
|
|
"napcat-core": [
|
|
"../napcat-core/index.ts"
|
|
],
|
|
"napcat-onebot": [
|
|
"../napcat-onebot/index.ts"
|
|
],
|
|
"@/napcat-core/*": [
|
|
"../napcat-core/*"
|
|
],
|
|
"@/napcat-onebot/*": [
|
|
"../napcat-onebot/*"
|
|
],
|
|
"@/napcat-common/*": [
|
|
"../napcat-common/*"
|
|
],
|
|
"@/napcat-webui-backend/*": [
|
|
"../napcat-webui-backend/*"
|
|
],
|
|
"@/*": [
|
|
"../*"
|
|
]
|
|
}
|
|
},
|
|
"include": [
|
|
"./index.ts",
|
|
"../napcat-core/**/*.ts",
|
|
"../napcat-onebot/**/*.ts",
|
|
"../napcat-common/**/*.ts"
|
|
],
|
|
"exclude": [
|
|
"node_modules",
|
|
"dist"
|
|
]
|
|
} |