qat-cli 0.2.6 → 0.2.7

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.6-blue.svg)](https://www.npmjs.com/package/qat-cli)
7
+ [![npm version](https://img.shields.io/badge/version-0.2.7-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
@@ -467,17 +467,20 @@ async function loadConfig(configPath, forceReload = false) {
467
467
  }
468
468
  async function importConfig(filePath) {
469
469
  const { resolve } = await import("path");
470
+ const { pathToFileURL } = await import("url");
470
471
  const absolutePath = resolve(process.cwd(), filePath);
471
472
  if (!fs2.existsSync(absolutePath)) {
472
473
  throw new Error(`Cannot find module '${absolutePath}'`);
473
474
  }
475
+ const fileUrl = pathToFileURL(absolutePath).href;
474
476
  try {
475
- const module = await import(absolutePath);
477
+ const module = await import(fileUrl);
476
478
  return module.default || module;
477
479
  } catch {
478
480
  const jsPath = absolutePath.replace(/\.ts$/, ".js");
479
- if (fs2.existsSync(jsPath)) {
480
- const module = await import(jsPath);
481
+ if (jsPath !== absolutePath && fs2.existsSync(jsPath)) {
482
+ const jsUrl = pathToFileURL(jsPath).href;
483
+ const module = await import(jsUrl);
481
484
  return module.default || module;
482
485
  }
483
486
  throw new Error(`\u65E0\u6CD5\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6: ${absolutePath}`);
@@ -5490,7 +5493,7 @@ async function executeChange(_options) {
5490
5493
  }
5491
5494
 
5492
5495
  // src/cli.ts
5493
- var VERSION = "0.2.6";
5496
+ var VERSION = "0.2.7";
5494
5497
  function printLogo() {
5495
5498
  const logo = `
5496
5499
  ${chalk12.bold.cyan(" ___ _ _ _ _ _____ _ _ ")}