|
| 1 | +# Plugin marketplace |
| 2 | + |
| 3 | +`marketplace.json` is the source of truth for the plugin directory shown at [deephaven.io/plugins](https://deephaven.io/plugins). On merge to `main` this folder is synced to S3 and the website reads it from there, so a merged PR is all it takes to list, update, or remove a plugin. |
| 4 | + |
| 5 | +## Add your plugin |
| 6 | + |
| 7 | +1. Add an entry to the `plugins` array in [`marketplace.json`](./marketplace.json). The fields are documented in [`marketplace.schema.json`](./marketplace.schema.json); editors that understand `$schema` will autocomplete and validate as you type. The required fields are `name`, `description`, `author`, `repo`, and `image`: |
| 8 | + |
| 9 | + ```json |
| 10 | + { |
| 11 | + "name": "My Plugin", |
| 12 | + "description": "One sentence describing what it does, shown on the card.", |
| 13 | + "author": "your-github-handle", |
| 14 | + "repo": "https://github.com/your-github-handle/your-plugin", |
| 15 | + "image": "/marketplace/images/my-plugin.png", |
| 16 | + "registry": { |
| 17 | + "kind": "pypi", |
| 18 | + "package": "deephaven-plugin-my-plugin", |
| 19 | + "url": "https://pypi.org/project/deephaven-plugin-my-plugin/" |
| 20 | + }, |
| 21 | + "tags": ["python"] |
| 22 | + } |
| 23 | + ``` |
| 24 | + |
| 25 | +2. Add a card image to [`images/`](./images) and reference it as `/marketplace/images/<file>.png`. It must be a PNG committed to that folder (external URLs are not allowed); keep it under 300 KB and roughly 16:9 (600×338 works well). |
| 26 | + |
| 27 | +3. Validate locally, then open a PR: |
| 28 | + |
| 29 | + ```sh |
| 30 | + npm run validate-marketplace |
| 31 | + ``` |
| 32 | + |
| 33 | + CI runs the same check on every PR that touches this folder and blocks merge until it passes. Use `npm run validate-marketplace -- --skip-links` to skip the (slower) external link checks while iterating. |
| 34 | + |
| 35 | +## What the validator enforces |
| 36 | + |
| 37 | +Beyond the JSON schema, [`tools/validate-marketplace.mjs`](../tools/validate-marketplace.mjs) checks that: |
| 38 | + |
| 39 | +- plugin names are unique, |
| 40 | +- the `repo` owner matches the `author` (the author drives the official badge), |
| 41 | +- the `official` tag and `preInstalled` flag are reserved for Deephaven-owned plugins, |
| 42 | +- each plugin's `image` is a PNG that exists directly in `images/` and is under 300 KB, |
| 43 | +- no image in `images/` is orphaned (unreferenced by any plugin), and |
| 44 | +- every link resolves: `repo`, `href`, `registry.url`, and the author's GitHub profile. |
| 45 | + |
| 46 | +## Reserved fields |
| 47 | + |
| 48 | +`author: "deephaven"` plugins get the official badge automatically, and only they may set `preInstalled: true`. Don't add the `official` tag by hand; it is derived from the author. |
0 commit comments