zen-gitsync 2.17.1 → 2.17.2
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/package.json +6 -1
- package/scripts/release.js +64 -0
- package/src/configSplit.js +708 -0
- package/src/dataDirMigration.js +342 -0
- package/src/fsAtomic.js +129 -0
- package/src/paths.js +79 -0
- package/src/ui/public/assets/{AppVersionBadge-Bw4-tHkL.js → AppVersionBadge-BUNlQAFq.js} +1 -1
- package/src/ui/public/assets/{BranchSelector-BZTHIIaF.js → BranchSelector-DzDm-rlz.js} +1 -1
- package/src/ui/public/assets/{CommitForm-DKedPnu-.js → CommitForm-CMEuo8S6.js} +1 -1
- package/src/ui/public/assets/{EditorView-C5O3ihKq.js → EditorView-CEG66-tP.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-SlVXZt60.js → FlowOrchestrationWorkspace-BuIdjN15.js} +1 -1
- package/src/ui/public/assets/{LogList-DlPJsPy_.js → LogList-DOkB_rda.js} +1 -1
- package/src/ui/public/assets/{MonitorView-GQ34uXPs.js → MonitorView-Bj1w16cJ.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-0UNF9CeP.js → ProjectStartupButton-DvatKLNn.js} +1 -1
- package/src/ui/public/assets/{RemoteManagerDialog-D51q3x7T.js → RemoteManagerDialog-D8x5aqN6.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-Bin9d3GZ.js → RemoteRepoCard-Bjyr6jDv.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-OxlKvnEc.js → SourceMapView-BYexJIGb.js} +1 -1
- package/src/ui/public/assets/{WorkbenchView-DyhIOjGD.js → WorkbenchView-C91Pm0rM.js} +1 -1
- package/src/ui/public/assets/{index-SjRTI8Of.js → index-BeNCRYqM.js} +3 -3
- package/src/ui/public/index.html +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-gitsync",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.2",
|
|
4
4
|
"description": "Auto commit, scheduled sync, and visual GUI for Git. Run `g` in any repo for one-key commit & push, AI commit messages, scheduled background sync, and a drag-and-drop workflow builder.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"verify:config-concurrency": "node scripts/verify-config-concurrency.mjs",
|
|
28
28
|
"verify:data-dir-migration": "node scripts/verify-data-dir-migration.mjs",
|
|
29
29
|
"verify:config-split": "node scripts/verify-config-split.mjs",
|
|
30
|
+
"verify:package-files": "node --test test/package-files.test.mjs",
|
|
30
31
|
"verify:wb-dialogs": "node scripts/verify-workbench-dialogs.cjs",
|
|
31
32
|
"verify:wb-dispatch": "node scripts/verify-workbench-dispatch-attach.cjs",
|
|
32
33
|
"verify:wb-env-context": "node scripts/verify-workbench-env-context.mjs",
|
|
@@ -74,6 +75,10 @@
|
|
|
74
75
|
"src/gitCommit.js",
|
|
75
76
|
"src/aiCommit.js",
|
|
76
77
|
"src/config.js",
|
|
78
|
+
"src/paths.js",
|
|
79
|
+
"src/fsAtomic.js",
|
|
80
|
+
"src/configSplit.js",
|
|
81
|
+
"src/dataDirMigration.js",
|
|
77
82
|
"src/cli/**",
|
|
78
83
|
"scripts/run-tests.cjs",
|
|
79
84
|
"scripts/release.js",
|
package/scripts/release.js
CHANGED
|
@@ -294,6 +294,69 @@ async function buildFrontend() {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
// 发布物自检
|
|
298
|
+
//
|
|
299
|
+
// 为什么必须在发布前跑(2026-09-18 事故):`files` 是**逐条列举**的白名单,新加的
|
|
300
|
+
// `src/paths.js` / `src/fsAtomic.js` / `src/configSplit.js` / `src/dataDirMigration.js`
|
|
301
|
+
// 没被补进去 → 2.17.1 打出的 tarball 缺文件 → 全局 `g ui` 一起手就
|
|
302
|
+
// `ERR_MODULE_NOT_FOUND: .../src/paths.js imported from .../src/config.js`。
|
|
303
|
+
// 本地永远复现不了(本地有全部文件),只能靠"发布前证明发布物自洽"来守。
|
|
304
|
+
//
|
|
305
|
+
// 两道网,故意不合并:
|
|
306
|
+
// ① 白名单语义正确性 —— 复用 `test/package-files.test.mjs`(唯一实现,别再抄一份):
|
|
307
|
+
// 展开 files → 逐个文件抽相对 import → 要求被 import 的也在发布物里。
|
|
308
|
+
// ② 真实 `npm pack` —— 防"我以为 files 会带上它,但 .npmignore/.gitignore 反手排除了"。
|
|
309
|
+
async function verifyPackageContents() {
|
|
310
|
+
console.log(chalk.blue('\n=== 发布物自检 ==='))
|
|
311
|
+
|
|
312
|
+
// ① 白名单 vs 相对 import
|
|
313
|
+
try {
|
|
314
|
+
execSync(`"${process.execPath}" --test test/package-files.test.mjs`, { cwd: rootDir, stdio: 'inherit' })
|
|
315
|
+
} catch {
|
|
316
|
+
console.error(chalk.red(
|
|
317
|
+
'发布物自检失败:package.json#files 覆盖不全(上面哪几条 not ok 就补哪几个文件)。\n'
|
|
318
|
+
+ '继续发布会打出缺文件的包 —— 用户装上就是 ERR_MODULE_NOT_FOUND。'
|
|
319
|
+
))
|
|
320
|
+
process.exit(1)
|
|
321
|
+
}
|
|
322
|
+
console.log(chalk.green('① files 覆盖所有被 import 的本地模块'))
|
|
323
|
+
|
|
324
|
+
// ② 真实 npm pack(只看清单,不落盘、不联网)
|
|
325
|
+
let packJson
|
|
326
|
+
try {
|
|
327
|
+
const out = execSync('npm pack --dry-run --json', { cwd: rootDir, encoding: 'utf8' })
|
|
328
|
+
// npm 可能在前/后混入提示行,这里取第一个 '[' 到最后一个 ']' 之间
|
|
329
|
+
packJson = JSON.parse(out.slice(out.indexOf('['), out.lastIndexOf(']') + 1))
|
|
330
|
+
} catch (err) {
|
|
331
|
+
console.error(chalk.red('npm pack --dry-run 失败:'), err.message || err)
|
|
332
|
+
process.exit(1)
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(rootDir, 'package.json'), 'utf8'))
|
|
336
|
+
const packed = new Set((packJson[0]?.files || []).map((f) => f.path))
|
|
337
|
+
if (packed.size === 0) {
|
|
338
|
+
console.error(chalk.red('npm pack 打出了空包,绝对有问题'))
|
|
339
|
+
process.exit(1)
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const notPacked = (pkg.files || []).filter((entry) => {
|
|
343
|
+
if (entry.endsWith('/**')) {
|
|
344
|
+
const prefix = entry.slice(0, -3)
|
|
345
|
+
return ![...packed].some((p) => p === prefix || p.startsWith(prefix + '/'))
|
|
346
|
+
}
|
|
347
|
+
return !packed.has(entry)
|
|
348
|
+
})
|
|
349
|
+
|
|
350
|
+
if (notPacked.length) {
|
|
351
|
+
console.error(chalk.red(
|
|
352
|
+
`npm pack 里有 ${notPacked.length} 条 files 白名单没真正进包(大概率是 .npmignore / .gitignore 排除了):\n`
|
|
353
|
+
+ notPacked.map((e) => ` - ${e}`).join('\n')
|
|
354
|
+
))
|
|
355
|
+
process.exit(1)
|
|
356
|
+
}
|
|
357
|
+
console.log(chalk.green(`② 真实打包 ${packed.size} 个文件,白名单逐条命中`))
|
|
358
|
+
}
|
|
359
|
+
|
|
297
360
|
// 仅把显式白名单文件 stage,并 sanity check
|
|
298
361
|
function stageReleaseFiles() {
|
|
299
362
|
console.log(chalk.gray('stage 白名单文件(避免 `git add .` 误带脏文件)...'))
|
|
@@ -444,6 +507,7 @@ async function main() {
|
|
|
444
507
|
await runTypeCheck()
|
|
445
508
|
const newVersion = updateVersion()
|
|
446
509
|
await buildFrontend()
|
|
510
|
+
await verifyPackageContents()
|
|
447
511
|
await commitChanges(newVersion)
|
|
448
512
|
await publishToNpm()
|
|
449
513
|
|