pi-zh-cn 0.2.4 → 0.2.6

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.md CHANGED
@@ -48,6 +48,16 @@ pi remove npm:pi-zh-cn
48
48
  /footer
49
49
  ```
50
50
 
51
+ ## 兼容性
52
+
53
+ `peerDependencies` 只设下限(`>=0.84.0`)不设上限,pi 出新版也不会被拦住。兼容性靠测试保证,不靠钉版本:
54
+
55
+ - push/PR:对着 lockfile 钉住的基线跑契约测试
56
+ - 每两天:上游金丝雀忽略 lockfile、拉最新版 pi 跑同一套测试
57
+ - 基线本身由 Dependabot 自动开 PR 跟进,它的 PR 就是一次新版兼容性验证,绿了合并即完成升级
58
+
59
+ Node 版本要求跟随 pi,由 pi 自己声明和检查。
60
+
51
61
  ## 已知局限
52
62
 
53
63
  - 内置菜单和其他硬编码在 pi 源码里的英文保持原样——扩展 API 够不到,除非 fork 上游重编译,不值得
@@ -76,15 +86,34 @@ footer 的 dist 源码,任一结构变化都会失败并指明该核对哪个
76
86
  npm test # tsc 类型检查 + 全部测试
77
87
  ```
78
88
 
79
- CI 在每次 push/PR 时运行,并每两天定时跑一次「上游金丝雀」:因为 peer
80
- 依赖是 `*`,定时任务会拉到最新版 pi,上游发布后两天内即可自动暴露兼容
81
- 性问题,不用等用户反馈。
89
+ CI 在每次 push/PR 时运行,并每两天定时跑一次「上游金丝雀」:本地开发
90
+ 基线由 `package-lock.json` 钉住,而金丝雀那趟会忽略 lockfile、拉到最新
91
+ 版 pi,所以上游发布后两天内即可自动暴露兼容性问题,不用等用户反馈。
92
+
93
+ ### 发布
94
+
95
+ 改完 `package.json` 的 `version` 并提交后,打 tag 推上去即可:
96
+
97
+ ```bash
98
+ git tag -a v0.2.6 -m "0.2.6: 一句话说明"
99
+ git push origin v0.2.6
100
+ ```
101
+
102
+ `.github/workflows/publish.yml` 会核对 tag 与版本号、跑一遍测试、发布到 npm
103
+ 并生成 provenance。认证走 npm Trusted Publishing(OIDC),仓库里不放
104
+ `NPM_TOKEN`——那种长期 token 一过期就卡住发版。前提是 npmjs.com 上已把本
105
+ 仓库配成该包的 Trusted Publisher(一次性);没配的话 publish 步骤会失败,
106
+ 退回本地 `npm login && npm publish` 即可。
107
+
108
+ GitHub Release 的正文单独写,用 `gh release create v0.2.6 --notes-file …` 建。
109
+ 补打历史 tag 时要注意:Release 列表按 **tag 时间**排序,不是按创建时间,
110
+ 所以得带上原始时间(`GIT_COMMITTER_DATE=<原始时间> git tag -a …`)。
82
111
 
83
112
  ## 反馈
84
113
 
85
114
  pi 大版本升级后如果出现错位或残留英文,欢迎[提 issue](https://github.com/GoetheDady/pi-zh-cn/issues)。
86
115
 
87
- 改动记录见 [CHANGELOG.md](CHANGELOG.md)。
116
+ 改动记录见 [GitHub Releases](https://github.com/GoetheDady/pi-zh-cn/releases)。
88
117
 
89
118
  ## License
90
119
 
@@ -9,6 +9,7 @@ import {
9
9
  VERSION,
10
10
  type ExtensionContext,
11
11
  } from "@earendil-works/pi-coding-agent";
12
+ import { truncateToWidth } from "@earendil-works/pi-tui";
12
13
  import { zh } from "./zh.ts";
13
14
 
14
15
  /**
@@ -36,15 +37,21 @@ export function setChineseHeader(ctx: ExtensionContext) {
36
37
  rawKeyHint("!", "bash"),
37
38
  keyHint("app.tools.expand", zh.header.more),
38
39
  ].join(theme.fg("muted", " · "));
40
+ // 窄终端时按宽度截断,避免触发 pi 的超宽崩溃检查
41
+ const w = Math.max(1, _width);
39
42
  return [
40
- logo,
41
- compact,
42
- theme.fg(
43
- "dim",
44
- `${zh.header.expandHelp} (${keyText("app.tools.expand")})`,
43
+ truncateToWidth(logo, w, ""),
44
+ truncateToWidth(compact, w, ""),
45
+ truncateToWidth(
46
+ theme.fg(
47
+ "dim",
48
+ `${zh.header.expandHelp} (${keyText("app.tools.expand")})`,
49
+ ),
50
+ w,
51
+ "",
45
52
  ),
46
53
  "",
47
- theme.fg("dim", zh.header.onboarding),
54
+ truncateToWidth(theme.fg("dim", zh.header.onboarding), w, ""),
48
55
  ];
49
56
  },
50
57
  invalidate() {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-zh-cn",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "pi 编码代理的简体中文界面汉化插件",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,11 +26,14 @@
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@earendil-works/pi-ai": "*",
29
- "@earendil-works/pi-coding-agent": "*",
30
- "@earendil-works/pi-tui": "*"
29
+ "@earendil-works/pi-coding-agent": ">=0.84.0",
30
+ "@earendil-works/pi-tui": ">=0.84.0"
31
31
  },
32
32
  "devDependencies": {
33
+ "@earendil-works/pi-ai": ">=0.85.1",
34
+ "@earendil-works/pi-coding-agent": ">=0.85.1",
35
+ "@earendil-works/pi-tui": ">=0.85.1",
33
36
  "@types/node": "^26.3.0",
34
- "typescript": "^5.9.3"
37
+ "typescript": "^7.0.2"
35
38
  }
36
39
  }