dsh-plugin-toolkit 0.20.18 → 0.20.20
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 +32 -0
- package/README.md +2 -2
- package/lib/cli.mjs +18 -5
- package/lib/release.mjs +33 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
## 0.20.20
|
|
2
|
+
|
|
3
|
+
- **A repeated `release --pr` is a no-op when the committed index already
|
|
4
|
+
carries the version.** The resume path noticed that the same version with the
|
|
5
|
+
same publish time needed no index write, but it still entered the PR
|
|
6
|
+
sequence; `git commit` then failed because there was nothing staged, and the
|
|
7
|
+
run stopped with a `market/<version>` branch left behind. An unchanged index
|
|
8
|
+
that is already committed now ends the release after the registry wait: it
|
|
9
|
+
prints `<index> already carried <version>; nothing to commit`, exits `0`,
|
|
10
|
+
leaves `git log -1` alone, and creates no branch even with `--pr` or
|
|
11
|
+
`--merge`. An entry that an earlier run without `--pr` wrote but did not
|
|
12
|
+
commit still goes through the branch and PR so the release is finished. A
|
|
13
|
+
different publish time still stops with both timestamps named. Three
|
|
14
|
+
consecutive CLI runs now assert exit `0` and an unchanged `git log -1`, and a
|
|
15
|
+
checked-in one-second-mismatch fixture pins the failure through the CLI as
|
|
16
|
+
well: exit `1`, both timestamps in the error, and no `market/<version>`
|
|
17
|
+
branch.
|
|
18
|
+
|
|
19
|
+
## 0.20.19
|
|
20
|
+
|
|
21
|
+
- **`audit --home` expands `~` and `~\` before the scan, and a bare flag is
|
|
22
|
+
refused.** The local audit resolves its home like every other user-named
|
|
23
|
+
path, so `audit --home '~/.dsh'` and `audit --home '~\.dsh'` read
|
|
24
|
+
`$HOME/.dsh` on cmd and PowerShell instead of a folder literally named `~`.
|
|
25
|
+
A checked-in home with one declared plugin whose `dsh.bundle.patch` names
|
|
26
|
+
`./missing.yml` now pins both spellings through the shipped CLI: each prints
|
|
27
|
+
the `broken` row, names the missing patch, exits `1`, and leaves no `~`
|
|
28
|
+
directory in the working folder; the absolute-path control exits `1` with the
|
|
29
|
+
same row. `--home` with no value exits `2` and says what it needs, rather
|
|
30
|
+
than scanning the current folder and reporting "no plugins installed" with
|
|
31
|
+
exit `0`. `--help` documents the flag.
|
|
32
|
+
|
|
1
33
|
## 0.20.18
|
|
2
34
|
|
|
3
35
|
- **`verify` resolves the installed root the way the loader does.** It used to
|
package/README.md
CHANGED
|
@@ -976,7 +976,7 @@ The install reports success and nothing shows up. In this order:
|
|
|
976
976
|
3. Create and push the tag, which starts the plugin's release workflow.
|
|
977
977
|
4. Poll the registry until it actually serves that version, reporting each wait.
|
|
978
978
|
5. Write the index entry with the publish time **the registry reports**, not the local clock. It waits for `time[version]` specifically: the abbreviated registry document has no `time` field, and an entry with a null timestamp is rejected by the market checker.
|
|
979
|
-
6. With `--pr`: commit that entry on `market/<version>`, push it, and open the pull request. With `--merge` as well: wait for `gh pr checks` to settle, then squash-merge.
|
|
979
|
+
6. With `--pr`: commit that entry on `market/<version>`, push it, and open the pull request. With `--merge` as well: wait for `gh pr checks` to settle, then squash-merge. When the committed index already carries this version with the same publish time there is nothing to commit, so the branch and PR steps are skipped instead of failing at `git commit`. An entry written by an earlier run without `--pr` is still uncommitted, so a later `--pr` run commits it and opens the PR.
|
|
980
980
|
|
|
981
981
|
```sh
|
|
982
982
|
npx dsh-plugin release . --pr --merge
|
|
@@ -990,7 +990,7 @@ checks settled after 1s (1 look(s))
|
|
|
990
990
|
merged
|
|
991
991
|
```
|
|
992
992
|
|
|
993
|
-
Without `--pr` it prints the `git add` / `gh pr create` commands instead of running them; `--dry-run` prints the whole sequence before anything happens. A re-run after a failure is safe: when the tag already points at HEAD it is reused rather than recreated, the release continues with the registry wait, and the same version with the same publish time is a no-op.
|
|
993
|
+
Without `--pr` it prints the `git add` / `gh pr create` commands instead of running them; `--dry-run` prints the whole sequence before anything happens. A re-run after a failure is safe: when the tag already points at HEAD it is reused rather than recreated, the release continues with the registry wait, and the same version with the same publish time is a no-op once the index entry is committed. A no-op release prints `<index> already carried <version>; nothing to commit`, exits `0`, leaves `git log -1` unchanged, and creates no `market/<version>` branch, even when `--pr` or `--merge` is passed. A different publish time is not a no-op: the release stops at `index`, names the indexed and registry timestamps in the error, exits `1`, and creates no `market/<version>` branch.
|
|
994
994
|
|
|
995
995
|
If that tag points at another commit, the release does not move it. It exits `1`
|
|
996
996
|
and names the tag, the commit it points at, HEAD, and the recovery:
|
package/lib/cli.mjs
CHANGED
|
@@ -56,6 +56,7 @@ export const HELP = `dsh-plugin — preflight and release DeepSeek Harness plugi
|
|
|
56
56
|
|
|
57
57
|
dsh-plugin audit [flags] every installed plugin: valid, and loaded by the running app
|
|
58
58
|
dsh-plugin audit --host http://127.0.0.1:54133
|
|
59
|
+
dsh-plugin audit --home '~/.dsh' the profile home; both tilde spellings expand
|
|
59
60
|
|
|
60
61
|
dsh-plugin audit --remote --from <file> audit a list and print one line per repository
|
|
61
62
|
dsh-plugin audit --remote --from repos.txt
|
|
@@ -107,6 +108,7 @@ Flags
|
|
|
107
108
|
--budget <seconds> how long to wait for npm, a positive number, default 480
|
|
108
109
|
--pr commit the index on a branch, push it, open the pull request
|
|
109
110
|
--merge with --pr: wait for checks, then squash-merge
|
|
111
|
+
--home <dir> with audit: the profile home to scan, default ~/.dsh
|
|
110
112
|
--base <branch> base branch for the pull request, default main
|
|
111
113
|
--name <package-name> with init: the npm name, required
|
|
112
114
|
--title <text> with init: the tab title, default "My panel"
|
|
@@ -188,7 +190,14 @@ function flags(argv) {
|
|
|
188
190
|
else if (token === '--pr') parsed.pr = true;
|
|
189
191
|
else if (token === '--merge') parsed.merge = true;
|
|
190
192
|
else if (token === '--publish') parsed.publish = true;
|
|
191
|
-
else if (token === '--home')
|
|
193
|
+
else if (token === '--home') {
|
|
194
|
+
// Like every other path flag: a bare `--home` is a missing path, not
|
|
195
|
+
// permission to swallow the next option. Otherwise `audit --home
|
|
196
|
+
// --timeout 50` would scan a folder literally named `--timeout` and
|
|
197
|
+
// report "no plugins installed" with exit 0.
|
|
198
|
+
const next = argv[index + 1];
|
|
199
|
+
parsed.home = next === undefined || next.startsWith('--') === true ? '' : argv[++index];
|
|
200
|
+
}
|
|
192
201
|
else if (token === '--base') parsed.base = argv[++index];
|
|
193
202
|
else if (token === '--market') parsed.market = argv[++index];
|
|
194
203
|
else if (token.startsWith('--') === true) throw new Error(`unknown flag ${token}`);
|
|
@@ -540,6 +549,10 @@ export async function run(argv, io = console, deps = {}) {
|
|
|
540
549
|
|
|
541
550
|
if (command === 'audit') {
|
|
542
551
|
const { audit, parseJobs } = await import('./audit.mjs');
|
|
552
|
+
if (options.home !== undefined && String(options.home).trim() === '') {
|
|
553
|
+
io.error('dsh-plugin audit --home needs a directory path');
|
|
554
|
+
return 2;
|
|
555
|
+
}
|
|
543
556
|
if (options.remote !== undefined || options.from !== undefined || options.patchDir !== undefined) {
|
|
544
557
|
let remote = remoteTarget(options);
|
|
545
558
|
let from = options.from;
|
|
@@ -681,13 +694,13 @@ export async function run(argv, io = console, deps = {}) {
|
|
|
681
694
|
}
|
|
682
695
|
|
|
683
696
|
io.log(`tagged ${result.tag}, npm served ${name}@${version} after ${Math.round(result.waitedMs / 1000)}s`);
|
|
684
|
-
if (result.indexUpdate !== null && result.
|
|
697
|
+
if (result.indexUpdate !== null && result.pullRequest !== undefined) {
|
|
698
|
+
io.log(`updated ${result.indexUpdate.file} on ${result.pullRequest.branch}`);
|
|
699
|
+
} else if (result.indexUpdate !== null && result.indexUpdate.unchanged === true) {
|
|
685
700
|
io.log(`${result.indexUpdate.file} already carried ${version}; nothing to commit`);
|
|
686
|
-
} else if (result.indexUpdate !== null
|
|
701
|
+
} else if (result.indexUpdate !== null) {
|
|
687
702
|
io.log(`updated ${result.indexUpdate.file} — commit it and open the PR:`);
|
|
688
703
|
io.log(` git add ${result.indexUpdate.file} && git commit -m "market: ${version}" && gh pr create --fill`);
|
|
689
|
-
} else if (result.indexUpdate !== null) {
|
|
690
|
-
io.log(`updated ${result.indexUpdate.file} on ${result.pullRequest.branch}`);
|
|
691
704
|
} else {
|
|
692
705
|
io.log('no market/index.json here, so only the tag and the publish happened');
|
|
693
706
|
}
|
package/lib/release.mjs
CHANGED
|
@@ -81,6 +81,25 @@ export function workingTreeIsClean(dir, run) {
|
|
|
81
81
|
return (run ?? ((args) => git(dir, args)))(['status', '--porcelain']) === '';
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* True when the index file has a staged, unstaged, or untracked change.
|
|
86
|
+
*
|
|
87
|
+
* "The index already carries the version" and "the index has nothing to
|
|
88
|
+
* commit" are different states: a run without `--pr` writes the entry and
|
|
89
|
+
* leaves it uncommitted, and a later `--pr` run must carry that entry into the
|
|
90
|
+
* pull request rather than skipping it as a no-op.
|
|
91
|
+
*/
|
|
92
|
+
function indexHasChanges(dir, indexFile, run) {
|
|
93
|
+
try {
|
|
94
|
+
const status = (run ?? ((args) => git(dir, args)))(['status', '--porcelain', '--', indexFile]);
|
|
95
|
+
return status !== '';
|
|
96
|
+
} catch {
|
|
97
|
+
// If git cannot answer, do not claim there is nothing to commit: let the PR
|
|
98
|
+
// sequence report the real failure instead of silently dropping the entry.
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
84
103
|
/** The paths git would carry into the tag, so the message can name them. */
|
|
85
104
|
export function dirtyPaths(dir, limit = 3, run) {
|
|
86
105
|
const status = (run ?? ((args) => git(dir, args)))(['status', '--porcelain']);
|
|
@@ -278,13 +297,25 @@ export async function release(options) {
|
|
|
278
297
|
indexUpdate,
|
|
279
298
|
};
|
|
280
299
|
|
|
281
|
-
if (options.pr !== true || indexUpdate === null) return result;
|
|
282
|
-
|
|
283
300
|
// The index change is one line, but it still needs a branch, a pull request,
|
|
284
301
|
// a green CI and a merge; doing that by hand is where "forgot to open the PR"
|
|
285
302
|
// happens.
|
|
286
303
|
const ghRunner = options.gh ?? defaultGh(indexRoot);
|
|
287
304
|
const marketGit = options.marketGit ?? (indexRoot === root ? options.git : ((args) => git(indexRoot, args)));
|
|
305
|
+
|
|
306
|
+
if (options.pr !== true || indexUpdate === null) return result;
|
|
307
|
+
|
|
308
|
+
// An unchanged index is the resume path: a previous run already wrote the
|
|
309
|
+
// same version with the same publish time. When that entry is committed there
|
|
310
|
+
// is nothing to commit, so opening a branch would fail at `git commit` and
|
|
311
|
+
// leave a branch behind for a release that is already finished. An entry
|
|
312
|
+
// written by a run without `--pr` is still uncommitted, so it must go through
|
|
313
|
+
// the PR sequence even though this run did not change the file again.
|
|
314
|
+
// Git accepts `/` on every platform; `path.relative` uses `\` on Windows and
|
|
315
|
+
// a backslash in a pathspec is an escape, so normalise before passing it on.
|
|
316
|
+
const indexPathForGit = (path.relative(indexRoot, indexPath) || indexPathFile).split(path.sep).join('/');
|
|
317
|
+
if (indexUpdate.unchanged === true && indexHasChanges(indexRoot, indexPathForGit, marketGit) === false) return result;
|
|
318
|
+
|
|
288
319
|
const pull = await openIndexPr({
|
|
289
320
|
dir: indexRoot,
|
|
290
321
|
git: marketGit,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-toolkit",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.20",
|
|
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": {
|