dsh-plugin-toolkit 0.6.3 → 0.7.0

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
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0
4
+
5
+ Documentation, restructured around what you are trying to do rather than what the tool contains.
6
+
7
+ - README opens with **Three paths** — write a plugin, develop a panel, ship a version — and each path shows the commands it needs.
8
+ - `--help` gives every command one example line that can be pasted as-is, instead of syntax with placeholders.
9
+ - The stale `Roadmap` (which still described `dev` as unbuilt, two releases after it shipped) is replaced by **What is not here yet**: no `npm publish`, no check against a running app, `dev --host` not covered by CI, no Windows test of the watcher.
10
+ - `test/help.test.mjs` keeps all three honest: every command needs an example without placeholders, the three paths must show each command, and the README may not call a shipped feature unbuilt.
11
+
3
12
  ## 0.6.3
4
13
 
5
14
  - `git` and `gh` are `.exe` on Windows, not `.cmd`; 0.6.2 renamed them too and `git.cmd` does not exist. Only the npm family is a shim now.
package/README.md CHANGED
@@ -2,19 +2,48 @@
2
2
 
3
3
  ![dsh-plugin-toolkit](docs/card.png)
4
4
 
5
- A preflight and release tool for [DeepSeek Harness](https://github.com/deepseek-ai/dsh) plugins, plus the pieces of the publishing ritual that kept going wrong by hand.
5
+ Everything a [DeepSeek Harness](https://github.com/deepseek-ai/dsh) plugin needs between `init` and a version the market index accepts: scaffolding, a test harness for the client bundle, a way to see a change without restarting the app, and a release that does not depend on remembering fourteen steps.
6
6
 
7
+ ```sh
8
+ npx dsh-plugin-toolkit@0.7.0 init ./my-panel --name my-panel # a plugin that already passes the checks
9
+ npx dsh-plugin-toolkit@0.7.0 verify . # pack it, install the tarball, mount the panel
10
+ npx dsh-plugin-toolkit@0.7.0 release --pr --merge # tag, wait for npm, update the index, open and merge the PR
7
11
  ```
8
- npx dsh-plugin doctor . # can this plugin be loaded and installed?
9
- npx dsh-plugin index # does every market-index version state a host range?
10
- npx dsh-plugin release --dry-run # what would shipping this version do?
12
+
13
+ ## Three paths
14
+
15
+ | You are… | Start with | Then |
16
+ | --- | --- | --- |
17
+ | writing your first plugin | [`init`](#1-write-a-plugin) | `doctor`, `verify` |
18
+ | changing a panel that is already installed | [`dev`](#2-develop-a-panel) | `mount`, the testkit |
19
+ | shipping a version | [`verify`](#3-ship-a-version) | `release`, `index` |
20
+
21
+ ### 1. Write a plugin
22
+
23
+ [`init`](#start-from-a-plugin-that-already-passes) writes the files whose absence shows up as a failed first publish — `engines.dsh`, the patch file, a `files` list that ships the code, a client bundle, a test for it, and the CI that runs both. `doctor` then checks the same things without writing anything, and [`verify`](#prove-the-tarball-works-not-just-the-repository) checks the tarball instead of the working copy.
24
+
25
+ ```sh
26
+ npx dsh-plugin-toolkit@0.7.0 init ./my-panel --name my-panel
27
+ cd my-panel && npm install && npm test && npx dsh-plugin-toolkit@0.7.0 doctor .
11
28
  ```
12
29
 
13
- ## Requirements
30
+ ### 2. Develop a panel
14
31
 
15
- - Node.js 18 or newer (`node --fetch` is used to read the registry; no dependencies)
16
- - Git and `gh` on `PATH` for the steps that touch GitHub
17
- - DeepSeek Harness `>=0.2.0` — the version whose market index carries `engines.dsh`, which is what makes the range check meaningful
32
+ A plugin's client code is one file that calls `window.__ModuleLoader__.load({factory})` — there is no module to import, so the usual React test setup does not apply. [`testkit`](#test-a-panel-without-a-browser) supplies the missing half, and [`dev`](#edit-a-plugin-that-is-already-installed) pushes a rebuilt bundle into the running app.
33
+
34
+ ```sh
35
+ npx dsh-plugin-toolkit@0.7.0 mount ./client.js # what a user would see, without the app
36
+ npx dsh-plugin-toolkit@0.7.0 dev . --host http://127.0.0.1:54133
37
+ ```
38
+
39
+ ### 3. Ship a version
40
+
41
+ `verify` first (it is the only check that reads the tarball), then `release`, which tags, waits for the registry, writes the index entry with the publish time the registry reports, and — with `--pr --merge` — opens and merges the pull request.
42
+
43
+ ```sh
44
+ npx dsh-plugin-toolkit@0.7.0 verify .
45
+ npx dsh-plugin-toolkit@0.7.0 release . --pr --merge
46
+ ```
18
47
 
19
48
  ## Why this exists
20
49
 
@@ -24,11 +53,17 @@ Releasing one plugin fifteen times taught me three things the ecosystem's toolin
24
53
  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.
25
54
  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.
26
55
 
56
+ ## Requirements
57
+
58
+ - Node.js 18 or newer (the registry is read with `fetch`; no runtime dependencies)
59
+ - Git and `gh` on `PATH` for the steps that touch GitHub
60
+ - DeepSeek Harness `>=0.2.0` — the version whose market index carries `engines.dsh`, which is what makes the range check meaningful
61
+ - For `testkit`: `jsdom`, `react` and `react-dom` as dev dependencies (`npm install --save-dev jsdom react react-dom`)
27
62
 
28
63
  ## Start from a plugin that already passes
29
64
 
30
65
  ```sh
31
- $ npx dsh-plugin-toolkit@0.5.0 init ./my-panel --name my-panel --title "My panel"
66
+ $ npx dsh-plugin-toolkit@0.7.0 init ./my-panel --name my-panel --title "My panel"
32
67
  created 8 file(s) in /Users/you/my-panel
33
68
  .github/workflows/ci.yml
34
69
  .gitignore
@@ -203,7 +238,7 @@ Exit code is `0` when the plugin can be installed and `1` when it cannot, so it
203
238
  `doctor` reads your working copy. Users install the tarball, and a `files` list can ship everything except the panel — `doctor` will not notice.
204
239
 
205
240
  ```sh
206
- $ npx dsh-plugin-toolkit@0.6.0 verify .
241
+ $ npx dsh-plugin-toolkit@0.7.0 verify .
207
242
  ok packed 5 file(s), installed the tarball, mounted the panel
208
243
  My panel This panel came from dsh-plugin init. Clicks: 0
209
244
  ```
@@ -211,7 +246,7 @@ ok packed 5 file(s), installed the tarball, mounted the panel
211
246
  It packs, installs that tarball into a throwaway directory, then mounts the bundle **from the installed copy**. When the `files` list drops the panel:
212
247
 
213
248
  ```sh
214
- $ npx dsh-plugin-toolkit@0.6.0 verify .
249
+ $ npx dsh-plugin-toolkit@0.7.0 verify .
215
250
  dsh-plugin verify: stopped at pack
216
251
  ✗ pack: the tarball does not contain client.js, so the installed plugin has no panel
217
252
  ```
@@ -249,17 +284,14 @@ Without `--pr` it prints the `git add` / `gh pr create` commands instead of runn
249
284
  | 1 | A check failed, or the release stopped (the failing stage is named) |
250
285
  | 2 | Unknown command |
251
286
 
252
- ## Looking at it without a Harness
253
-
254
- The fixtures under `test/fixtures/` are three tiny plugins — one good, one missing its host range, one whose README contradicts its manifest — and the tests run every check against them:
255
-
256
- ```
257
- npm test
258
- ```
287
+ ## What is not here yet
259
288
 
260
- ## Roadmap
289
+ Honest list, so nobody plans around a feature that does not exist:
261
290
 
262
- - `dev`: watch a client bundle and push it to a running app, instead of restarting the app for every change. Needs one probe first: whether the host exposes a channel that accepts a pushed bundle.
291
+ - **No `npm publish`.** `release` pushes the tag and waits for the registry, so publishing stays in the workflow where your token and provenance live. It never holds your npm credentials.
292
+ - **No check against a running app.** `verify` mounts the installed bundle in Node with a stubbed host. It cannot prove the panel appears in a real sidebar — only that the code the tarball ships renders.
293
+ - **`dev --host` is not covered by CI.** The unit tests use a synthetic event stream; the live path is exercised by hand against a running app, on macOS only.
294
+ - **No Windows testing of the `dev` file watcher.** The Windows CI job runs the whole suite, but the watcher is only asserted against a temp directory, not a real profile.
263
295
 
264
296
  ## License
265
297
 
package/lib/cli.mjs CHANGED
@@ -13,13 +13,26 @@ import { auditVersions, readIndex } from './index-file.mjs';
13
13
 
14
14
  export const HELP = `dsh-plugin — preflight and release DeepSeek Harness plugins
15
15
 
16
- dsh-plugin doctor [dir] check the manifest, README and bundle
17
- dsh-plugin release [dir] [flags] tag, wait for npm, update the market index, open the PR
18
- dsh-plugin index [dir] audit every version in market/index.json
19
- dsh-plugin mount <client.js> render a client bundle in Node and print what a user would see
20
- dsh-plugin dev [dir] [flags] copy a rebuilt bundle into the installed plugin and confirm the reload
21
- dsh-plugin init <dir> --name <pkg> scaffold a plugin that already passes doctor
22
- dsh-plugin verify [dir] pack it, install the tarball, mount the installed panel
16
+ dsh-plugin init <dir> --name <pkg> scaffold a plugin that already passes doctor
17
+ dsh-plugin init ./my-panel --name my-panel
18
+
19
+ dsh-plugin doctor [dir] check the manifest, README and bundle
20
+ dsh-plugin doctor .
21
+
22
+ dsh-plugin verify [dir] pack it, install the tarball, mount the installed panel
23
+ dsh-plugin verify .
24
+
25
+ dsh-plugin mount <client.js> render a client bundle in Node and print what a user would see
26
+ dsh-plugin mount ./client.js --html
27
+
28
+ dsh-plugin dev [dir] [flags] copy a rebuilt bundle into the installed plugin and confirm the reload
29
+ dsh-plugin dev . --host http://127.0.0.1:54133
30
+
31
+ dsh-plugin release [dir] [flags] tag, wait for npm, update the market index, open the PR
32
+ dsh-plugin release . --pr --merge
33
+
34
+ dsh-plugin index [dir] audit every version in market/index.json
35
+ dsh-plugin index market/index.json
23
36
 
24
37
  Flags
25
38
  --dry-run show the steps without touching anything
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-toolkit",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "description": "Preflight, release and test DeepSeek Harness plugins: checks what the host needs, waits for npm to actually serve the version, and keeps the market index honest.",
5
5
  "type": "module",
6
6
  "bin": {