@xiaopb/dsh-mobile-compose 0.6.4 → 0.6.5
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/CHANGELOG.md +10 -0
- package/README.md +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.5
|
|
4
|
+
|
|
5
|
+
**发布流水线修复,插件运行时行为无变化。**
|
|
6
|
+
|
|
7
|
+
- **修复「npm 接受了请求但版本没公开」被当成成功**:原 release 工作流只看 `npm publish` 的退出码,而账号处于 stage-only 策略、或包首次发布时,npm 会返回 0 但版本进入 Staged Packages 等人工 2FA 批准,于是流程跑到「确认公开」才失败、前面全部步骤看起来都是绿的(0.6.4 的 tag 发布即卡在这里)。现在发布逻辑抽成 `scripts/publish-npm.sh`:**每种方式都是「发布 → 轮询 `npm view` 确认真实可见」**,确认不到才算失败。
|
|
8
|
+
- **token 兜底真正生效**:OIDC(Trusted Publishing)发布后若版本仍未公开,自动回退 `NPM_TOKEN` 再发一次并同样确认;`--provenance` 因缺少 OIDC 权限失败时自动去掉该参数重试。两种方式都失败才报错。
|
|
9
|
+
- **失败时自带诊断**:打印 npm / node 版本、`NPM_TOKEN` 对应账号、registry 上该版本的 status 端点、`npm stage list`(npm ≥ 11.15)与发布日志里的报错行,并在错误信息里给出三条处置建议(先 Approve staged 版本 / 先本地发一次让包名存在 / 换可发布的 granular token)。
|
|
10
|
+
- **凭据探测步骤**:发布前先输出 `npm whoami` 与 OIDC 是否可用(`ACTIONS_ID_TOKEN_REQUEST_URL`),缺 `NPM_TOKEN` 时给 warning 而不是静默降级。
|
|
11
|
+
- **新增单测** `test/publish-npm.test.js`(6 项,用假 npm):已公开跳过、无凭据直接诊断、OIDC 一次成功、OIDC 假成功→token 救回、provenance 失败自动重试、两条路都失败给出 staged 建议。`npm run check` 现在共 34 项。
|
|
12
|
+
|
|
3
13
|
## 0.6.4
|
|
4
14
|
|
|
5
15
|
**工程化版本,插件运行时行为无变化。**
|
package/README.md
CHANGED
|
@@ -121,7 +121,8 @@ body.dmc-hide-native button:has(+ input[type="file"][multiple][hidden]:not([data
|
|
|
121
121
|
|
|
122
122
|
| 工作流 | 触发 | 做什么 |
|
|
123
123
|
|---|---|---|
|
|
124
|
-
| [`ci.yml`](.github/workflows/ci.yml) | push `main` / PR / 手动 | Node 22 与 24 矩阵:`npm ci` → `npm run check`(
|
|
124
|
+
| [`ci.yml`](.github/workflows/ci.yml) | push `main` / PR / 手动 | Node 22 与 24 矩阵:`npm ci` → `npm run check`(34 项单测 + 离线冒烟 + 包契约自检)→ `npm pack --dry-run` → 打 tarball → 校验发布说明生成器 → **消费端安装测试**(干净目录安装 tarball,校验 `dsh.bundle.patch` / `dsh.client.platform` / 宿主 `apply` 可加载 / 开发目录未混入包) |
|
|
125
|
+
| [`release.yml`](.github/workflows/release.yml) | push `v*` tag / 手动 | 校验 tag ↔ `package.json` 版本 → 自检 → 发布 npm(`scripts/publish-npm.sh`:优先 **Trusted Publishing**/OIDC,版本未真正公开时回退 **`NPM_TOKEN`**;每种方式都「发布 + 轮询确认公开」,`--provenance` 失败自动降级重试)→ 确认版本已在 npm 公开 → `npm pack` + SHA-256 → 生成发布说明(`scripts/release-notes.sh`)→ 创建 GitHub Release(附 tarball 与校验和) |
|
|
125
126
|
| [`release.yml`](.github/workflows/release.yml) | push `v*` tag / 手动 | 校验 tag ↔ `package.json` 版本 → 自检 → 发布 npm(优先 **Trusted Publishing**/OIDC,失败回退 `NPM_TOKEN`,均带 `--provenance`)→ 确认版本已在 npm 公开 → `npm pack` + SHA-256 → 生成发布说明(`scripts/release-notes.sh`)→ 创建 GitHub Release(附 tarball 与校验和) |
|
|
126
127
|
| [`ui-verify.yml`](.github/workflows/ui-verify.yml) | 手动 / 每天 04:00(UTC+8) | 真机验收:用真实 DSH 引擎跑 `diag-browser`(面板全流程)、`verify-paging`(左右滑 / 滚轮)、`verify-decision`(`/goal` 只写草稿)、`verify-lang`(zh ↔ en)。`dsh_url` 留空时 CI 自建引擎并把本仓库装进 web profile;也可传入局域网引擎地址 |
|
|
127
128
|
|
|
@@ -133,14 +134,15 @@ git push origin main --follow-tags
|
|
|
133
134
|
# → Release 工作流接管:npm 发布 + GitHub Release(产物与 SHA-256)
|
|
134
135
|
```
|
|
135
136
|
|
|
136
|
-
**npm 发布凭据**:默认走 Trusted Publishing(在 npm 包设置里登记本仓库 + `release.yml`,允许 `id-token: write`,无需 secret
|
|
137
|
+
**npm 发布凭据**:默认走 Trusted Publishing(在 npm 包设置里登记本仓库 + `release.yml`,允许 `id-token: write`,无需 secret);**版本没真正公开时自动回退**仓库 Secret `NPM_TOKEN`(需是可发布的 granular token:不能 stage-only / read-only,allowed packages 要包含本包)。包**首次发布**前 npm 上还不存在这个包名,Trusted Publisher 也登记不了——先在本地 `npm login && npm publish --access public` 走一次(或 `npm stage publish` 后在 npmjs.com 的 Staged Packages 里用 2FA 批准),之后 tag 发布即可全自动。
|
|
138
|
+
**发布排查**:`scripts/publish-npm.sh` 失败时会打印 `npm whoami`、registry 该版本的 status、`npm stage list` 与 npm 报错原文;本地复现可用 `PACKAGE_NAME=... VERSION=... PROBE_REGISTRY=0 bash scripts/publish-npm.sh`(无凭据时只会走诊断分支)。
|
|
137
139
|
**本机跑真机验收**:`DSH_URL="http://127.0.0.1:3080/?token=..." node tools/diag-browser.js`(其余脚本同理,见 `npm run verify:paging` / `verify:lang`)。
|
|
138
140
|
|
|
139
141
|
## 验证
|
|
140
142
|
|
|
141
143
|
```sh
|
|
142
144
|
npm run check # 一条命令跑完下面三项(CI 与 Release 用的同一入口)
|
|
143
|
-
npm test # 单测(node:test,
|
|
145
|
+
npm test # 单测(node:test,34 项:config / capabilities / 宿主接线含设置页 / jsdom 客户端行为 / 发布脚本)
|
|
144
146
|
npm run smoke # E2E 冒烟:真实 HTTP 往返 + 客户端产物形状 + patch 形状
|
|
145
147
|
node scripts/verify-package.mjs # 包清单 / cordis patch / bundle 契约 / 宿主导出 / CHANGELOG 版本
|
|
146
148
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiaopb/dsh-mobile-compose",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "DSH web-UI plugin: mobile-first composer experience. Replaces the composer's add-file/command buttons with one plus entry that opens a QQ-style action sheet (image picker / camera / file / command tiles; command execution follows the official dispatch decision table (input commands claim the draft, bare commands execute via the official Enter channel)), feeds every picked file back through the official addFiles intake, exposes a host capability route plus a DSH settings-page namespace so the panel can be configured in-app, and documents the bridge contract for routing actions to native Android intents.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|