Files
modelstudioai__cli/packages/cli/tests/stress/lib/paths.mjs
T
若麒 66402d9868 chore(dev): run CLI workspace entries from source
- use tsx for bl/kscli dev and test runners
- point local library exports to src while keeping publishConfig on dist
- switch vendored telemetry modules to .cjs for source-run compatibility
- update stress/e2e helpers and agent docs for the new source execution path
2026-07-09 19:39:13 +08:00

38 lines
1.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 压测脚本根目录及 CLI/monorepo 路径解析。
*/
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
/** 当前文件所在 lib 目录 */
const LIB_DIR = dirname(fileURLToPath(import.meta.url));
/** `packages/cli/tests/stress` */
export const STRESS_ROOT = join(LIB_DIR, "..");
/** `packages/cli` */
export const DEFAULT_CLI_PACKAGE = join(STRESS_ROOT, "..", "..");
/** monorepo 根目录 */
export const MONOREPO_ROOT = join(DEFAULT_CLI_PACKAGE, "..", "..");
/** CLI 入口 main.ts由仓库本地 tsx 执行) */
export function resolveMainTs(cliPackage = DEFAULT_CLI_PACKAGE) {
return join(cliPackage, "src", "main.ts");
}
/** monorepo 本地 bin 路径,避免 `pnpm run` 生命周期日志污染 stdout */
export function resolveLocalBin(name) {
return join(
MONOREPO_ROOT,
"node_modules",
".bin",
process.platform === "win32" ? `${name}.cmd` : name,
);
}
/** tsx 可执行文件路径 */
export function resolveTsxBin() {
return resolveLocalBin("tsx");
}