mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:00:43 +00:00
refactor: hide tooling internals
This commit is contained in:
@@ -33,7 +33,7 @@ export function resolveSourceRoots(repoRoot, relativeRoots) {
|
||||
return relativeRoots.map((root) => path.join(repoRoot, ...root.split("/").filter(Boolean)));
|
||||
}
|
||||
|
||||
export function isTestLikeTypeScriptFile(filePath, options = {}) {
|
||||
function isTestLikeTypeScriptFile(filePath, options = {}) {
|
||||
const extraTestSuffixes = options.extraTestSuffixes ?? [];
|
||||
return [...baseTestSuffixes, ...extraTestSuffixes].some((suffix) => filePath.endsWith(suffix));
|
||||
}
|
||||
@@ -175,7 +175,7 @@ export function collectCallExpressionLines(ts, sourceFile, resolveLineNode) {
|
||||
return lines;
|
||||
}
|
||||
|
||||
export function isDirectExecution(importMetaUrl) {
|
||||
function isDirectExecution(importMetaUrl) {
|
||||
const entry = process.argv[1];
|
||||
if (!entry) {
|
||||
return false;
|
||||
|
||||
@@ -17,11 +17,11 @@ function hashIncludePatterns(includePatterns) {
|
||||
return createHash("sha1").update(JSON.stringify(includePatterns)).digest("hex").slice(0, 12);
|
||||
}
|
||||
|
||||
export function shouldUseShardTimings(env = process.env) {
|
||||
function shouldUseShardTimings(env = process.env) {
|
||||
return env[TIMINGS_DISABLE_ENV_KEY] !== "0";
|
||||
}
|
||||
|
||||
export function resolveShardTimingsPath(cwd = process.cwd(), env = process.env) {
|
||||
function resolveShardTimingsPath(cwd = process.cwd(), env = process.env) {
|
||||
return env[TIMINGS_FILE_ENV_KEY] || path.join(cwd, ".artifacts", "vitest-shard-timings.json");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user