ai-unit-test-generator 2.0.3 → 2.0.4

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,6 +5,15 @@ 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
+ ## [2.0.4] - 2025-01-11
9
+
10
+ ### 🐛 Hotfix
11
+ - **Fixed**: ESM import error in `lib/workflows/analyze.mjs` - replaced `require` with proper `import`
12
+ - Added `readFileSync` to imports at module top
13
+ - Resolves `ReferenceError: require is not defined` in ESM context
14
+
15
+ ---
16
+
8
17
  ## [2.0.3] - 2025-01-11
9
18
 
10
19
  ### 🐛 Hotfix
@@ -3,7 +3,7 @@
3
3
  */
4
4
 
5
5
  import { spawn } from 'node:child_process'
6
- import { writeFileSync } from 'node:fs'
6
+ import { writeFileSync, readFileSync } from 'node:fs'
7
7
  import { detectConfig } from '../utils/config-manager.mjs'
8
8
  import { sampleCodeFiles, analyzeProjectStructure } from '../ai/sampler.mjs'
9
9
  import { buildProjectContext } from '../ai/context-builder.mjs'
@@ -122,8 +122,6 @@ export async function analyze(options) {
122
122
  */
123
123
  async function callCursorAgent(promptPath) {
124
124
  return new Promise((resolve, reject) => {
125
- const { readFileSync } = require('node:fs')
126
-
127
125
  // 读取 prompt
128
126
  let prompt
129
127
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-unit-test-generator",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "AI-powered unit test generator with smart priority scoring",
5
5
  "keywords": [
6
6
  "unit-test",