cc-devflow 2.4.1 → 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 +21 -7
- package/bin/cc-devflow-cli.js +16 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,19 +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.
|
|
10
|
+
## [2.4.3] - 2026-01-09
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### 🔄 CLI 变更:强力增量更新 (Aggressive Incremental Update)
|
|
13
13
|
|
|
14
|
-
`cc-devflow init`
|
|
14
|
+
`cc-devflow init` 命令现在采用强制同步策略。
|
|
15
|
+
|
|
16
|
+
#### Changed
|
|
17
|
+
|
|
18
|
+
- **增量同步机制**: 当目标目录已存在时:
|
|
19
|
+
- 若文件缺失:**复制**新增。
|
|
20
|
+
- 若文件存在但内容不一致:**直接覆盖**(以模板为准),确保项目配置与最新标准一致。
|
|
21
|
+
- 仅当文件内容完全一致时跳过。
|
|
22
|
+
- **注意**: 此策略会覆盖用户的本地修改,请确保在使用前 commit 本地变更。
|
|
23
|
+
|
|
24
|
+
## [2.4.2] - 2026-01-09
|
|
25
|
+
|
|
26
|
+
### 🩹 CLI 增强:保留增量更新 (Preserved Incremental Update)
|
|
27
|
+
> 改为 2.4.3 后已被弃用
|
|
28
|
+
|
|
29
|
+
`cc-devflow init` 命令支持增量更新,保留用户修改。
|
|
15
30
|
|
|
16
31
|
#### Added
|
|
17
32
|
|
|
18
|
-
- **增量更新机制**:
|
|
33
|
+
- **增量更新机制**:
|
|
19
34
|
- 仅复制目标目录中**缺失**的文件。
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- **强制模式重构**: `--force` 选项现在的行为更明确:彻底删除旧目录并重新安装。
|
|
35
|
+
- **保留**所有已存在的文件。
|
|
36
|
+
- 若目标文件存在但内容与新版模板不同,生成 `filename.new`。
|
|
23
37
|
|
|
24
38
|
---
|
|
25
39
|
|
package/bin/cc-devflow-cli.js
CHANGED
|
@@ -99,11 +99,25 @@ function copyIncremental(src, dest) {
|
|
|
99
99
|
}
|
|
100
100
|
} else {
|
|
101
101
|
if (!fs.existsSync(dest)) {
|
|
102
|
+
// Case 1: File missing - Copy it
|
|
102
103
|
fs.copyFileSync(src, dest);
|
|
103
104
|
console.log(`[NEW] ${path.relative(process.cwd(), dest)}`);
|
|
104
105
|
} else {
|
|
105
|
-
// File exists -
|
|
106
|
-
|
|
106
|
+
// Case 2: File exists - Compare content
|
|
107
|
+
try {
|
|
108
|
+
const srcContent = fs.readFileSync(src);
|
|
109
|
+
const destContent = fs.readFileSync(dest);
|
|
110
|
+
|
|
111
|
+
if (!srcContent.equals(destContent)) {
|
|
112
|
+
// Content differs - Overwrite original
|
|
113
|
+
fs.unlinkSync(dest);
|
|
114
|
+
fs.copyFileSync(src, dest);
|
|
115
|
+
console.log(`[UPDATE] ${path.relative(process.cwd(), dest)}`);
|
|
116
|
+
}
|
|
117
|
+
// else: Content identical - Silent skip
|
|
118
|
+
} catch (err) {
|
|
119
|
+
console.warn(`[WARN] Could not compare ${path.relative(process.cwd(), dest)}: ${err.message}`);
|
|
120
|
+
}
|
|
107
121
|
}
|
|
108
122
|
}
|
|
109
123
|
}
|