From ab8c5c1e13041690e07896f2f2f0dfa2134ad97e Mon Sep 17 00:00:00 2001 From: N0zoM1z0 <1705004398@qq.com> Date: Tue, 14 Jul 2026 21:09:03 +0000 Subject: [PATCH] fix(tooling): isolate concurrent repository checks --- scripts/scan-todos.mjs | 22 ++++++++-------------- vitest.config.ts | 7 +++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/scripts/scan-todos.mjs b/scripts/scan-todos.mjs index 6723856f3..e783d4e85 100644 --- a/scripts/scan-todos.mjs +++ b/scripts/scan-todos.mjs @@ -6,21 +6,15 @@ import { relative, resolve } from "node:path"; const root = resolve(import.meta.dirname, ".."); -// Collect all TS, MJS, and Python source files, excluding generated and third-party dirs. -const sourceFiles = [ - ...globSync("src/**/*.ts", { +// Native globSync is available throughout the Node versions in package.engines. +// Its exclusion option is `exclude`; `ignore` and `nodir` belong to npm glob. +const sourceFiles = globSync( + ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.mjs", "bridge/**/*.py"], + { cwd: root, - nodir: true, - ignore: ["dist/**", "node_modules/**"], - }), - ...globSync("tests/**/*.ts", { - cwd: root, - nodir: true, - ignore: ["node_modules/**"], - }), - ...globSync("scripts/**/*.mjs", { cwd: root, nodir: true }), - ...globSync("bridge/**/*.py", { cwd: root, nodir: true }), -]; + exclude: (path) => path.split(/[\\/]/u).includes("node_modules"), + }, +); const patterns = [ { regex: /TODO(?::\s*(.*))?$/gm, label: "TODO" }, diff --git a/vitest.config.ts b/vitest.config.ts index 90c93393d..17b837bea 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,3 +1,6 @@ +import { tmpdir } from "node:os"; +import { join } from "node:path"; + import { defineConfig } from "vitest/config"; export default defineConfig({ @@ -8,6 +11,10 @@ export default defineConfig({ coverage: { enabled: true, provider: "v8", + reportsDirectory: join( + tmpdir(), + `rea-vitest-coverage-${String(process.pid)}`, + ), include: ["src/**"], thresholds: { statements: 65,