dshmarket 1.5.0 → 1.5.1

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/README.md CHANGED
@@ -55,6 +55,11 @@ Installs prefer npm tarballs over full-repo GitHub downloads whenever a plugin p
55
55
 
56
56
  **This repo is the market app, not the catalog.** The plugin list comes from the curated [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) registry — to get your plugin listed in the market, open a PR **there** (one entry in the list; the site and this market pick it up automatically, usually within a day). Please don't PR plugin entries against this repo.
57
57
 
58
+ ## Roadmap & feedback
59
+
60
+ - Planned features live on the [Roadmap](https://github.com/orgs/dsh-market/projects/1) — every item welcomes community PRs (drop a note in the linked issue before starting)
61
+ - File bugs and ideas as [issues](https://github.com/dsh-market/dsh-market/issues); attaching the market's "Export log" makes diagnosis 10x faster
62
+
58
63
  ## Data source
59
64
 
60
65
  Live from [awesome-dsh-plugin.com/plugins.json](https://awesome-dsh-plugin.com/plugins.json) — curated entries, npm mapping, and star counts refreshed daily by CI — with a bundled snapshot as offline fallback.
package/README.zh.md CHANGED
@@ -55,6 +55,11 @@ dsh plugin --profile web add dshmarket
55
55
 
56
56
  **这个仓库是市场应用本身,不是插件目录。** 市场里的插件列表来自精选列表 [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)——想让你的插件上架,请去**那边**提 PR(在列表里加一条即可,站点和本市场会自动收录,通常一天内生效)。请不要往本仓库提插件条目。
57
57
 
58
+ ## 路线图与反馈
59
+
60
+ - 功能规划见 [Roadmap](https://github.com/orgs/dsh-market/projects/1),每一项都欢迎社区 PR(动手前在对应 issue 里说一声)
61
+ - Bug 与建议请提 [issue](https://github.com/dsh-market/dsh-market/issues),附上市场页面的「导出日志」能让排查快十倍
62
+
58
63
  ## 数据源
59
64
 
60
65
  实时来自 [awesome-dsh-plugin.com/plugins.json](https://awesome-dsh-plugin.com/plugins.json)——精选条目、npm 映射、star 数由 CI 每日刷新——内置快照做离线兜底。
package/client/client.js CHANGED
@@ -327,16 +327,56 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
327
327
  }
328
328
  return ids;
329
329
  }
330
+ /**
331
+ * Repo identities stated by the dependency SPEC itself (github: installs) —
332
+ * hard evidence of where the package came from, unlike the name-derived
333
+ * mirror in depIdentities, which is only a matching aid.
334
+ */
335
+ function depSpecRepoIds(spec) {
336
+ const ids = /* @__PURE__ */ new Set();
337
+ const m = /github:([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)(?:#path:\/([A-Za-z0-9_./-]+))?/i.exec(spec);
338
+ if (m !== null) {
339
+ ids.add(m[1].toLowerCase());
340
+ if (m[2] !== void 0) ids.add(`${m[1].toLowerCase()}#path:/${m[2].toLowerCase()}`);
341
+ }
342
+ return ids;
343
+ }
344
+ /** Repo identity of a registry entry's source url (repo or repo#path form). */
345
+ function entryRepoIds(plugin) {
346
+ const ids = /* @__PURE__ */ new Set();
347
+ const m = /^https:\/\/github\.com\/([^/]+\/[^/]+?)(?:\/tree\/[^/]+\/(.+?))?\/?$/.exec(plugin.url);
348
+ if (m !== null) ids.add(m[2] !== void 0 ? `${m[1].toLowerCase()}#path:/${m[2].toLowerCase()}` : m[1].toLowerCase());
349
+ return ids;
350
+ }
351
+ /**
352
+ * The curated registry lists distinct plugins sharing one name — twelve
353
+ * name-groups at the time of #66 (both dsh-usage-stats, four dsh-memory…).
354
+ * A name coincidence must not survive contradicting repo evidence: when the
355
+ * dependency's spec pins a github repo AND the entry states one, the repos
356
+ * decide — the loose name/npm identities only apply when at least one side
357
+ * carries no repo evidence (npm installs, non-github entries).
358
+ */
359
+ function sameSourceConflict(plugin, spec) {
360
+ const entry = entryRepoIds(plugin);
361
+ const dep = depSpecRepoIds(spec);
362
+ if (entry.size === 0 || dep.size === 0) return false;
363
+ for (const id of dep) if (entry.has(id)) return false;
364
+ return true;
365
+ }
330
366
  /** The installed dependency name a registry entry corresponds to, or null. */
331
367
  function matchInstalledName(plugin, installed) {
332
368
  const ids = entryIdentities(plugin);
333
- for (const [name, spec] of Object.entries(installed)) for (const id of depIdentities(name, String(spec))) if (ids.has(id)) return name;
369
+ for (const [name, spec] of Object.entries(installed)) {
370
+ if (sameSourceConflict(plugin, String(spec))) continue;
371
+ for (const id of depIdentities(name, String(spec))) if (ids.has(id)) return name;
372
+ }
334
373
  return null;
335
374
  }
336
375
  /** The registry entry an installed dependency corresponds to, or undefined. */
337
376
  function entryForDep(plugins, name, spec) {
338
377
  const ids = depIdentities(name, String(spec));
339
378
  return plugins.find((plugin) => {
379
+ if (sameSourceConflict(plugin, String(spec))) return false;
340
380
  for (const id of entryIdentities(plugin)) if (ids.has(id)) return true;
341
381
  return false;
342
382
  });
@@ -402,86 +442,86 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
402
442
  document.head.appendChild(tag);
403
443
  }
404
444
  var Market_module_css_default = {
405
- "spec": "eGUBIq_spec",
406
- "spin": "eGUBIq_spin",
407
- "tag": "eGUBIq_tag",
408
- "src": "eGUBIq_src",
409
- "okState": "eGUBIq_okState",
410
- "cats": "eGUBIq_cats",
411
- "staleAction": "eGUBIq_staleAction",
445
+ "star": "eGUBIq_star",
446
+ "barWave": "eGUBIq_barWave",
447
+ "filterBtnOn": "eGUBIq_filterBtnOn",
412
448
  "filterTitle": "eGUBIq_filterTitle",
413
- "filterBtn": "eGUBIq_filterBtn",
414
- "owner": "eGUBIq_owner",
415
- "sect": "eGUBIq_sect",
416
- "err": "eGUBIq_err",
417
- "catsToggle": "eGUBIq_catsToggle",
418
- "card": "eGUBIq_card",
419
- "catsWrap": "eGUBIq_catsWrap",
420
- "warnBtn": "eGUBIq_warnBtn",
421
- "root": "eGUBIq_root",
422
- "catsRow": "eGUBIq_catsRow",
423
- "dot": "eGUBIq_dot",
424
- "swatches": "eGUBIq_swatches",
425
- "loading": "eGUBIq_loading",
426
- "act": "eGUBIq_act",
427
- "catsCollapsed": "eGUBIq_catsCollapsed",
449
+ "cmd": "eGUBIq_cmd",
450
+ "sp": "eGUBIq_sp",
451
+ "descTight": "eGUBIq_descTight",
428
452
  "actWarn": "eGUBIq_actWarn",
429
- "body": "eGUBIq_body",
430
- "cmdSummary": "eGUBIq_cmdSummary",
431
- "barWave": "eGUBIq_barWave",
432
- "star": "eGUBIq_star",
433
- "dangerBtn": "eGUBIq_dangerBtn",
434
- "title": "eGUBIq_title",
453
+ "staleAction": "eGUBIq_staleAction",
454
+ "pageBtn": "eGUBIq_pageBtn",
455
+ "actBroken": "eGUBIq_actBroken",
456
+ "pageInfo": "eGUBIq_pageInfo",
457
+ "actLive": "eGUBIq_actLive",
458
+ "catsCollapsed": "eGUBIq_catsCollapsed",
435
459
  "actWhy": "eGUBIq_actWhy",
436
- "progress": "eGUBIq_progress",
460
+ "loading": "eGUBIq_loading",
461
+ "sizeLabel": "eGUBIq_sizeLabel",
462
+ "cats": "eGUBIq_cats",
463
+ "bar": "eGUBIq_bar",
464
+ "pager": "eGUBIq_pager",
465
+ "titleRow": "eGUBIq_titleRow",
437
466
  "on": "eGUBIq_on",
438
- "restart": "eGUBIq_restart",
467
+ "filterOption": "eGUBIq_filterOption",
439
468
  "dangerArmed": "eGUBIq_dangerArmed",
440
- "foot": "eGUBIq_foot",
441
- "grid": "eGUBIq_grid",
442
- "tabs": "eGUBIq_tabs",
443
- "empty": "eGUBIq_empty",
444
- "warnLine": "eGUBIq_warnLine",
445
- "sp": "eGUBIq_sp",
446
- "dshmSlide": "eGUBIq_dshmSlide",
447
- "sizeBtn": "eGUBIq_sizeBtn",
448
- "pageEllipsis": "eGUBIq_pageEllipsis",
449
- "pageInfo": "eGUBIq_pageInfo",
469
+ "sect": "eGUBIq_sect",
450
470
  "pct": "eGUBIq_pct",
451
- "desc": "eGUBIq_desc",
452
- "pageBtn": "eGUBIq_pageBtn",
453
- "filterWrap": "eGUBIq_filterWrap",
454
- "sizeLabel": "eGUBIq_sizeLabel",
455
- "cmd": "eGUBIq_cmd",
456
- "actLive": "eGUBIq_actLive",
457
- "themesGrid": "eGUBIq_themesGrid",
471
+ "cancelBtn": "eGUBIq_cancelBtn",
458
472
  "pagerSize": "eGUBIq_pagerSize",
473
+ "dot": "eGUBIq_dot",
474
+ "restart": "eGUBIq_restart",
475
+ "sub": "eGUBIq_sub",
476
+ "top": "eGUBIq_top",
477
+ "catsRow": "eGUBIq_catsRow",
478
+ "src": "eGUBIq_src",
479
+ "okState": "eGUBIq_okState",
480
+ "dangerBtn": "eGUBIq_dangerBtn",
481
+ "catsToggle": "eGUBIq_catsToggle",
482
+ "barFill": "eGUBIq_barFill",
483
+ "tabs": "eGUBIq_tabs",
484
+ "sizeOn": "eGUBIq_sizeOn",
485
+ "modalNote": "eGUBIq_modalNote",
486
+ "av": "eGUBIq_av",
487
+ "grid": "eGUBIq_grid",
488
+ "warnBtn": "eGUBIq_warnBtn",
489
+ "desc": "eGUBIq_desc",
490
+ "cmdSummary": "eGUBIq_cmdSummary",
491
+ "dshmSlide": "eGUBIq_dshmSlide",
492
+ "filterGroup": "eGUBIq_filterGroup",
459
493
  "irow": "eGUBIq_irow",
494
+ "foot": "eGUBIq_foot",
495
+ "row1": "eGUBIq_row1",
460
496
  "filterPanel": "eGUBIq_filterPanel",
461
- "filterGroup": "eGUBIq_filterGroup",
462
- "titleRow": "eGUBIq_titleRow",
463
- "searchInline": "eGUBIq_searchInline",
464
- "barFill": "eGUBIq_barFill",
465
- "cmdDetails": "eGUBIq_cmdDetails",
466
- "filterOption": "eGUBIq_filterOption",
467
497
  "nm": "eGUBIq_nm",
498
+ "spec": "eGUBIq_spec",
499
+ "spin": "eGUBIq_spin",
500
+ "card": "eGUBIq_card",
468
501
  "pagerPages": "eGUBIq_pagerPages",
469
- "modalNote": "eGUBIq_modalNote",
470
- "grow": "eGUBIq_grow",
471
- "pager": "eGUBIq_pager",
472
- "row1": "eGUBIq_row1",
502
+ "pageEllipsis": "eGUBIq_pageEllipsis",
503
+ "sizeBtn": "eGUBIq_sizeBtn",
473
504
  "head": "eGUBIq_head",
474
- "descTight": "eGUBIq_descTight",
505
+ "catsWrap": "eGUBIq_catsWrap",
475
506
  "tab": "eGUBIq_tab",
476
- "bar": "eGUBIq_bar",
477
- "sub": "eGUBIq_sub",
478
- "av": "eGUBIq_av",
479
- "actBroken": "eGUBIq_actBroken",
480
- "top": "eGUBIq_top",
507
+ "themesGrid": "eGUBIq_themesGrid",
508
+ "grow": "eGUBIq_grow",
509
+ "progress": "eGUBIq_progress",
510
+ "swatches": "eGUBIq_swatches",
511
+ "owner": "eGUBIq_owner",
512
+ "title": "eGUBIq_title",
513
+ "root": "eGUBIq_root",
514
+ "searchInline": "eGUBIq_searchInline",
515
+ "warnLine": "eGUBIq_warnLine",
516
+ "empty": "eGUBIq_empty",
517
+ "filterBtn": "eGUBIq_filterBtn",
481
518
  "pageOn": "eGUBIq_pageOn",
482
- "sizeOn": "eGUBIq_sizeOn",
483
- "cancelBtn": "eGUBIq_cancelBtn",
484
- "filterBtnOn": "eGUBIq_filterBtnOn"
519
+ "body": "eGUBIq_body",
520
+ "filterWrap": "eGUBIq_filterWrap",
521
+ "act": "eGUBIq_act",
522
+ "err": "eGUBIq_err",
523
+ "cmdDetails": "eGUBIq_cmdDetails",
524
+ "tag": "eGUBIq_tag"
485
525
  };
486
526
  //#endregion
487
527
  //#region src/client/MarketSection.tsx
@@ -649,7 +689,11 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
649
689
  const [pageSize, setPageSize] = (0, react.useState)(DEFAULT_PAGE_SIZE);
650
690
  /** Determinate percent parsed from pnpm's Progress line, when available. */
651
691
  const [progressPct, setProgressPct] = (0, react.useState)(null);
652
- /** Blocked build scripts from the last install: enables approve-and-retry (#6). */
692
+ /**
693
+ * Blocked build scripts from the last install or update: enables
694
+ * approve-and-retry (#6; updates in #69). Exactly one of `plugin`
695
+ * (retry installs it) / `updateName` (retry re-runs the update) is set.
696
+ */
653
697
  const [buildsSkipped, setBuildsSkipped] = (0, react.useState)(null);
654
698
  const [updatingAll, setUpdatingAll] = (0, react.useState)(false);
655
699
  const [updatedNames, setUpdatedNames] = (0, react.useState)([]);
@@ -724,7 +768,10 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
724
768
  }, [bootId]);
725
769
  (0, react.useEffect)(() => {
726
770
  if (bootId === null) return;
727
- if (doneUrls.length === 0 && updatedNames.length === 0 && removedCount === 0) return;
771
+ if (doneUrls.length === 0 && updatedNames.length === 0 && removedCount === 0) {
772
+ sessionStorage.removeItem("dshm-restart");
773
+ return;
774
+ }
728
775
  sessionStorage.setItem("dshm-restart", JSON.stringify({
729
776
  boot: bootId,
730
777
  doneUrls,
@@ -911,6 +958,7 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
911
958
  setActivationWarnings(warns);
912
959
  }
913
960
  if (body.hot) {
961
+ setDoneUrls((urls) => urls.filter((url) => url !== plugin.url));
914
962
  setHotUrls((urls) => urls.includes(plugin.url) ? urls : urls.concat(plugin.url));
915
963
  setHotNames((names) => names.includes(plugin.name) ? names : names.concat(plugin.name));
916
964
  } else setDoneUrls((urls) => urls.includes(plugin.url) ? urls : urls.concat(plugin.url));
@@ -1026,6 +1074,10 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
1026
1074
  return;
1027
1075
  }
1028
1076
  if (body.stale === true) setStaleName(name);
1077
+ if (Array.isArray(body.ignoredBuilds) && body.ignoredBuilds.length > 0) setBuildsSkipped({
1078
+ updateName: name,
1079
+ names: body.ignoredBuilds.map(String)
1080
+ });
1029
1081
  const text = (v) => typeof v === "string" ? v : v && typeof v.text === "string" ? v.text : v == null ? "" : JSON.stringify(v);
1030
1082
  const detail = text(body.error) || [text(body.stderr), text(body.stdout)].filter(Boolean).join("\n").trim() || "exit " + body.exitCode;
1031
1083
  setInstallError(t("updateFail") + ": " + name + " — " + detail.trim().slice(-600));
@@ -1549,15 +1601,16 @@ window.__ModuleLoader__.load({ id: "dshmarket", factory: (require) => {
1549
1601
  size: "sm",
1550
1602
  disabled: busyUrl !== null,
1551
1603
  onClick: () => {
1552
- const { plugin, names } = buildsSkipped;
1604
+ const { plugin, updateName, names } = buildsSkipped;
1553
1605
  setBuildsSkipped(null);
1554
1606
  fetch("/dsh-market/approve-builds", {
1555
1607
  method: "POST",
1556
1608
  headers: { "content-type": "application/json" },
1557
1609
  body: JSON.stringify({ packages: names })
1558
1610
  }).then((res) => res.json()).then((body) => {
1559
- if (body.ok) doInstall(plugin);
1560
- else setInstallError(String(body.error || "approve failed"));
1611
+ if (!body.ok) setInstallError(String(body.error || "approve failed"));
1612
+ else if (plugin !== void 0) doInstall(plugin);
1613
+ else if (updateName !== void 0) doUpdate(updateName);
1561
1614
  }).catch((error) => setInstallError(String(error)));
1562
1615
  },
1563
1616
  children: t("approveBuilds")