orca-zh-tw-installer 1.3.0 → 1.3.1
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 +1 -1
- package/scripts/verify-install.js +13 -1
package/package.json
CHANGED
|
@@ -71,7 +71,19 @@ if (files.includes(esmPath)) {
|
|
|
71
71
|
const obj = JSON.parse(esm.trim().replace(/^export default\s*/, '').replace(/;$/, ''));
|
|
72
72
|
let n = 0;
|
|
73
73
|
(function w(o) { for (const k in o) typeof o[k] === 'string' ? n++ : w(o[k]); })(obj);
|
|
74
|
-
|
|
74
|
+
// 期望值不可寫死。原本寫 11020,字典成長到 11157 之後這項就一直誤報失敗,
|
|
75
|
+
// 而已安裝的字典其實完全正確。改為從來源 JSON 推算,字典再增減都不會失效。
|
|
76
|
+
// 找不到來源 JSON(只裝了 npm 套件、沒有專案)時就只回報數量,不判定成敗。
|
|
77
|
+
let expected = null;
|
|
78
|
+
try {
|
|
79
|
+
const srcJson = path.join(__dirname, '..', 'orca_zh_TW_translation.json');
|
|
80
|
+
expected = Object.keys(JSON.parse(fs.readFileSync(srcJson, 'utf8'))).length;
|
|
81
|
+
} catch { /* 沒有來源檔,跳過比對 */ }
|
|
82
|
+
if (expected === null) {
|
|
83
|
+
console.log(` ℹ️ ESM 字串數 = ${n}(找不到來源 JSON,略過比對)`);
|
|
84
|
+
} else {
|
|
85
|
+
check(`ESM 字串數 = ${n}(來源 ${expected})`, n === expected);
|
|
86
|
+
}
|
|
75
87
|
check('抽樣:menu.openWorktreePalette = 「開啟 Worktree 面板」',
|
|
76
88
|
obj.menu && obj.menu.openWorktreePalette === '開啟 Worktree 面板');
|
|
77
89
|
check('抽樣:無「儲存函式程式庫」殘留', !esm.includes('儲存函式程式庫'));
|