qat-cli 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Quick Auto Testing — 面向 Vue 项目,集成 Vitest & Playwright,AI 驱动覆盖测试全流程**
6
6
 
7
- [![npm version](https://img.shields.io/badge/version-0.2.5-blue.svg)](https://www.npmjs.com/package/qat-cli)
7
+ [![npm version](https://img.shields.io/badge/version-0.2.6-blue.svg)](https://www.npmjs.com/package/qat-cli)
8
8
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-green.svg)](https://nodejs.org/)
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.6-blue.svg)](https://www.typescriptlang.org/)
package/dist/cli.js CHANGED
@@ -2342,14 +2342,41 @@ async function executeInit(options) {
2342
2342
  }
2343
2343
  }
2344
2344
  const config = buildProjectConfig(projectInfo);
2345
- const fileSpinner = ora2("\u6B63\u5728\u751F\u6210\u914D\u7F6E\u6587\u4EF6...").start();
2346
2345
  let configPath;
2347
- try {
2348
- configPath = await writeConfigFile(process.cwd(), config, options.force);
2349
- fileSpinner.succeed("\u914D\u7F6E\u6587\u4EF6\u5DF2\u751F\u6210");
2350
- } catch (error) {
2351
- fileSpinner.fail("\u914D\u7F6E\u6587\u4EF6\u751F\u6210\u5931\u8D25");
2352
- throw error;
2346
+ const existingConfigPath = path7.join(process.cwd(), "qat.config.js");
2347
+ const existingTsPath = path7.join(process.cwd(), "qat.config.ts");
2348
+ const configExists = fs7.existsSync(existingConfigPath) || fs7.existsSync(existingTsPath);
2349
+ if (configExists && !options.force) {
2350
+ const { overwrite } = await inquirer.prompt([
2351
+ {
2352
+ type: "confirm",
2353
+ name: "overwrite",
2354
+ message: "\u914D\u7F6E\u6587\u4EF6 qat.config.js \u5DF2\u5B58\u5728\uFF0C\u662F\u5426\u8986\u76D6\uFF1F",
2355
+ default: true
2356
+ }
2357
+ ]);
2358
+ if (!overwrite) {
2359
+ console.log(chalk3.gray(" \u4FDD\u7559\u73B0\u6709\u914D\u7F6E\u6587\u4EF6\uFF0C\u7EE7\u7EED\u540E\u7EED\u6B65\u9AA4..."));
2360
+ configPath = existingConfigPath;
2361
+ } else {
2362
+ const fileSpinner = ora2("\u6B63\u5728\u8986\u76D6\u914D\u7F6E\u6587\u4EF6...").start();
2363
+ try {
2364
+ configPath = await writeConfigFile(process.cwd(), config, true);
2365
+ fileSpinner.succeed("\u914D\u7F6E\u6587\u4EF6\u5DF2\u8986\u76D6");
2366
+ } catch (error) {
2367
+ fileSpinner.fail("\u914D\u7F6E\u6587\u4EF6\u8986\u76D6\u5931\u8D25");
2368
+ throw error;
2369
+ }
2370
+ }
2371
+ } else {
2372
+ const fileSpinner = ora2("\u6B63\u5728\u751F\u6210\u914D\u7F6E\u6587\u4EF6...").start();
2373
+ try {
2374
+ configPath = await writeConfigFile(process.cwd(), config, options.force);
2375
+ fileSpinner.succeed("\u914D\u7F6E\u6587\u4EF6\u5DF2\u751F\u6210");
2376
+ } catch (error) {
2377
+ fileSpinner.fail("\u914D\u7F6E\u6587\u4EF6\u751F\u6210\u5931\u8D25");
2378
+ throw error;
2379
+ }
2353
2380
  }
2354
2381
  const dirSpinner = ora2("\u6B63\u5728\u521B\u5EFA\u6D4B\u8BD5\u76EE\u5F55...").start();
2355
2382
  const createdDirs = createTestDirectories(config);
@@ -5463,7 +5490,7 @@ async function executeChange(_options) {
5463
5490
  }
5464
5491
 
5465
5492
  // src/cli.ts
5466
- var VERSION = "0.2.5";
5493
+ var VERSION = "0.2.6";
5467
5494
  function printLogo() {
5468
5495
  const logo = `
5469
5496
  ${chalk12.bold.cyan(" ___ _ _ _ _ _____ _ _ ")}