dsh-plugin-toolkit 0.13.3 → 0.13.5

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.13.5
2
+
3
+ - **A wildcard export no longer fails the pack check.** `exports` can name a
4
+ pattern (`"./locale/*.json"`), while `npm pack` lists the files it shipped
5
+ (`locale/en.json`). Comparing them as strings reported a correctly packed
6
+ plugin as broken; the check now matches patterns by prefix and suffix.
7
+ - Found by running `verify` against the neighbour project's plugin, which ships
8
+ exactly that export.
9
+
10
+ ## 0.13.4
11
+
12
+ - **`docs/why-it-exists.md`**: the five failures that shaped these checks, each
13
+ with the exact error text, the root cause, the check that catches it now, and
14
+ how to reproduce it. Linked from both READMEs.
15
+ - **A release for the GitHub Action** (`v1.0.0`), so the action can be published
16
+ to the Marketplace.
17
+
1
18
  ## 0.13.3
2
19
 
3
20
  - **`verify` no longer fails a correct plugin.** The check that calls a client
package/README.md CHANGED
@@ -73,6 +73,8 @@ Releasing one plugin fifteen times taught me three things the ecosystem's toolin
73
73
  2. **The market index is a second release, done by hand.** Each version needs an entry carrying `publishTimestamp` from the registry and `engines.dsh` from the manifest. Forget the range and the index validator rejects the PR with `Engines mismatch` — after the tag is already public.
74
74
  3. **Reading a manifest is not the same as checking it.** A plugin can have a valid `package.json` and still be uninstallable: `files` that omit the entry the manifest points at, a bundle patch that does not exist, a README that never states the host range it declares.
75
75
 
76
+ The five failures behind these checks — a red dot with no panel, a row the host drops, an app that disables every plugin after one unguarded `apply()`, a tab nothing can open, and a checker that was wrong — are written up with their exact error text and how to reproduce each one: [Five plugins that installed and did nothing](https://github.com/WJDdidi-1/dsh-plugin-toolkit/blob/main/docs/why-it-exists.md).
77
+
76
78
  ### Four ways a plugin installs and still does nothing
77
79
 
78
80
  Each of these shipped in a real version of this toolkit before the check below existed. A manifest check passes on all four.
package/README.zh.md CHANGED
@@ -44,6 +44,8 @@ npx dsh-plugin-toolkit@latest release --pr --merge # 打 tag、等
44
44
 
45
45
  前三条是静态的:`doctor` 和 `verify` 不用开应用就能抓到。第四条是 UI 契约,必须把面板挂起来、检查注册出去的参数——那是 [`testkit`](#不用浏览器测面板) 的活。
46
46
 
47
+ 这五个事故——红点没有面板、宿主丢掉一行、一行没加保护的 `apply()` 让应用禁用全部插件、注册了却没人能打开的标签、以及一个判错了的检查器——都写了原始报错和复现步骤:[插件装上了,却什么都不做](https://github.com/WJDdidi-1/dsh-plugin-toolkit/blob/main/docs/why-it-exists.md)。
48
+
47
49
  ## 安装要求
48
50
 
49
51
  - Node.js 18 或更新(CI 在 18/20/22 × ubuntu/macos/windows 上跑)。
package/lib/verify.mjs CHANGED
@@ -79,6 +79,22 @@ function undeclaredContext() {
79
79
  });
80
80
  }
81
81
 
82
+ /**
83
+ * A declared path can be a pattern: `exports["./locale/*.json"]` names a folder
84
+ * of files, and `npm pack` lists the files it actually shipped. Exact set
85
+ * membership would report a correctly packed plugin as broken — which it did,
86
+ * on this repository's own neighbour.
87
+ */
88
+ function shipsPath(shipped, target) {
89
+ if (target.includes('*') === false) return shipped.has(target);
90
+ const [head, tail] = target.split('*');
91
+ const suffix = tail ?? '';
92
+ for (const file of shipped) {
93
+ if (file.startsWith(head) === true && file.endsWith(suffix) === true) return true;
94
+ }
95
+ return false;
96
+ }
97
+
82
98
  export async function verify({ dir, mount = true }) {
83
99
  const failures = [];
84
100
  const report = doctor(dir);
@@ -101,7 +117,7 @@ export async function verify({ dir, mount = true }) {
101
117
  // installed plugin is missing its own code.
102
118
  const shipped = new Set(packed.files);
103
119
  for (const target of declaredPaths(report.manifest)) {
104
- if (shipped.has(target) === false) {
120
+ if (shipsPath(shipped, target) === false) {
105
121
  failures.push({
106
122
  check: 'pack',
107
123
  message: `the tarball does not contain ${target}, so the installed plugin would be missing it`,
@@ -113,7 +129,7 @@ export async function verify({ dir, mount = true }) {
113
129
  const repoEntry = resolveEntry(dir, report.manifest);
114
130
  if (repoEntry !== null) {
115
131
  const relative = path.relative(dir, repoEntry).split(path.sep).join('/');
116
- if (shipped.has(relative) === false) {
132
+ if (shipsPath(shipped, relative) === false) {
117
133
  failures.push({
118
134
  check: 'pack',
119
135
  message: `the tarball does not contain ${relative}, so the installed plugin has no panel`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-toolkit",
3
- "version": "0.13.3",
3
+ "version": "0.13.5",
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": {