ai-unit-test-generator 1.4.3 → 1.4.5

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/CHANGELOG.md CHANGED
@@ -5,13 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.4.3] - 2025-01-10
8
+ ## [1.4.5] - 2025-01-11
9
+
10
+ ### Fixed
11
+ - Fixed ESM import issue in `scorer.mjs` (removed `require`, use existing imports)
12
+
13
+ ## [1.4.4] - 2025-01-11
14
+
15
+ ### Fixed
16
+ - Fixed CLI template path to use `default.config.jsonc` instead of `.json`
17
+ - Fixed config auto-detection order: `ai-test.config.jsonc` → `ai-test.config.json`
18
+
19
+ ## [1.4.3] - 2025-01-11
9
20
 
10
21
  ### Changed
11
22
  - **Config file format**: Changed default config from `.json` to `.jsonc` with comprehensive inline comments
12
23
  - **Report simplification**: Removed redundant `Notes` column from reports (info now in config comments)
13
24
  - **Better documentation**: Config file now self-documenting with detailed explanations of each scoring parameter
14
25
  - Auto-detection order: `ai-test.config.jsonc` → `ai-test.config.json` → `ut_scoring_config.json` (deprecated)
26
+ - **Code cleanup**: Removed redundant legacy files
15
27
 
16
28
  ### Fixed
17
29
  - Config file now properly supports JSONC format (JSON with comments)
package/bin/cli.js CHANGED
@@ -31,12 +31,12 @@ program
31
31
  let { config, output, skipGit } = options
32
32
 
33
33
  // 自动探测现有配置 & 初始化(不存在则创建)
34
- const detectOrder = [config, 'ai-test.config.json', 'ai-test.config.jsonc']
34
+ const detectOrder = [config, 'ai-test.config.jsonc', 'ai-test.config.json']
35
35
  const detected = detectOrder.find(p => existsSync(p))
36
36
  if (detected) config = detected
37
37
  if (!existsSync(config)) {
38
38
  console.log('⚙️ Config not found, creating default config...')
39
- const templatePath = join(PKG_ROOT, 'templates', 'default.config.json')
39
+ const templatePath = join(PKG_ROOT, 'templates', 'default.config.jsonc')
40
40
  copyFileSync(templatePath, config)
41
41
  console.log(`✅ Config created: ${config}\n`)
42
42
  }
@@ -31,13 +31,12 @@ function stripJsonComments(s) {
31
31
  .replace(/(^|\s)\/\/.*$/gm, '')
32
32
  }
33
33
  function loadConfig(pathFromArg) {
34
- const fs = require('fs')
35
34
  const paths = [pathFromArg, 'ai-test.config.jsonc', 'ai-test.config.json']
36
35
  for (const p of paths) {
37
36
  if (!p) continue
38
37
  try {
39
- if (fs.existsSync(p)) {
40
- const raw = fs.readFileSync(p, 'utf8')
38
+ if (existsSync(p)) {
39
+ const raw = readFileSync(p, 'utf8')
41
40
  return JSON.parse(stripJsonComments(raw))
42
41
  }
43
42
  } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-unit-test-generator",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "AI-powered unit test generator with smart priority scoring",
5
5
  "keywords": [
6
6
  "unit-test",