dsh-plugin-toolkit 0.20.21 → 0.20.22

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,3 +1,20 @@
1
+ ## 0.20.22
2
+
3
+ - **A missing `audit --home` value is refused before the scan, and a later
4
+ `--home` cannot hide it.** The parser used to leave the missing path only in
5
+ the value slot, so a second `--home <dir>` overwrote the typo and the command
6
+ scanned anyway; every missing spelling is now recorded through the rest of
7
+ parsing. `audit --home`, `audit --home --timeout 50`, `audit --home --json`
8
+ and `audit --home --home <dir>` each exit `2` with `--home needs a directory
9
+ path` on stderr and no profile report on stdout, while `audit --home <dir>`
10
+ against the one-declared-plugin fixture still prints its `missing` row and
11
+ exits `1`. The README says a bare `--home` is a usage error, not a request to
12
+ scan `$HOME/.dsh` or a folder named after the next flag. A process-boundary
13
+ test spawns the shipped CLI for all three missing spellings and requires exit
14
+ `2` with no report, then runs the same binary against a checked-in clean home
15
+ and requires exit `0` with its `clean-plugin` row, so the refusal cannot pass
16
+ by breaking every scan.
17
+
1
18
  ## 0.20.21
2
19
 
3
20
  - **`doctor --fix --write` repairs a manifest saved with a UTF-8 BOM.** `doctor`
package/README.md CHANGED
@@ -309,6 +309,12 @@ profile where the app silently skipped a plugin. It exits `0` when every
309
309
  installed plugin is loaded and valid. If no graph was read (`--host` omitted),
310
310
  the loaded column is `?` and only hard failures change the exit code.
311
311
 
312
+ `audit --home <dir>` scans a different profile home; both `~/.dsh` and
313
+ `~\.dsh` expand. A bare `--home`, or one followed by another flag such as
314
+ `--timeout 50` or `--json`, is a missing value rather than a request to scan
315
+ `$HOME/.dsh` or a folder literally named after the flag: the command exits `2`,
316
+ names `--home`, and prints no profile report.
317
+
312
318
  Without `--host` the loaded column is `?`, because guessing would be worse than
313
319
  saying nothing. Only packages that declare a `dsh` field are audited — the rest of
314
320
  `node_modules` is ordinary dependencies, and auditing those is noise.
package/lib/cli.mjs CHANGED
@@ -194,9 +194,15 @@ function flags(argv) {
194
194
  // Like every other path flag: a bare `--home` is a missing path, not
195
195
  // permission to swallow the next option. Otherwise `audit --home
196
196
  // --timeout 50` would scan a folder literally named `--timeout` and
197
- // report "no plugins installed" with exit 0.
197
+ // report "no plugins installed" with exit 0. Remember the missing value
198
+ // apart from the value itself, so a later `--home <dir>` cannot overwrite
199
+ // it and turn the same typo into a real scan.
198
200
  const next = argv[index + 1];
199
- parsed.home = next === undefined || next.startsWith('--') === true ? '' : argv[++index];
201
+ if (next === undefined || next.startsWith('--') === true) {
202
+ parsed.homeMissing = true;
203
+ } else {
204
+ parsed.home = argv[++index];
205
+ }
200
206
  }
201
207
  else if (token === '--base') parsed.base = argv[++index];
202
208
  else if (token === '--market') parsed.market = argv[++index];
@@ -548,11 +554,14 @@ export async function run(argv, io = console, deps = {}) {
548
554
  }
549
555
 
550
556
  if (command === 'audit') {
551
- const { audit, parseJobs } = await import('./audit.mjs');
552
- if (options.home !== undefined && String(options.home).trim() === '') {
557
+ // Validate the home before importing the scanner, so a missing value is a
558
+ // usage error even if the scan module would have loaded or fallen back to
559
+ // `$HOME/.dsh` and printed a clean report.
560
+ if (options.homeMissing === true || (options.home !== undefined && String(options.home).trim() === '')) {
553
561
  io.error('dsh-plugin audit --home needs a directory path');
554
562
  return 2;
555
563
  }
564
+ const { audit, parseJobs } = await import('./audit.mjs');
556
565
  if (options.remote !== undefined || options.from !== undefined || options.patchDir !== undefined) {
557
566
  let remote = remoteTarget(options);
558
567
  let from = options.from;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-toolkit",
3
- "version": "0.20.21",
3
+ "version": "0.20.22",
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": {