dsh-plugin-toolkit 0.9.6 → 0.9.7

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/client.js +23 -5
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 0.9.7
2
+
3
+ - **The tab type is now reachable.** Registering a tab *type* is not enough: the
4
+ right sidebar's guide list is built from `tabs.guide()`, so a type with no
5
+ `guide` entry is registered, has a body slot, and is still impossible to open —
6
+ no tab appears anywhere. The type now contributes one guide entry
7
+ (`id: 'doctor'`, `order: 60`, localized title and description), which is what
8
+ puts "Plugin doctor" in the sidebar's guide.
9
+ - The title and description come from the panel's own dictionary through a
10
+ module-level `translate()`, because the sidebar calls them from its guide list,
11
+ outside this component.
12
+ - Regression test: mounting the bundle with a recording `sidebarRightTabs` now
13
+ asserts the registered definition carries a guide entry with a title and an
14
+ order.
15
+
1
16
  ## 0.9.6
2
17
 
3
18
  - **The host half now survives a context it does not own.** `apply()` ended with
package/client.js CHANGED
@@ -20,6 +20,7 @@ window.__ModuleLoader__.load({
20
20
  fail: 'This would not install cleanly.',
21
21
  noDir: 'Name the folder that holds the plugin\'s package.json.',
22
22
  failed: 'Could not run the checks',
23
+ guideDescription: 'Run the install checks on a plugin folder',
23
24
  },
24
25
  zh: {
25
26
  tabTitle: '插件体检',
@@ -32,9 +33,20 @@ window.__ModuleLoader__.load({
32
33
  fail: '这样装上去会出问题。',
33
34
  noDir: '请填写放着 package.json 的插件文件夹。',
34
35
  failed: '检查没能跑起来',
36
+ guideDescription: '对任意插件文件夹跑一遍安装前的检查',
35
37
  },
36
38
  };
37
39
 
40
+ /**
41
+ * The panel's copy, by the document language. Module scope because the tab
42
+ * type's `title`/`description` are called by the sidebar's guide list, not
43
+ * by this component, and they need the same strings.
44
+ */
45
+ const translate = (key) => {
46
+ const lang = typeof document === 'undefined' ? 'en' : (document.documentElement.lang === 'zh' ? 'zh' : 'en');
47
+ return COPY[lang][key] ?? key;
48
+ };
49
+
38
50
  const h = React.createElement;
39
51
 
40
52
  const CSS = [
@@ -89,10 +101,7 @@ window.__ModuleLoader__.load({
89
101
  const [result, setResult] = useState(null);
90
102
  const [busy, setBusy] = useState(false);
91
103
  const [failed, setFailed] = useState(null);
92
- const tr = (key) => {
93
- const language = COPY[document.documentElement.lang === 'zh' ? 'zh' : 'en'];
94
- return language[key] ?? key;
95
- };
104
+ const tr = translate;
96
105
 
97
106
  const check = useCallback(() => {
98
107
  if (dir.trim().length === 0) {
@@ -209,11 +218,20 @@ window.__ModuleLoader__.load({
209
218
  key: NS,
210
219
  locale: NS,
211
220
  }, Panel)));
221
+ // A tab *type* with no guide entry is registered but unreachable:
222
+ // the sidebar's guide list is built from `tabs.guide()`, so the
223
+ // type would never be offered and nothing would open it.
212
224
  tabCtx.effect(() => tabCtx.sidebarRightTabs.register({
213
225
  id: NS,
214
226
  kind: KIND,
215
227
  priority: 'extension',
216
- title: () => 'Plugin doctor',
228
+ title: () => translate('tabTitle'),
229
+ guide: [{
230
+ id: 'doctor',
231
+ order: 60,
232
+ title: () => translate('tabTitle'),
233
+ description: () => translate('guideDescription'),
234
+ }],
217
235
  }));
218
236
  report('tab-registered', `kind=${KIND}`);
219
237
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-toolkit",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
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": {