dsh-plugin-toolkit 0.13.0 → 0.13.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 +20 -0
- package/README.md +29 -0
- package/README.zh.md +23 -0
- package/docs/badge.svg +19 -0
- package/lib/init.mjs +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 0.13.2
|
|
2
|
+
|
|
3
|
+
- **A table of the four ways a plugin installs and still does nothing** — red
|
|
4
|
+
dot with no panel, a row the host drops, an app that disables every plugin
|
|
5
|
+
after one unguarded `apply()`, and a tab type nothing can open. Each row is a
|
|
6
|
+
bug this toolkit shipped and then learned to catch, and each row names the
|
|
7
|
+
check that catches it now.
|
|
8
|
+
- Both READMEs. Nothing in the code changed.
|
|
9
|
+
|
|
10
|
+
## 0.13.1
|
|
11
|
+
|
|
12
|
+
- **A badge you can put on a plugin that passes.** `docs/badge.svg` plus the
|
|
13
|
+
snippet in both READMEs. It is a claim, not a decoration: the README says to
|
|
14
|
+
add it only when `verify` exits 0.
|
|
15
|
+
- **Every scaffolded plugin links back.** `init` now writes the badge into the
|
|
16
|
+
generated README, so a plugin created with the toolkit advertises the toolkit
|
|
17
|
+
it was checked with.
|
|
18
|
+
- **README badges** for version, downloads, CI and license, and the repository
|
|
19
|
+
homepage now points at the npm page.
|
|
20
|
+
|
|
1
21
|
## 0.13.0
|
|
2
22
|
|
|
3
23
|
Three more rounds of the panel, and one new thing to point it at.
|
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# dsh-plugin-toolkit
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/dsh-plugin-toolkit)
|
|
4
|
+
[](https://www.npmjs.com/package/dsh-plugin-toolkit)
|
|
5
|
+
[](https://github.com/WJDdidi-1/dsh-plugin-toolkit/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|

|
|
4
10
|
|
|
5
11
|
English · [中文](./README.zh.md)
|
|
@@ -67,6 +73,19 @@ Releasing one plugin fifteen times taught me three things the ecosystem's toolin
|
|
|
67
73
|
2. **The market index is a second release, done by hand.** Each version needs an entry carrying `publishTimestamp` from the registry and `engines.dsh` from the manifest. Forget the range and the index validator rejects the PR with `Engines mismatch` — after the tag is already public.
|
|
68
74
|
3. **Reading a manifest is not the same as checking it.** A plugin can have a valid `package.json` and still be uninstallable: `files` that omit the entry the manifest points at, a bundle patch that does not exist, a README that never states the host range it declares.
|
|
69
75
|
|
|
76
|
+
### Four ways a plugin installs and still does nothing
|
|
77
|
+
|
|
78
|
+
Each of these shipped in a real version of this toolkit before the check below existed. A manifest check passes on all four.
|
|
79
|
+
|
|
80
|
+
| What you see | What it was | Caught by |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| The tab is a red dot and the panel never opens | `exports["."]` pointed at the CLI, so the loader's row had no plugin to apply | `root export` |
|
|
83
|
+
| The plugin is installed, the app never serves it | `dsh.client` declared, `exports["./client"]` missing — the host drops the row | `client declaration` |
|
|
84
|
+
| The app says the third-party plugin is unsupported and disables all of them | `apply()` read `ctx.webServer` without declaring it; cordis throws instead of returning `undefined` | `verify` (calls `apply` on a context that has no services) |
|
|
85
|
+
| The tab registers, and nothing in the UI opens it | `sidebarRightTabs.register()` registers a *type*; the sidebar lists what `tabs.guide()` returns | a testkit test, not `doctor` |
|
|
86
|
+
|
|
87
|
+
The first three are static: `doctor` and `verify` catch them without the app running. The fourth is a UI contract, so it needs the panel mounted and the registration inspected — that is what [`testkit`](#test-a-panel-without-a-browser) is for.
|
|
88
|
+
|
|
70
89
|
## Requirements
|
|
71
90
|
|
|
72
91
|
- Node.js 18 or newer (the registry is read with `fetch`; no runtime dependencies)
|
|
@@ -210,6 +229,16 @@ $ npx dsh-plugin mount ../ai-context-doctor/plugin/client.js
|
|
|
210
229
|
AIignore No workspace yet Could not read the report …
|
|
211
230
|
```
|
|
212
231
|
|
|
232
|
+
## Put the badge on a plugin that passes
|
|
233
|
+
|
|
234
|
+
If `verify` passes on your plugin, this badge says so and links back here:
|
|
235
|
+
|
|
236
|
+
```md
|
|
237
|
+
[](https://github.com/WJDdidi-1/dsh-plugin-toolkit)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
It is a claim, not a decoration: add it only when `dsh-plugin verify .` exits 0.
|
|
241
|
+
|
|
213
242
|
## Start from the example
|
|
214
243
|
|
|
215
244
|
[`dsh-plugin-example`](https://github.com/WJDdidi-1/dsh-plugin-example) is a ~70-line plugin: one sidebar tab, two languages, one behaviour test, CI that runs `verify` through the composite action. It is the shape this toolkit expects, so it is also the fastest way to see whether the toolkit fits your plugin. It is a GitHub template too: **Use this template** starts you on a plugin whose first publish already passes.
|
package/README.zh.md
CHANGED
|
@@ -31,11 +31,34 @@ npx dsh-plugin-toolkit@latest release --pr --merge # 打 tag、等
|
|
|
31
31
|
|
|
32
32
|
每一条都能在发布前被机器拦住,所以每一条现在都是一项检查。这些检查对着**宿主的解析代码**写,而不是对着文件约定写——差别就是 `verify` 报 `mounted the panel` 而真实宿主什么都不加载。
|
|
33
33
|
|
|
34
|
+
### 插件装上了却什么都不做的四种样子
|
|
35
|
+
|
|
36
|
+
下面每一条都真实发布过,而且**只看 manifest 一个都发现不了**。
|
|
37
|
+
|
|
38
|
+
| 你会看到 | 真正的原因 | 现在由谁拦 |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| 标签是个红点,面板永远打不开 | `exports["."]` 指向了 CLI,加载器那一行没有插件可挂 | `root export` |
|
|
41
|
+
| 插件装上了,应用从不加载它 | 声明了 `dsh.client`,但 `exports["./client"]` 不存在——宿主直接丢掉这一行 | `client declaration` |
|
|
42
|
+
| 应用提示「第三方插件不支持」,把所有插件都禁用 | `apply()` 读了没声明的 `ctx.webServer`,cordis 不是返回 `undefined` 而是抛错 | `verify`(在一个没有任何服务的 ctx 上调用 `apply`) |
|
|
43
|
+
| 标签注册成功,界面里却没有任何入口 | `sidebarRightTabs.register()` 注册的是**类型**,侧栏列的是 `tabs.guide()` 的返回 | testkit 的测试,不是 `doctor` |
|
|
44
|
+
|
|
45
|
+
前三条是静态的:`doctor` 和 `verify` 不用开应用就能抓到。第四条是 UI 契约,必须把面板挂起来、检查注册出去的参数——那是 [`testkit`](#不用浏览器测面板) 的活。
|
|
46
|
+
|
|
34
47
|
## 安装要求
|
|
35
48
|
|
|
36
49
|
- Node.js 18 或更新(CI 在 18/20/22 × ubuntu/macos/windows 上跑)。
|
|
37
50
|
- 要发布时需要一个能写 `market/index.json` 的仓库和 `gh`(已登录)。
|
|
38
51
|
|
|
52
|
+
## 通过检查就挂个徽章
|
|
53
|
+
|
|
54
|
+
`verify` 过了,可以用这个徽章,点回这里:
|
|
55
|
+
|
|
56
|
+
```md
|
|
57
|
+
[](https://github.com/WJDdidi-1/dsh-plugin-toolkit)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
这是声明不是装饰:`dsh-plugin verify .` 退出码为 0 才挂。
|
|
61
|
+
|
|
39
62
|
## 从一个已经能通过检查的插件开始
|
|
40
63
|
|
|
41
64
|
```sh
|
package/docs/badge.svg
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="196" height="20" role="img" aria-label="dsh plugin: verify passed">
|
|
2
|
+
<title>dsh plugin: verify passed</title>
|
|
3
|
+
<linearGradient id="s" x2="0" y2="100%">
|
|
4
|
+
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
|
5
|
+
<stop offset="1" stop-opacity=".1"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<clipPath id="r"><rect width="196" height="20" rx="3" fill="#fff"/></clipPath>
|
|
8
|
+
<g clip-path="url(#r)">
|
|
9
|
+
<rect width="82" height="20" fill="#2f3542"/>
|
|
10
|
+
<rect x="82" width="114" height="20" fill="#1a7f37"/>
|
|
11
|
+
<rect width="196" height="20" fill="url(#s)"/>
|
|
12
|
+
</g>
|
|
13
|
+
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
|
14
|
+
<text x="41" y="15" fill="#010101" fill-opacity=".3">dsh plugin</text>
|
|
15
|
+
<text x="41" y="14">dsh plugin</text>
|
|
16
|
+
<text x="139" y="15" fill="#010101" fill-opacity=".3">✓ verify passed</text>
|
|
17
|
+
<text x="139" y="14">✓ verify passed</text>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
package/lib/init.mjs
CHANGED
|
@@ -150,7 +150,7 @@ export function files({ name, title = 'My panel', version = '0.1.0' }) {
|
|
|
150
150
|
'index.js': `export const name = '${name}';\n\n// The host half runs in Node. Most panels need nothing here.\nexport function apply() {}\n`,
|
|
151
151
|
'client.js': client({ name, title }),
|
|
152
152
|
'test/panel.test.mjs': test({ name, title }),
|
|
153
|
-
'README.md': `# ${slug}\n\n${title} — a panel for DeepSeek Harness.\n\n## Requirements\n\n| What | Version | Why |\n| --- | --- | --- |\n| DeepSeek Harness | >= 0.2.0 | provides \`sidebarRightTabs\` |\n| Node | >= 18 | the host half |\n\n## Develop\n\n\`\`\`sh\nnpm install\nnpm test # mounts client.js in Node\nnpm run doctor # checks the manifest before you publish\n\`\`\`\n\n## Install\n\n\`\`\`sh\ndsh plugin add ${name}\n\`\`\`\n`,
|
|
153
|
+
'README.md': `# ${slug}\n\n${title} — a panel for DeepSeek Harness.\n\n[](https://github.com/WJDdidi-1/dsh-plugin-toolkit)\n\n## Requirements\n\n| What | Version | Why |\n| --- | --- | --- |\n| DeepSeek Harness | >= 0.2.0 | provides \`sidebarRightTabs\` |\n| Node | >= 18 | the host half |\n\n## Develop\n\n\`\`\`sh\nnpm install\nnpm test # mounts client.js in Node\nnpm run doctor # checks the manifest before you publish\n\`\`\`\n\n## Install\n\n\`\`\`sh\ndsh plugin add ${name}\n\`\`\`\n`,
|
|
154
154
|
'.gitignore': 'node_modules/\n',
|
|
155
155
|
'.github/workflows/ci.yml': `name: ci\n\non:\n push:\n branches: [main]\n pull_request:\n\njobs:\n test:\n runs-on: ubuntu-latest\n strategy:\n matrix:\n node: [18, 20, 22]\n steps:\n - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: \${{ matrix.node }}\n - run: npm install\n - run: npm test\n # verify, not doctor: doctor reads the working copy, so a \`files\` list\n # that forgets client.js passes it and the installed plugin has no panel.\n - uses: WJDdidi-1/dsh-plugin-toolkit@v1\n with:\n dir: .\n version: ${VERSION}\n`,
|
|
156
156
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-toolkit",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"description": "Preflight, release and test DeepSeek Harness plugins: check a folder or any GitHub repository, wait for npm to actually serve the version, and keep the market index honest.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"README.md",
|
|
22
22
|
"README.zh.md",
|
|
23
23
|
"LICENSE",
|
|
24
|
-
"CHANGELOG.md"
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"docs/badge.svg"
|
|
25
26
|
],
|
|
26
27
|
"engines": {
|
|
27
28
|
"node": ">=18",
|