dsh-config-sync-plugin 0.4.1 → 0.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/README.en.md +6 -0
- package/README.md +6 -0
- package/index.js +6 -1
- package/package.json +1 -1
- package/tools/selftest.mjs +10 -0
package/README.en.md
CHANGED
|
@@ -257,6 +257,10 @@ Two display fixes on top of 0.3.77:
|
|
|
257
257
|
|
|
258
258
|
The "Plugin update" card now shows an **npm download URL** line with the actual fallback addresses (domestic mirror `registry.npmmirror.com` + official `registry.npmjs.org`). When the GitHub release download is unreachable (common in mainland China), the update package automatically falls back to npm. It is still verified against the authoritative sha256 in `version.json` — switching source never relaxes verification. The two sources back each other up: the mirror can briefly 404 during its first-sync window, and the official source takes over. The npm tarball is byte-identical to the GitHub release tgz (same sha256).
|
|
259
259
|
|
|
260
|
+
### npm fallback version normalization fix (0.4.02)
|
|
261
|
+
|
|
262
|
+
npm normalizes `0.4.01` to `0.4.1` per semver, so the tarball is `dsh-config-sync-plugin-0.4.1.tgz`. Before 0.4.02 the fallback URL was built as `-0.4.01.tgz`, which 404s on npm. `npmTgzUrls` now strips leading zeros from numeric segments (`0.4.01`→`0.4.1`) before building the URL; GitHub release and version.json keep the user-specified version (same artifact, identical sha256). Selftest assertion added.
|
|
263
|
+
|
|
260
264
|
### Project-level skills now sync + auto sync only on active × close (0.4.01)
|
|
261
265
|
|
|
262
266
|
**Project-level skills**: skills placed under a workspace's `.dsh\skills\` were never synced — the workspace ignore list skips the whole `.dsh` directory. `Test-WorkspaceIgnored` now makes a targeted exception for `.dsh\skills\`, so project skills sync with workspace files; other `.dsh` content (session cache/tokens/config) stays skipped.
|
|
@@ -777,6 +781,8 @@ The log shows which path ran: `文件比较(快筛):比对 N 个,深哈
|
|
|
777
781
|
|
|
778
782
|
| Date | Version | Summary |
|
|
779
783
|
|---|---|---|
|
|
784
|
+
| 2026-11-25 | 0.4.03 | Repackaged release: code identical to 0.4.02; only version and release metadata updated to 0.4.03 |
|
|
785
|
+
| 2026-11-25 | 0.4.02 | Fix npm fallback version normalization: npm semver turns 0.4.01 into 0.4.1; strip leading zeros when building tarball URL, otherwise 404 |
|
|
780
786
|
| 2026-11-25 | 0.4.01 | Auto sync only on active × close: scheduleAutoStart updates drift status only, handleSettings queues watcher without close, only × close/pagehide (shouldCloseDsh:true) actually closes DSH after queuing |
|
|
781
787
|
| 2026-11-25 | 0.3.99 | Toggle auto-pull/push now triggers immediate sync check (core logic checkAndQueueAutoSync reused by scheduleAutoStart/triggerAutoSyncOnClose/handleSettings; toggle change queues immediately, manual-trigger mode skips confirm) |
|
|
782
788
|
| 2026-11-25 | 0.3.98 | Default workspace conversations now sync (stable name --default-workspace--; apply re-encodes directory/cwd/projcache from local defaultWorkspaceId and merges sessionIds), files stay local |
|
package/README.md
CHANGED
|
@@ -277,6 +277,10 @@ pwsh -File runtime\sync.ps1 pull `
|
|
|
277
277
|
|
|
278
278
|
「插件更新」卡新增一行 **npm 下载路径**,直接显示实际兜底地址(国内镜像 `registry.npmmirror.com` + 官方 `registry.npmjs.org` 两个源)。GitHub release 整段不通时(国内常见),更新包会自动兜底从 npm 下载;仍按 `version.json` 里的权威 sha256 校验,换源不放宽校验。两个源互为备份:镜像首发同步窗口期会短暂 404,官方源随即兜上。实测 npm tarball 与 GitHub release tgz 是同一份产物、sha256 完全一致。
|
|
279
279
|
|
|
280
|
+
### npm 兜底下载的版本规范化修复(0.4.02)
|
|
281
|
+
|
|
282
|
+
npm 按 semver 把版本号 `0.4.01` 规范化成 `0.4.1`,tarball 文件名是 `dsh-config-sync-plugin-0.4.1.tgz`。0.4.01 之前拼的是 `-0.4.01.tgz`,npm 兜底下载会 404。`npmTgzUrls` 现在对数字段去前导零(`0.4.01`→`0.4.1`)再拼 URL;GitHub release 与 version.json 仍保留用户指定的版本号(同一份产物、sha256 一致)。selftest 加断言防回归。
|
|
283
|
+
|
|
280
284
|
### 项目级技能纳入同步 + 自动同步仅在主动关闭 DSH 窗口(×)时触发(0.4.01)
|
|
281
285
|
|
|
282
286
|
**项目级技能同步**:技能放在工作区的 `.dsh\skills\` 下时,之前从来不会被同步——工作区同步的忽略清单把整个 `.dsh` 目录跳过了。现在 `Test-WorkspaceIgnored` 给 `.dsh\skills\` 开定向例外,项目级技能能随工作区资料一起推送/拉取;其余 `.dsh` 内容(会话缓存/token/配置)仍照旧跳过。
|
|
@@ -759,6 +763,8 @@ pwsh -File sync.ps1 push -ScanHistory
|
|
|
759
763
|
|
|
760
764
|
| 日期 | 版本 | 要点 |
|
|
761
765
|
|---|---|---|
|
|
766
|
+
| 2026-11-25 | 0.4.03 | 重新打包发布:代码与 0.4.02 一致,仅版本与发布元数据更新到 0.4.03 |
|
|
767
|
+
| 2026-11-25 | 0.4.02 | 修复 npm 兜底下载的版本规范化:0.4.01 被 npm semver 规范化成 0.4.1,拼 tarball 时去前导零,否则 404 |
|
|
762
768
|
| 2026-11-25 | 0.4.01 | 自动同步仅在主动关闭 DSH 窗口(×)时触发:scheduleAutoStart 只做 drift 状态更新,handleSettings 只排队不退出,只有 × 关闭/页面卸载走 shouldCloseDsh: true 真正关闭 DSH |
|
|
763
769
|
| 2026-11-25 | 0.3.99 | 勾选自动同步开关即时触发判断(核心逻辑抽离为 checkAndQueueAutoSync,scheduleAutoStart/triggerAutoSyncOnClose/handleSettings 三路复用,开关变更即时排队,手动模式跳过确认框) |
|
|
764
770
|
| 2026-11-25 | 0.3.98 | 默认工作区会话纳入同步(稳定名 --default-workspace--,apply 按本机 defaultWorkspaceId 重编码目录/cwd/projcache 并合并 sessionIds),资料仍各机独立 |
|
package/index.js
CHANGED
|
@@ -2251,7 +2251,12 @@ function compareVersion(a, b) {
|
|
|
2251
2251
|
* 清单里的权威 sha256 照常校验,换源不放宽校验。
|
|
2252
2252
|
*/
|
|
2253
2253
|
function npmTgzUrls(version) {
|
|
2254
|
-
|
|
2254
|
+
// npm 按 semver 规范化版本号:0.4.01 → 0.4.1(数字段去前导零)。
|
|
2255
|
+
// 版本号本身在 version.json / GitHub release / market 里保留用户指定的 0.4.01,
|
|
2256
|
+
// 但拼 npm tarball 文件名必须用规范化后的版本,否则兜底下载 404。
|
|
2257
|
+
const raw = String(version || '').trim()
|
|
2258
|
+
const semver = raw.replace(/^(\d+)\.(\d+)\.(\d+)/, (_m, a, b, c) => `${Number(a)}.${Number(b)}.${Number(c)}`)
|
|
2259
|
+
const v = semver.replace(/[^0-9A-Za-z.+\-]/g, '')
|
|
2255
2260
|
if (!v) return []
|
|
2256
2261
|
const f = `dsh-config-sync-plugin-${v}.tgz`
|
|
2257
2262
|
return [
|
package/package.json
CHANGED
package/tools/selftest.mjs
CHANGED
|
@@ -1954,5 +1954,15 @@ console.log('== 0.3.98:默认工作区会话同步(稳定名 --default-works
|
|
|
1954
1954
|
check('apply 默认工作区会话 id 并入本机默认工作区登记(sessionIds)',
|
|
1955
1955
|
/\$localTable\[\$dwId\]\['sessionIds'\]/.test(app) && /\$defaultSids/.test(app), 'apply.ps1 sessionIds 合并')
|
|
1956
1956
|
}
|
|
1957
|
+
console.log('')
|
|
1958
|
+
console.log('== 0.4.02:npm tarball 版本按 semver 规范化(0.4.01 → 0.4.1)==')
|
|
1959
|
+
{
|
|
1960
|
+
const idxSrc = readFileSync(join(pluginRootSelf, 'index.js'), 'utf8')
|
|
1961
|
+
check('npmTgzUrls 对版本号做 semver 规范化(数字段去前导零)',
|
|
1962
|
+
/const semver = raw\.replace\(\/\^\\\(\\d\+\\\)/.test(idxSrc)
|
|
1963
|
+
|| /\$\{Number\(a\)\}\.\$\{Number\(b\)\}\.\$\{Number\(c\)\}/.test(idxSrc), 'index.js semver 规范化')
|
|
1964
|
+
check('npmTgzUrls 保留预发布/构建后缀清洗',
|
|
1965
|
+
idxSrc.includes("semver.replace(/[^0-9A-Za-z.+\\-]/g, '')"), 'index.js 版本清洗')
|
|
1966
|
+
}
|
|
1957
1967
|
process.exit(failures === 0 ? 0 : 1)
|
|
1958
1968
|
|