dsh-plugin-toolkit 0.7.2 → 0.7.3
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 +13 -0
- package/README.md +1 -1
- package/lib/init.mjs +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## 0.7.3
|
|
2
|
+
|
|
3
|
+
The scaffold was two minor versions behind the tool that wrote it.
|
|
4
|
+
|
|
5
|
+
- `init` pins the toolkit it was generated by (`^<its own version>`) instead of
|
|
6
|
+
a number typed once, so `npm install` in a fresh scaffold gets the version
|
|
7
|
+
whose README you just read.
|
|
8
|
+
- The generated workflow uses the composite action with `verify` instead of
|
|
9
|
+
`npx dsh-plugin-toolkit@0.5.0 doctor .` — `doctor` reads the working copy and
|
|
10
|
+
cannot see that `files` left the client bundle out.
|
|
11
|
+
- `test/init.test.mjs` guards both: the pinned range must equal the running
|
|
12
|
+
version, and the workflow must not fall back to `doctor`.
|
|
13
|
+
|
|
1
14
|
## 0.7.2
|
|
2
15
|
|
|
3
16
|
`verify` runs from npx's cache, so it has to find jsdom and React where the
|
package/README.md
CHANGED
|
@@ -169,7 +169,7 @@ AIignore No workspace yet Could not read the report …
|
|
|
169
169
|
|
|
170
170
|
## Start from the example
|
|
171
171
|
|
|
172
|
-
[`dsh-plugin-example`](https://github.com/WJDdidi-1/dsh-plugin-example) is a ~70-line plugin: one sidebar tab, two languages, one behaviour test, CI that runs `
|
|
172
|
+
[`dsh-plugin-example`](https://github.com/WJDdidi-1/dsh-plugin-example) is a ~70-line plugin: one sidebar tab, two languages, one behaviour test, CI that runs `verify` through the composite action. It is the shape this toolkit expects, so it is also the fastest way to see whether the toolkit fits your plugin. It is a GitHub template too: **Use this template** starts you on a plugin whose first publish already passes.
|
|
173
173
|
|
|
174
174
|
```sh
|
|
175
175
|
dsh plugin add dsh-plugin-example
|
package/lib/init.mjs
CHANGED
|
@@ -6,7 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
9
10
|
|
|
11
|
+
// The scaffold pins the toolkit it was generated by, not a number typed once:
|
|
12
|
+
// a scaffold that installs two minor versions behind is the first thing a new
|
|
13
|
+
// author sees and the last thing anyone updates.
|
|
14
|
+
const VERSION = JSON.parse(
|
|
15
|
+
fs.readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'),
|
|
16
|
+
).version;
|
|
10
17
|
const NPM_NAME = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
11
18
|
|
|
12
19
|
export function checkName(name) {
|
|
@@ -29,7 +36,7 @@ function manifest({ name, title, version }) {
|
|
|
29
36
|
files: ['index.js', 'client.js', 'cordis.patch.yml', 'README.md'],
|
|
30
37
|
scripts: { test: 'node --test', doctor: 'dsh-plugin doctor .' },
|
|
31
38
|
devDependencies: {
|
|
32
|
-
'dsh-plugin-toolkit':
|
|
39
|
+
'dsh-plugin-toolkit': `^${VERSION}`,
|
|
33
40
|
jsdom: '^26.1.0',
|
|
34
41
|
react: '^18.3.1',
|
|
35
42
|
'react-dom': '^18.3.1',
|
|
@@ -136,7 +143,7 @@ export function files({ name, title = 'My panel', version = '0.1.0' }) {
|
|
|
136
143
|
'test/panel.test.mjs': test({ name, title }),
|
|
137
144
|
'README.md': `# ${slug}\n\n${title} — a panel for DeepSeek Harness.\n\n## Requirements\n\n| What | Version | Why |\n| --- | --- | --- |\n| DeepSeek Harness | >= 0.2.0 | provides \`sidebarRightTabs\` |\n| Node | >= 18 | the host half |\n\n## Develop\n\n\`\`\`sh\nnpm install\nnpm test # mounts client.js in Node\nnpm run doctor # checks the manifest before you publish\n\`\`\`\n\n## Install\n\n\`\`\`sh\ndsh plugin add ${name}\n\`\`\`\n`,
|
|
138
145
|
'.gitignore': 'node_modules/\n',
|
|
139
|
-
'.github/workflows/ci.yml': `name: ci\n\non:\n push:\n branches: [main]\n pull_request:\n\njobs:\n test:\n runs-on: ubuntu-latest\n strategy:\n matrix:\n node: [18, 20, 22]\n steps:\n - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: \${{ matrix.node }}\n - run: npm install\n - run: npm test\n
|
|
146
|
+
'.github/workflows/ci.yml': `name: ci\n\non:\n push:\n branches: [main]\n pull_request:\n\njobs:\n test:\n runs-on: ubuntu-latest\n strategy:\n matrix:\n node: [18, 20, 22]\n steps:\n - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: \${{ matrix.node }}\n - run: npm install\n - run: npm test\n # verify, not doctor: doctor reads the working copy, so a \`files\` list\n # that forgets client.js passes it and the installed plugin has no panel.\n - uses: WJDdidi-1/dsh-plugin-toolkit@v1\n with:\n dir: .\n version: ${VERSION}\n`,
|
|
140
147
|
};
|
|
141
148
|
}
|
|
142
149
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-toolkit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
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": {
|