@hoardodile/create-plugin 0.1.6 → 0.1.7

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.
@@ -0,0 +1,33 @@
1
+ # hoardodile plugin template
2
+
3
+ Minimal end-to-end content plugin: `detect` → `sourceMeta` → iframe render. Copy this directory to start your own plugin — never edit it in place (the create-plugin scaffolder embeds a synced copy; CI compiles it).
4
+
5
+ ## Commands
6
+
7
+ - `pnpm build` — build `dist/` (client + server bundle + manifest).
8
+ - `pnpm dev` — watch-build + serve the workbench at http://127.0.0.1:5199 (data from `testdata/`, one sandboxed `detect` on startup).
9
+ - `pnpm test` — Vitest against the in-memory fixture API; `pnpm run detect:smoke` — sandboxed `detect` against `testdata/` (needs a build first).
10
+ - `hoardodile plugin <run|package|dev>` — run hooks through the same worker sandbox the server uses (`run`), zip `dist/` into `release/<id>-<version>.zip` (`package`), or the offline dev workbench (`dev`).
11
+ - `pnpm readme:check` — gate the marketplace `readme/` folder (flat, ships one `README.md` fallback per locale). `pnpm release <version>` — release-it bumps version, writes `CHANGELOG.md`, tags `v<version>`, and the tag workflow builds/packages/uploads the GitHub release assets.
12
+
13
+ Scaffold a new plugin with `pnpm dlx create-hoardodile-plugin <name>`; it rewrites `manifest.json`/`package.json` and installs deps.
14
+
15
+ ## Structure
16
+
17
+ ```
18
+ src/main.ts server-side definition (definePlugin): detect + sourceMeta
19
+ src/shared.ts PluginSchema typed once, shared server ↔ client
20
+ src/hooks.ts typed plugin API (definePluginAPI) for the client
21
+ src/render.tsx iframe client (createPluginRoot @hoardodile/sdk-react)
22
+ testdata/ default data root for `hoardodile plugin dev`
23
+ __tests__/ unit tests
24
+ ```
25
+
26
+ ## Architecture
27
+
28
+ - **Contract:** `manifest.json` + server `main.js` (`definePlugin`) + sandboxed iframe client. `manifest.ui.card`/`.search`/`.message` declare host-rendered `{{...}}` templates; the CLI lints them at build time (`packages/cli/src/template-lint.ts`), so a template that renders in the workbench renders in the app.
29
+ - **SDK closure:** plugin code may import only `@hoardodile/{i18n,ui,sdk-*}`; terminal packages (`cli`, `host`, `host-web`, `workbench`) are never imported by a plugin. `plugins/host/src/hooks.ts` is the only path to invoke plugin hooks.
30
+
31
+ ## Testing
32
+
33
+ Vitest unit tests use `createResourceAPIFixture` (in-memory); the sandboxed path is exercised via `hoardodile plugin run detect testdata --plugin-dir dist` — the exact production execution path.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoardodile/create-plugin",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "license": "MIT",
5
5
  "description": "Scaffold a hoardodile content plugin.",
6
6
  "keywords": [
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@clack/prompts": "^1.7.0",
39
39
  "zod": "^4.4.3",
40
- "@hoardodile/sdk-types": "0.1.6"
40
+ "@hoardodile/sdk-types": "0.1.7"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^26.2.0",