dsh-plugin-toolkit 0.13.4 → 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,12 @@
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
+
1
10
  ## 0.13.4
2
11
 
3
12
  - **`docs/why-it-exists.md`**: the five failures that shaped these checks, each
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.4",
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": {