mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-01 12:24:51 +00:00
* test(core): stabilize file history eviction test * ci: clean package build artifacts before fast-path check * ci: preserve web build outputs during fast-path check
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* @license
|
|
* Copyright 2026 Qwen Team
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { rmSync } from 'node:fs';
|
|
import { dirname, join, resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const DEFAULT_ROOT = join(__dirname, '..');
|
|
const RMRF_OPTIONS = { recursive: true, force: true };
|
|
const CLI_BUILD_PACKAGE_PATHS = [
|
|
'packages/core',
|
|
'packages/web-templates',
|
|
'packages/channels/base',
|
|
'packages/channels/telegram',
|
|
'packages/channels/weixin',
|
|
'packages/channels/dingtalk',
|
|
'packages/channels/wecom',
|
|
'packages/channels/feishu',
|
|
'packages/channels/qqbot',
|
|
'packages/channels/plugin-example',
|
|
'packages/audio-capture',
|
|
'packages/acp-bridge',
|
|
'packages/sdk-typescript',
|
|
'packages/cli',
|
|
];
|
|
|
|
export function cleanPackageBuildArtifacts({
|
|
root = DEFAULT_ROOT,
|
|
packagePaths = CLI_BUILD_PACKAGE_PATHS,
|
|
} = {}) {
|
|
for (const pkgPath of packagePaths) {
|
|
const pkgDir = join(root, pkgPath);
|
|
rmSync(join(pkgDir, 'dist'), RMRF_OPTIONS);
|
|
rmSync(join(pkgDir, 'tsconfig.tsbuildinfo'), { force: true });
|
|
}
|
|
}
|
|
|
|
if (
|
|
process.argv[1] &&
|
|
fileURLToPath(import.meta.url) === resolve(process.argv[1])
|
|
) {
|
|
cleanPackageBuildArtifacts();
|
|
}
|