dsh-harness-push 1.0.1 → 1.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## [1.0.2] - 2026-10-22
6
+
7
+ ### 修复
8
+
9
+ - **插件已启用但完全没有界面**:客户端 bundle 注册的模块 id 必须等于 `package.json` 的 `name`——浏览器模块加载器按包名索引客户端模块,官方模板与所有已装插件都是这么对的。1.0.1 为了发布到 npm 把包名改成了 `dsh-harness-push`,但 bundle 里仍然是 `id: 'dsh-push'`,于是这个模块注册在一个没人解析的 id 下:Host 半边照常 `active`(插件管理里显示已启用),而设置页、侧栏图标、工作区标签页三个界面全部不会出现。现已对齐,并加了两道断言,防止再次改名时静默卸载界面。
10
+ - **工作区上一层的空 `package.json`**:一个 0 字节的 `package.json` 会让 Node 抛 `ERR_INVALID_PACKAGE_CONFIG`,破坏该目录下所有模块解析。已删除。
11
+
5
12
  ## [1.0.1] - 2026-10-22
6
13
 
7
14
  ### 修复
package/PUBLISHING.md CHANGED
@@ -38,6 +38,17 @@ npm login
38
38
  npm whoami
39
39
  ```
40
40
 
41
+ > **2FA 是硬性要求**:npm 明确拒绝无 2FA 的发布
42
+ > (`Two-factor authentication or granular access token with bypass 2fa enabled is required to publish packages`)。
43
+ > 两条可行路径:
44
+ >
45
+ > 1. **交互式发布**(推荐):`npm login` 后执行 `npm publish`,终端会提示输入认证器里的 6 位码。
46
+ > 2. **令牌发布**:在 npm → Access Tokens 创建 **Granular Access Token**,勾选
47
+ > **Bypass two-factor authentication**,权限选 *Read and write*,只授权 `dsh-harness-push`。
48
+ > **没有勾选该选项的令牌只能读、不能发布**(已实测被 403 拒绝)。
49
+ >
50
+ > 令牌一律当作密码对待:不要贴进聊天、不要写进仓库;用完即删、怀疑泄漏立刻吊销。
51
+
41
52
  ### 每次发版
42
53
 
43
54
  ```powershell
@@ -45,17 +56,17 @@ cd dsh-push
45
56
 
46
57
  # 1. 确认工作区干净、测试全过
47
58
  git status --short # 应为空
48
- npm test # 11 组测试 + 可达性审计
59
+ npm test # 14 组测试 + 可达性审计
49
60
 
50
61
  # 2. 升版本号(遵循语义化版本)
51
- npm version patch # 修 bug:1.0.0 -> 1.0.1
52
- # npm version minor # 加功能:1.0.0 -> 1.1.0
53
- # npm version major # 破坏性变更:1.0.0 -> 2.0.0
62
+ npm version patch # 修 bug:1.0.1 -> 1.0.2
63
+ # npm version minor # 加功能:1.0.2 -> 1.1.0
64
+ # npm version major # 破坏性变更:1.0.2 -> 2.0.0
54
65
 
55
66
  # 3. 先看会打包进什么(不发布)
56
67
  npm pack --dry-run
57
68
 
58
- # 4. 发布(prepublishOnly 会自动再跑一遍测试)
69
+ # 4. 发布(prepublishOnly 会自动再跑一遍测试;会提示输入 2FA 码)
59
70
  npm publish
60
71
 
61
72
  # 5. 把 tag 推上去
package/client.js CHANGED
@@ -1,5 +1,8 @@
1
1
  window.__ModuleLoader__.load({
2
- id: 'dsh-push',
2
+ // Must equal package.json `name`: the loader keys client modules by package
3
+ // name, so a mismatch registers the module under an id nobody resolves and
4
+ // every surface vanishes while the Host half still reports active.
5
+ id: 'dsh-harness-push',
3
6
  factory: (require) => {
4
7
  'use strict';
5
8
  /**
@@ -2538,8 +2541,6 @@ window.__ModuleLoader__.load({
2538
2541
  const [busy, setBusy] = useState(false);
2539
2542
  const [notice, setNotice] = useState('');
2540
2543
 
2541
- /* A dialog that opened by itself must say so. */
2542
- const agentAsked = Boolean(props.pending && props.pending.source === 'agent');
2543
2544
  const [actionError, setActionError] = useState('');
2544
2545
 
2545
2546
  // §设置 draft
@@ -5959,8 +5960,11 @@ function ReviewDialog(props) {
5959
5960
  const configureBody = [
5960
5961
  h('div', { className: 'dsh-push-rv-head', key: 'head' },
5961
5962
  h('span', { className: 'dsh-push-rv-title' }, t('rvTitle')),
5962
- // A dialog that opened by itself must say why.
5963
- agentAsked
5963
+ // A dialog that opened by itself must say why. Computed inline on
5964
+ // purpose: a component-local flag was once declared in ANOTHER
5965
+ // component by mistake, and the resulting ReferenceError stopped the
5966
+ // whole sidebar from opening.
5967
+ (props.pending && props.pending.source === 'agent')
5964
5968
  ? h('span', { className: 'dsh-push-rv-agenttag', title: t('rvAgentAskedHint') },
5965
5969
  t('rvAgentAsked'))
5966
5970
  : null,
package/cordis.patch.yml CHANGED
@@ -4,4 +4,4 @@
4
4
  # through `dsh.client` + the "./client" export, so no second row is needed.
5
5
  - insert:
6
6
  - id: push
7
- name: dsh-push
7
+ name: dsh-harness-push
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-harness-push",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "DeepSeek Harness 的 GitHub 与 Git 管理插件:多账号登录切换、仓库浏览与管理、工作区版本树、一键推送、推送前 Agent 审查。",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -54,7 +54,7 @@
54
54
  "access": "public"
55
55
  },
56
56
  "scripts": {
57
- "test": "node tests/verify-client.mjs && node tests/verify-cards.mjs && node tests/verify-tool-surface.mjs && node tests/verify-errors.mjs && node tests/verify-push-memory.mjs && node tests/verify-delete-semantics.mjs && node tests/verify-review-rules.mjs && node tests/verify-review-store.mjs && node tests/verify-review-scope.mjs && node tests/verify-contract.mjs && node tests/verify-review-gate.mjs && node tests/verify-package.mjs && node tests/audit-reachability.mjs",
57
+ "test": "node tests/verify-client.mjs && node tests/verify-cards.mjs && node tests/verify-tool-surface.mjs && node tests/verify-errors.mjs && node tests/verify-push-memory.mjs && node tests/verify-delete-semantics.mjs && node tests/verify-review-rules.mjs && node tests/verify-review-store.mjs && node tests/verify-review-scope.mjs && node tests/verify-contract.mjs && node tests/verify-render.mjs && node tests/verify-review-gate.mjs && node tests/verify-package.mjs && node tests/audit-reachability.mjs",
58
58
  "test:refspec": "powershell -ExecutionPolicy Bypass -File tests/run-refspec.ps1",
59
59
  "prepublishOnly": "npm test"
60
60
  },