dsh-plugin-explorer 0.1.2 → 0.2.0
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 +48 -15
- package/client.js +397 -21
- package/index.js +64 -9
- package/lib/gate/LICENSE +21 -0
- package/lib/gate/osv.js +116 -0
- package/lib/gate/rules.js +628 -0
- package/lib/gate/scan.js +609 -0
- package/lib/gate/targz.js +146 -0
- package/lib/gate-scan.js +144 -0
- package/lib/installed.js +86 -0
- package/lib/npm.js +109 -0
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +2 -2
- package/scripts/verify.mjs +64 -6
package/README.md
CHANGED
|
@@ -1,28 +1,53 @@
|
|
|
1
1
|
# dsh-plugin-explorer
|
|
2
2
|
|
|
3
|
-
Search the community plugin catalog from the DSH Plugins page
|
|
4
|
-
one click.
|
|
3
|
+
Search the community plugin catalog from the DSH Plugins page, run a pre-install safety scan, and
|
|
4
|
+
install a matching bundle in one click. Installed bundles are detected and get an update button
|
|
5
|
+
when a newer version exists.
|
|
5
6
|
|
|
6
7
|
The plugin adds a **Search** tab next to **Installed**. Typing a name, an author, a category, or a
|
|
7
|
-
keyword filters a bundled directory of installable community bundles;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
keyword filters a bundled directory of installable community bundles; category chips and a sort
|
|
9
|
+
selector narrow the list further. **Install** shows the static safety scan first, then opens the
|
|
10
|
+
normal DSH install confirmation for that exact `name@version`, so compatibility checks and the
|
|
11
|
+
source review stay in the standard flow.
|
|
10
12
|
|
|
11
13
|
## Use it
|
|
12
14
|
|
|
13
15
|
1. Open **Plugins** in the sidebar.
|
|
14
16
|
2. Select the **Search** tab.
|
|
15
|
-
3. Type a keyword such as `pet`, `memory`, or `theme`,
|
|
17
|
+
3. Type a keyword such as `pet`, `memory`, or `theme`, optionally pick a category or sort order,
|
|
18
|
+
then select **Install**.
|
|
19
|
+
4. Review the scan verdict and the rule hits, then confirm. `PASS` installs directly, `WARN` and
|
|
20
|
+
`BLOCK` require an explicit extra click.
|
|
16
21
|
|
|
17
22
|
The catalog ships with the package, so searching works offline. **Refresh catalog** re-reads the
|
|
18
23
|
upstream community index (`dsh-plugin-catalog` on jsDelivr) for the rest of the session.
|
|
19
24
|
|
|
25
|
+
## Pre-install safety scan
|
|
26
|
+
|
|
27
|
+
Every install is scanned before the confirmation dialog opens. The scanner is a port of
|
|
28
|
+
[dsh-plugin-gate](https://www.npmjs.com/package/dsh-plugin-gate) 1.3.2 (MIT), vendored under
|
|
29
|
+
`lib/gate/`:
|
|
30
|
+
|
|
31
|
+
- Reads the published npm tarball in memory (npmmirror first, npmjs.com as fallback), decompresses
|
|
32
|
+
it with `lib/gate/targz.js`, and runs 60 static signature rules from `lib/gate/rules.js`.
|
|
33
|
+
- Reports `PASS`, `WARN`, or `BLOCK` plus per-rule hits (file, line, evidence), network hosts,
|
|
34
|
+
lifecycle scripts, and recommendations.
|
|
35
|
+
- Never executes scanned code and never writes to disk. The result is a heuristic, not a guarantee.
|
|
36
|
+
- Results are cached in memory for ten minutes; **Refresh catalog** does not clear that cache.
|
|
37
|
+
|
|
38
|
+
## Installed bundles and updates
|
|
39
|
+
|
|
40
|
+
The Search tab asks the Host for the profile's installed bundles (`GET
|
|
41
|
+
/api/plugin-finder/installed.json`) and compares each one with the registry's `latest` tag. A
|
|
42
|
+
bundle that is already installed shows `Installed vX.Y.Z`; when a newer version exists the row also
|
|
43
|
+
shows `Update to vA.B.C`, which opens the same scan dialog and then the standard install flow.
|
|
44
|
+
|
|
20
45
|
## Data
|
|
21
46
|
|
|
22
47
|
- Bundled directory: 7,400+ community entries that publish an exact npm version, generated from
|
|
23
48
|
[dsh-plugin-catalog](https://www.npmjs.com/package/dsh-plugin-catalog) (CC0 1.0).
|
|
24
49
|
- Each entry carries its package name, version, owner, category, localized description, download
|
|
25
|
-
and star counts, and an icon URL when the index provides one.
|
|
50
|
+
and star counts, add date, and an icon URL when the index provides one.
|
|
26
51
|
- Regenerate `data/plugins.json` after the upstream index changes:
|
|
27
52
|
|
|
28
53
|
```sh
|
|
@@ -37,7 +62,9 @@ upstream community index (`dsh-plugin-catalog` on jsDelivr) for the rest of the
|
|
|
37
62
|
- Only npm installs are listed: the Plugins page install dialog takes an exact `name@version`, and
|
|
38
63
|
the upstream catalog's Git-only entries have no pinned commit to install from here.
|
|
39
64
|
- The catalog is third-party content. DSH validates the list format, not the listed projects, and
|
|
40
|
-
the install confirmation
|
|
65
|
+
the scan plus the install confirmation show the source before anything is installed.
|
|
66
|
+
- The scan reads npm tarballs; Git and local-directory installs through the normal dialog are not
|
|
67
|
+
scanned by this plugin.
|
|
41
68
|
- A bundled version can lag behind npm; the install check reports a missing or newer version.
|
|
42
69
|
- **Refresh catalog** keeps the new copy in this Host session only; restarting DSH returns to the
|
|
43
70
|
bundled snapshot until the package is updated and republished.
|
|
@@ -47,19 +74,24 @@ upstream community index (`dsh-plugin-catalog` on jsDelivr) for the rest of the
|
|
|
47
74
|
|
|
48
75
|
- `client.js` is a prebuilt Web module in the deployment's module-loader format; it uses only the
|
|
49
76
|
browser's `react` module.
|
|
50
|
-
- `index.js` serves `data/plugins.json` on `GET /api/plugin-finder/catalog.json
|
|
51
|
-
|
|
77
|
+
- `index.js` serves `data/plugins.json` on `GET /api/plugin-finder/catalog.json` (refresh with
|
|
78
|
+
`?refresh=1`), scans `GET /api/plugin-finder/scan.json?name=&version=`, and lists the profile's
|
|
79
|
+
bundles on `GET /api/plugin-finder/installed.json`.
|
|
52
80
|
- `lib/catalog.js` normalizes both the bundled snapshot and a refreshed upstream document.
|
|
53
|
-
- `
|
|
54
|
-
|
|
81
|
+
- `lib/npm.js` resolves packuments through npmmirror then npmjs.com.
|
|
82
|
+
- `lib/gate-scan.js` ports the upstream `scanNpmPackage` flow and trims results for the Web page.
|
|
83
|
+
- `lib/installed.js` reads the running profile's `package.json` and `node_modules`.
|
|
84
|
+
- `node scripts/verify.mjs` checks the routes, bundled directory, search/filter pipeline, and
|
|
85
|
+
renders; add `--refresh` to exercise the live upstream catalog, `--scan` to scan this package's
|
|
86
|
+
published tarball.
|
|
55
87
|
|
|
56
88
|
## Releases
|
|
57
89
|
|
|
58
90
|
Publishing runs from GitHub Actions. Prefer npm trusted publishing (OIDC), which stores no npm
|
|
59
91
|
token in the repository or in CI:
|
|
60
92
|
|
|
61
|
-
1. Bump `version` in `package.json` (for example `0.
|
|
62
|
-
2. Push a matching tag: `git tag v0.
|
|
93
|
+
1. Bump `version` in `package.json` (for example `0.2.0`) and commit it.
|
|
94
|
+
2. Push a matching tag: `git tag v0.2.0 && git push origin v0.2.0`.
|
|
63
95
|
3. `.github/workflows/publish.yml` checks the tag against `package.json`, requests an OIDC token,
|
|
64
96
|
and runs `npm publish --provenance --access public`.
|
|
65
97
|
|
|
@@ -74,4 +106,5 @@ Remove that block once the trusted publisher is configured.
|
|
|
74
106
|
|
|
75
107
|
## License
|
|
76
108
|
|
|
77
|
-
Code: MIT.
|
|
109
|
+
Code: MIT. The vendored scanner under `lib/gate/` is MIT-licensed code from `dsh-plugin-gate`
|
|
110
|
+
1.3.2; see `lib/gate/LICENSE`. Bundled catalog data: CC0 1.0 (from `dsh-plugin-catalog`).
|