@danxbot/plugin-sdk 0.1.3 → 0.1.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/README.md +14 -2
- package/dist/cli.js +6083 -7
- package/dist/publish.d.ts +135 -0
- package/dist/publish.js +6063 -0
- package/package.json +24 -2
package/README.md
CHANGED
|
@@ -45,9 +45,21 @@ The build refuses to bundle a copy of React, React DOM, `@danxbot/ui` or `react-
|
|
|
45
45
|
|
|
46
46
|
A runtime export of `@danxbot/card-kit@1`, and its parameters, is never removed or changed in place; the keys of the exported data types follow the Versioning section below. A breaking change is `@danxbot/card-kit@2`, served beside `@1` until no approved plugin revision needs it. A plugin's manifest records the majors it was built against, and the app refuses to run a revision built for a major it no longer serves.
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Publish a revision
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
```
|
|
51
|
+
DANXBOT_DASHBOARD_URL=https://<your dashboard> DANXBOT_API_KEY=<a key from your own account> npx danx-plugin publish --plugin <key> --note "what changed" [--dir <project>] [--name "Display name"]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`publish` runs the project's own `npm run build`, archives the source (inside a git repo: the tracked files plus untracked ones git does not ignore; otherwise what the top-level `.gitignore` leaves, minus `node_modules`, `.git` and a top-level `dist`; a lockfile is required, so the download builds as is) and uploads both as a new revision of the plugin `<key>`, creating the plugin on its first publish. It prints the revision number and the Settings > Plugins link where a team admin approves it. `.env*` files are never archived, in or out of git. Inside git, a git failure (git missing, a dubious-ownership refusal) stops the publish with git's message; only "not a git repository" means outside git, where the top-level `.gitignore` is honoured (`*`, `?`, `**`, anchoring and trailing `/`; a `!` negation is refused). A blank note is refused first, before the build, the archive or any request. The dashboard validates the upload; a refusal prints its named reason.
|
|
55
|
+
|
|
56
|
+
The same flow is exported for tools as `@danxbot/plugin-sdk/publish` (`buildPlugin`, `archiveSource`, `uploadRevision`, `fetchTransport`): the dashboard MCP's `plugin_publish` tool runs it for agents.
|
|
57
|
+
|
|
58
|
+
## The screenshot on a revision
|
|
59
|
+
|
|
60
|
+
An approver sees a screenshot of the plugin next to each revision. There is nothing to draw by hand: the dashboard MCP's `plugin_publish` tool (not `danx-plugin publish`, which uploads no screenshot) takes it from the plugin's own build. A headless Chromium (Playwright, resolved from your project or the MCP server's working directory) opens the dashboard's public `/plugin-preview` page, which imports your built `CardView` on the app's own React, `@danxbot/ui` and card kit and draws it with an invented sample card; the build is served from memory, so the revision need not be uploaded first. The capture waits until the page itself reports `ready` (or `failed`, with the reason), then saves a 1280x800 PNG as `screenshot.png`, which joins the revision's files and manifest.
|
|
61
|
+
|
|
62
|
+
So a plugin must export a `CardView` for a screenshot to exist. No browser, a dashboard that predates the page, or a plugin that fails to render all publish the revision WITHOUT a screenshot; `plugin_publish` answers `screenshot: "none: <reason>"` with the cause.
|
|
51
63
|
|
|
52
64
|
## Versioning
|
|
53
65
|
|