diff --git a/.husky/pre-commit b/.husky/pre-commit index 798b8467..0591892e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,9 +1,8 @@ #!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" echo "running docs:tsc" pnpm run docs:tsc -echo "running docs:eslint --fix" -pnpm run docs:eslint --fix +echo "running docs:format" +pnpm run docs:format # echo "running docs:zhlint" # pnpm run docs:zhlint diff --git a/.vitepress/theme/components/Analyzer.vue b/.vitepress/theme/components/Analyzer.vue index 04a996e2..6219beab 100644 --- a/.vitepress/theme/components/Analyzer.vue +++ b/.vitepress/theme/components/Analyzer.vue @@ -17,6 +17,7 @@ import { loadMCLA, MCLA_GH_DB_PREFIX, } from "@/analyzers/mcla" +import type { ITarFileInfo } from "@gera2ld/tarjs" // 类型&接口定义 interface SolutionOkSuccess { @@ -343,10 +344,11 @@ async function readFiles(file: MemFile, filename?: string): Promise { console.error(`Couldn't decompress file with ext ${ext}:`, error) throw new AnalysisError("UnzipErr", error) } + return readFiles(new MemFile(data, file.path), filebase) case "tar": { let files try { - files = await new TarReader().readFile(data) + files = await TarReader.load(data) } catch (error) { console.error("Couldn't read the tar file:", error) throw new AnalysisError("UnzipErr", error) @@ -354,13 +356,13 @@ async function readFiles(file: MemFile, filename?: string): Promise { let res: MemFile[] = [] await Promise.all( - files + files.fileInfos .filter( - (f) => + (f: ITarFileInfo) => !f.name.startsWith("._") && !f.name.toLowerCase().startsWith("paxheader/"), ) - .map((f) => + .map((f: ITarFileInfo) => readFiles( new MemFile( new Uint8Array(data.buffer, f.headerOffset + 512, f.size), @@ -1163,7 +1165,8 @@ onUnmounted(() => {
解决方案: - 打开文档 + 打开文档 +
diff --git a/tsconfig.json b/tsconfig.json index 1b48beda..68684aa7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,28 +8,43 @@ "exclude": [ ".vitepress/workers", "node_modules", - "./node_modules", - "./node_modules/*", + "./.vitepress/analyzers/mcla.api.ts", "./node_modules/@types/node/index.d.ts", ], "compilerOptions": { + "baseUrl": ".", + "outDir": "out", + "jsx": "preserve", + "module": "ESNext", + "moduleResolution": "Bundler", + "resolveJsonModule": true, + "strict": true, + "strictNullChecks": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + // TODO: change this to true after https://github.com/T-miracle/vitepress-plugin-image-viewer/issues/4 is fixed + "noUnusedLocals": false, + "noUnusedParameters": true, + "noEmit": true, + "removeComments": false, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true, + "ignoreDeprecations": "5.0", "lib": [ - "es2020", - "dom", + "DOM", + "ESNext" ], - "ignoreDeprecations": "5.0", - "baseUrl": ".", "paths": { "@/*": [ "./.vitepress/*" ], }, - "skipLibCheck": true, "types": [ "vite-plugin-pwa/pwa-assets", ], - "verbatimModuleSyntax": false, - "outDir": "out", }, "references": [ {