cc-devflow 2.4.2 → 2.4.3

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
@@ -7,20 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [2.4.3] - 2026-01-09
11
+
12
+ ### 🔄 CLI 变更:强力增量更新 (Aggressive Incremental Update)
13
+
14
+ `cc-devflow init` 命令现在采用强制同步策略。
15
+
16
+ #### Changed
17
+
18
+ - **增量同步机制**: 当目标目录已存在时:
19
+ - 若文件缺失:**复制**新增。
20
+ - 若文件存在但内容不一致:**直接覆盖**(以模板为准),确保项目配置与最新标准一致。
21
+ - 仅当文件内容完全一致时跳过。
22
+ - **注意**: 此策略会覆盖用户的本地修改,请确保在使用前 commit 本地变更。
23
+
10
24
  ## [2.4.2] - 2026-01-09
11
25
 
12
- ### 🩹 CLI 增强:增量更新 (Incremental Update)
26
+ ### 🩹 CLI 增强:保留增量更新 (Preserved Incremental Update)
27
+ > 改为 2.4.3 后已被弃用
13
28
 
14
- `cc-devflow init` 命令现在支持增量更新,不再强制覆盖用户已修改的文件。
29
+ `cc-devflow init` 命令支持增量更新,保留用户修改。
15
30
 
16
31
  #### Added
17
32
 
18
- - **增量更新机制**: 当目标目录已存在时,`init` 默认进入增量模式。
33
+ - **增量更新机制**:
19
34
  - 仅复制目标目录中**缺失**的文件。
20
- - **保留**所有已存在的文件(即使用户修改过)。
21
- - 若目标文件存在但内容与新版模板不同,生成 `filename.new` 并提示 `[UPDATE]`。
22
- - 输出 `[NEW] filename` 提示新增文件。
23
- - **强制模式重构**: `--force` 选项现在的行为更明确:彻底删除旧目录并重新安装。
35
+ - **保留**所有已存在的文件。
36
+ - 若目标文件存在但内容与新版模板不同,生成 `filename.new`。
24
37
 
25
38
  ---
26
39
 
@@ -109,10 +109,10 @@ function copyIncremental(src, dest) {
109
109
  const destContent = fs.readFileSync(dest);
110
110
 
111
111
  if (!srcContent.equals(destContent)) {
112
- // Content differs - Create .new version
113
- const newFile = `${dest}.new`;
114
- fs.copyFileSync(src, newFile);
115
- console.log(`[UPDATE] ${path.relative(process.cwd(), newFile)} (conflict detected)`);
112
+ // Content differs - Overwrite original
113
+ fs.unlinkSync(dest);
114
+ fs.copyFileSync(src, dest);
115
+ console.log(`[UPDATE] ${path.relative(process.cwd(), dest)}`);
116
116
  }
117
117
  // else: Content identical - Silent skip
118
118
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-devflow",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "DevFlow CLI tool",
5
5
  "main": "bin/cc-devflow.js",
6
6
  "bin": {