dshmarket 1.20.3 → 1.20.4

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/lib/dsh-cli.js CHANGED
@@ -185,7 +185,10 @@ export function toolSearchDirs(platform = process.platform, env = process.env, h
185
185
  dirs.push(join(home, 'Library', 'pnpm'), join(home, '.local', 'share', 'pnpm'));
186
186
  }
187
187
  dirs.push(nodeBinDir, ...extraPathDirs);
188
- return dirs;
188
+ // Deduped: PNPM_HOME usually names one of the defaults below it, and a
189
+ // list that says the same directory twice reads as carelessness in the
190
+ // one place a user goes looking for an answer.
191
+ return [...new Set(dirs.filter(dir => dir.trim() !== ''))];
189
192
  }
190
193
  function spawnEnv() {
191
194
  // pnpm v10+ blocks forever on a silent interactive prompt without a TTY;
@@ -478,7 +481,18 @@ export function provisionHint(corepackOutput, npmOutput, npmFound = true) {
478
481
  if (/ETIMEDOUT|ECONNREFUSED|ENOTFOUND|EAI_AGAIN|network|proxy|certificate/i.test(`${corepackOutput}\n${npmOutput}`)) {
479
482
  return '装 pnpm 时网络失败。若你在受限网络下,corepack 的 shim 也下载不到 pnpm 本体——请改用完整安装或指定镜像:brew install pnpm(macOS/Linux),或 npm i -g pnpm --registry <你的镜像> / Network failure while installing pnpm. On a restricted network the corepack shim cannot download pnpm either — install it fully or point at a mirror: `brew install pnpm`, or `npm i -g pnpm --registry <your mirror>`';
480
483
  }
481
- return undefined;
484
+ // Everything reported success and pnpm still will not run (#228 by
485
+ // @ZhengXin1023: corepack exit=0, npm -g exit=0, npm found — and the
486
+ // install button stayed locked with nothing said).
487
+ //
488
+ // This used to return undefined, which left the case that most needs an
489
+ // explanation with none: the user is told "setup failed" while every step
490
+ // they can see succeeded, and their complaint was exactly that — "又不告诉
491
+ // 我怎么手动配置". Whatever the cause, the actionable question is the same
492
+ // one, so ask it: where is pnpm, and is that anywhere this process looks?
493
+ const searched = toolSearchDirs().join(process.platform === 'win32' ? ' ; ' : ' : ');
494
+ const locate = process.platform === 'win32' ? 'where pnpm' : 'which pnpm';
495
+ return `pnpm 装好了,但这个 dsh 进程仍然启动不了它——安装步骤都成功,只是装到的位置不在它搜索的范围内。已找过:${searched}。请在终端执行 \`${locate}\` 看 pnpm 实际在哪:如果它不在上面这些目录里,把该目录设为 PNPM_HOME 后重启 dsh(\`export PNPM_HOME=<那个目录>\`),或者干脆从一个能直接运行 pnpm 的终端里启动 dsh。注意必须重启——正在运行的进程读不到新设的环境变量 / pnpm is installed but this dsh process still cannot start it: every step succeeded, the binary just landed somewhere this process does not look. Searched: ${searched}. Run \`${locate}\` in a terminal to see where pnpm actually is; if that directory is not in the list above, set PNPM_HOME to it and restart dsh (\`export PNPM_HOME=<that directory>\`), or simply start dsh from a terminal where \`pnpm\` already runs. The restart matters — a running process cannot see a newly set variable`;
482
496
  }
483
497
  /** Singleton progress state; the status route reads it, runDshPlugin writes it. */
484
498
  export const progress = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dshmarket",
3
3
  "description": "Visual plugin market inside DeepSeek Harness — browse, search, and one-click install community plugins. · DSH 可视化插件市场:逛一逛,点一下,装好。",
4
- "version": "1.20.3",
4
+ "version": "1.20.4",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
package/src/dsh-cli.ts CHANGED
@@ -186,7 +186,10 @@ export function toolSearchDirs(
186
186
  dirs.push(join(home, 'Library', 'pnpm'), join(home, '.local', 'share', 'pnpm'))
187
187
  }
188
188
  dirs.push(nodeBinDir, ...extraPathDirs)
189
- return dirs
189
+ // Deduped: PNPM_HOME usually names one of the defaults below it, and a
190
+ // list that says the same directory twice reads as carelessness in the
191
+ // one place a user goes looking for an answer.
192
+ return [...new Set(dirs.filter(dir => dir.trim() !== ''))]
190
193
  }
191
194
 
192
195
  function spawnEnv(): NodeJS.ProcessEnv {
@@ -553,7 +556,18 @@ export function provisionHint(corepackOutput: string, npmOutput: string, npmFoun
553
556
  if (/ETIMEDOUT|ECONNREFUSED|ENOTFOUND|EAI_AGAIN|network|proxy|certificate/i.test(`${corepackOutput}\n${npmOutput}`)) {
554
557
  return '装 pnpm 时网络失败。若你在受限网络下,corepack 的 shim 也下载不到 pnpm 本体——请改用完整安装或指定镜像:brew install pnpm(macOS/Linux),或 npm i -g pnpm --registry <你的镜像> / Network failure while installing pnpm. On a restricted network the corepack shim cannot download pnpm either — install it fully or point at a mirror: `brew install pnpm`, or `npm i -g pnpm --registry <your mirror>`'
555
558
  }
556
- return undefined
559
+ // Everything reported success and pnpm still will not run (#228 by
560
+ // @ZhengXin1023: corepack exit=0, npm -g exit=0, npm found — and the
561
+ // install button stayed locked with nothing said).
562
+ //
563
+ // This used to return undefined, which left the case that most needs an
564
+ // explanation with none: the user is told "setup failed" while every step
565
+ // they can see succeeded, and their complaint was exactly that — "又不告诉
566
+ // 我怎么手动配置". Whatever the cause, the actionable question is the same
567
+ // one, so ask it: where is pnpm, and is that anywhere this process looks?
568
+ const searched = toolSearchDirs().join(process.platform === 'win32' ? ' ; ' : ' : ')
569
+ const locate = process.platform === 'win32' ? 'where pnpm' : 'which pnpm'
570
+ return `pnpm 装好了,但这个 dsh 进程仍然启动不了它——安装步骤都成功,只是装到的位置不在它搜索的范围内。已找过:${searched}。请在终端执行 \`${locate}\` 看 pnpm 实际在哪:如果它不在上面这些目录里,把该目录设为 PNPM_HOME 后重启 dsh(\`export PNPM_HOME=<那个目录>\`),或者干脆从一个能直接运行 pnpm 的终端里启动 dsh。注意必须重启——正在运行的进程读不到新设的环境变量 / pnpm is installed but this dsh process still cannot start it: every step succeeded, the binary just landed somewhere this process does not look. Searched: ${searched}. Run \`${locate}\` in a terminal to see where pnpm actually is; if that directory is not in the list above, set PNPM_HOME to it and restart dsh (\`export PNPM_HOME=<that directory>\`), or simply start dsh from a terminal where \`pnpm\` already runs. The restart matters — a running process cannot see a newly set variable`
557
571
  }
558
572
 
559
573
  /** Live progress of the running plugin command, for the status route. */