dsh-config-sync-plugin 0.4.8 → 0.4.10
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.en.md +2 -2
- package/README.en.md.bak-0410 +830 -0
- package/README.md +2 -2
- package/README.md.bak-0410 +822 -0
- package/client.js +3790 -3790
- package/index.js +5055 -5041
- package/package.json +1 -1
- package/runtime/apply.ps1 +9 -16
- package/runtime/apply.ps1.bak-0410 +1646 -0
- package/runtime/sync.ps1 +1117 -1029
- package/runtime/sync.ps1.bak-0410 +1117 -0
- package/tools/selftest.mjs +42 -0
- package/tools/selftest.mjs.bak-0410 +2045 -0
package/tools/selftest.mjs
CHANGED
|
@@ -2019,5 +2019,47 @@ console.log('== 0.4.06:点 × 由后端窗口监视触发(不依赖前端信
|
|
|
2019
2019
|
postSrc.includes('$waited -gt 300')
|
|
2020
2020
|
&& postSrc.includes('-and -not $hadVisible'), 'post-exit.ps1 让位收紧')
|
|
2021
2021
|
}
|
|
2022
|
+
|
|
2023
|
+
console.log('')
|
|
2024
|
+
console.log('== 0.4.09:本地提交导致分叉,冲突检测展示处理方式 ==')
|
|
2025
|
+
{
|
|
2026
|
+
const syncSrc = readFileSync(join(pluginRootSelf, 'runtime', 'sync.ps1'), 'utf8')
|
|
2027
|
+
const idxSrc2 = readFileSync(join(pluginRootSelf, 'index.js'), 'utf8')
|
|
2028
|
+
const cliSrc = readFileSync(join(pluginRootSelf, 'client.js'), 'utf8')
|
|
2029
|
+
check('sync.ps1 新增 Get-DivergenceInfo 检测本地提交分叉',
|
|
2030
|
+
syncSrc.includes('function Get-DivergenceInfo') && syncSrc.includes('merge-base --is-ancestor HEAD '), 'sync.ps1 分叉检测')
|
|
2031
|
+
check('sync.ps1 pull 冲突检测阶段调用分叉判断并写入清单',
|
|
2032
|
+
/\$div = Get-DivergenceInfo \$remoteRef/.test(syncSrc) && syncSrc.includes('divergence = $div'), 'sync.ps1 分叉清单')
|
|
2033
|
+
check('sync.ps1 处理方式含保留(rebase)/丢弃(reset)与双机根因',
|
|
2034
|
+
syncSrc.includes('rebase origin/') && syncSrc.includes('reset --hard origin/') && syncSrc.includes('双机同时 push'), 'sync.ps1 处理方式')
|
|
2035
|
+
check('sync.ps1 diff 失败分类把 not possible to fast-forward 单独处理',
|
|
2036
|
+
/not possible to fast-forward\|Not possible to fast-forward\|Diverging branches/.test(syncSrc), 'sync.ps1 分叉分类')
|
|
2037
|
+
check('sync.ps1 备份 README 里展示分叉处理',
|
|
2038
|
+
syncSrc.includes('分支分叉 / Diverged branches') && syncSrc.includes('$Report.divergence'), 'sync.ps1 README 分叉')
|
|
2039
|
+
check('index.js 冲突接口透传 divergence 字段',
|
|
2040
|
+
idxSrc2.includes('divergence: obj.divergence') && idxSrc2.includes('localAhead: Number'), 'index.js divergence 透传')
|
|
2041
|
+
check('client.js 冲突卡展示分叉处理方式',
|
|
2042
|
+
cliSrc.includes('state.divergence ? h(') && cliSrc.includes('本地有提交导致分支分叉'), 'client.js 分叉展示')
|
|
2043
|
+
}
|
|
2044
|
+
console.log('')
|
|
2045
|
+
console.log('== 0.4.10:拉取不再因本机/契约版本不一致而阻断 ==')
|
|
2046
|
+
{
|
|
2047
|
+
const appSrc = readFileSync(join(pluginRuntime, 'apply.ps1'), 'utf8')
|
|
2048
|
+
const syncSrc = readFileSync(join(pluginRootSelf, 'runtime', 'sync.ps1'), 'utf8')
|
|
2049
|
+
const idxSrc = readFileSync(join(pluginRootSelf, 'index.js'), 'utf8')
|
|
2050
|
+
const cliSrc = readFileSync(join(pluginRootSelf, 'client.js'), 'utf8')
|
|
2051
|
+
check('apply.ps1 版本不一致不再 Die 阻断拉取',
|
|
2052
|
+
!/两端客户端不是同一版,未改动任何文件/.test(appSrc)
|
|
2053
|
+
&& appSrc.includes('0.4.10 起不再阻断拉取'), 'apply.ps1 版本不阻断')
|
|
2054
|
+
check('apply.ps1 版本不一致仍保留实验性 bundle 门控',
|
|
2055
|
+
appSrc.includes('实验性 bundle(@deepseek-ai/dsh-experimental-*') && appSrc.includes('$dropped += $b'), 'apply.ps1 bundle 门控保留')
|
|
2056
|
+
check('sync.ps1 status 把版本不一致标为仅提示不阻断',
|
|
2057
|
+
syncSrc.includes('仅提示,不阻断拉取') && syncSrc.includes('0.4.10 起照常同步'), 'sync.ps1 status 提示')
|
|
2058
|
+
check('index.js 版本差异 advice 不再要求 -AllowVersionDrift',
|
|
2059
|
+
idxSrc.includes('0.4.10 起不影响拉取') && !/或 pull 时加 -AllowVersionDrift/.test(idxSrc), 'index.js advice 文案')
|
|
2060
|
+
check('client.js 摘要与指标条不再因版本不一致标告警',
|
|
2061
|
+
!/版本不一致(本机 \$\{version\.local\}/.test(cliSrc)
|
|
2062
|
+
&& cliSrc.includes("metric(M('本机 / 契约', 'App / contract'), versionText, 'ok')"), 'client.js 去告警')
|
|
2063
|
+
}
|
|
2022
2064
|
process.exit(failures === 0 ? 0 : 1)
|
|
2023
2065
|
|