Skip to content

Commit 5d82369

Browse files
authored
docs(plugins): standardize on pnpx and unify plugin docs structure (#123)
1 parent ec59331 commit 5d82369

18 files changed

Lines changed: 152 additions & 48 deletions

File tree

docs/plugins/a11y.md

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ outline: deep
66

77
An accessibility inspector that runs [axe-core](https://github.com/dequelabs/axe-core) against a host application, lists the WCAG A/AA violations in a **Solid** panel, and highlights the offending element in the page when you hover a warning.
88

9-
Package: `@devframes/a11y` · framework: **Solid + Vite**
9+
Package: `@devframes/plugin-a11y` · framework: **Solid + Vite**
1010

1111
## What it does
1212

@@ -34,6 +34,48 @@ await mountDevframe(ctx, a11yDevframe, {
3434

3535
Outside a hub, one `<script type="module">` for the same bundle boots the agent standalone — the scan loop is identical, with the feed mirror simply absent.
3636

37+
## Standalone
38+
39+
```sh
40+
pnpx @devframes/plugin-a11y
41+
```
42+
43+
Runs the panel alone, without a host page to scan — serves at `/__devframes_plugin_a11y/` even standalone, so the mount path matches the hosted case. Useful for a quick look at the panel UI; pair it with a manually-loaded agent script to drive it against a real page.
44+
45+
## Mount into a Vite host
46+
47+
```ts
48+
// vite.config.ts
49+
import { a11yVitePlugin } from '@devframes/plugin-a11y/vite'
50+
import { defineConfig } from 'vite'
51+
52+
export default defineConfig({
53+
plugins: [
54+
a11yVitePlugin(),
55+
],
56+
})
57+
```
58+
59+
## Programmatic
60+
61+
`createA11yDevframe(options)` returns a definition you can deploy through any adapter:
62+
63+
```ts
64+
import { createA11yDevframe } from '@devframes/plugin-a11y'
65+
66+
export default createA11yDevframe({
67+
port: 9899,
68+
})
69+
```
70+
71+
## RPC surface
72+
73+
All functions are namespaced `devframes:plugin:a11y:*`:
74+
75+
| Function | Type | Returns |
76+
|----------|------|---------|
77+
| `get-config` | `static` | The impact taxonomy (with developer-facing copy) and the `BroadcastChannel` coordinates the panel uses to find its injected agent. |
78+
3779
## Run the demo
3880

3981
The Accessibility Inspector lives in the repository as a reference plugin. Its demo serves an intentionally-broken host page and the panel from one origin so they share the channel:
@@ -47,12 +89,6 @@ pnpm -C plugins/a11y demo:build # static: baked RPC dump, no server
4789

4890
Open the printed URL, then hover any row in the panel — the matching element in the page gets a focus ring and scrolls into view if it is off-screen. Both demo modes behave identically; the panel's `websocket` / `static` tag is the only tell.
4991

50-
Run the panel on its own, without a host app:
51-
52-
```sh
53-
pnpm -C plugins/a11y dev
54-
```
55-
5692
## Source
5793

5894
[`plugins/a11y`](https://github.com/devframes/devframe/tree/main/plugins/a11y)

docs/plugins/code-server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The editor iframe points at the server's own origin, so its WebSocket traffic fl
3232
## Standalone
3333

3434
```sh
35-
npx @devframes/plugin-code-server
35+
pnpx @devframes/plugin-code-server
3636
```
3737

3838
## Mount into a Vite host

docs/plugins/data-inspector.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ ctx.services.whenAvailable('devframes:plugin:data-inspector:sources', (sources)
7070
> [!WARNING]
7171
> Queries are eval-grade access to registered objects: jora can invoke any function reachable as an own property and fires own getters. Register live objects with that in mind, and keep inspector endpoints on loopback.
7272
73+
## Standalone
74+
75+
```sh
76+
pnpx @devframes/plugin-data-inspector # the example source
77+
pnpx @devframes/plugin-data-inspector stats.json log.jsonl # one static source per data file
78+
pnpx @devframes/plugin-data-inspector build stats.json # self-contained static export
79+
pnpx @devframes/plugin-data-inspector attach # attach to a process running the agent
80+
```
81+
82+
`.json` files parse whole; `.jsonl` / `.ndjson` parse as an array of records. `build` writes a static site embedding the dataset — the same query engine runs client-side there, so saved recipes keep working.
83+
7384
## Mount into a Vite host
7485

7586
```ts
@@ -98,16 +109,17 @@ export default defineConfig({
98109

99110
Hub hosts mount the default export like any devframe definition.
100111

101-
## Standalone CLI
112+
## Programmatic
102113

103-
```sh
104-
devframe-data-inspector # the example source
105-
devframe-data-inspector stats.json log.jsonl # one static source per data file
106-
devframe-data-inspector build stats.json # self-contained static export
107-
devframe-data-inspector attach # attach to a process running the agent
108-
```
114+
`createDataInspectorDevframe(options)` returns a definition you can deploy through any adapter:
109115

110-
`.json` files parse whole; `.jsonl` / `.ndjson` parse as an array of records. `build` writes a static site embedding the dataset — the same query engine runs client-side there, so saved recipes keep working.
116+
```ts
117+
import { createDataInspectorDevframe } from '@devframes/plugin-data-inspector'
118+
119+
export default createDataInspectorDevframe({
120+
exampleSource: false,
121+
})
122+
```
111123

112124
## Attach to another Node process
113125

@@ -139,7 +151,7 @@ globalThis.cache = cache
139151

140152
Then query `store`, `cache`, or `keys($)` to see what's there. The source reads `globalThis` at query time, so assignments made after the agent started show up on the next run. Opt out with `DEVFRAME_DATA_INSPECTOR_GLOBAL=0`.
141153

142-
The agent binds `127.0.0.1`, requires devframe's trust handshake with a per-run pre-shared token, and advertises its endpoint in `node_modules/.data-inspector/agent.json``devframe-data-inspector attach` consumes it automatically (or pass `ws://…` and `--token` explicitly). Queries execute inside the target process, where the live objects are. Treat the endpoint like a debugger port.
154+
The agent binds `127.0.0.1`, requires devframe's trust handshake with a per-run pre-shared token, and advertises its endpoint in `node_modules/.data-inspector/agent.json``pnpx @devframes/plugin-data-inspector attach` consumes it automatically (or pass `ws://…` and `--token` explicitly). Queries execute inside the target process, where the live objects are. Treat the endpoint like a debugger port.
143155

144156
## RPC surface
145157

@@ -153,3 +165,7 @@ All functions are namespaced `devframes:plugin:data-inspector:*`:
153165
| `skeleton` | `query` | The type skeleton of a source, honoring the filter options. |
154166
| `suggest` | `query` | Autocomplete candidates from jora's stat mode at a cursor position. |
155167
| `saved:list` / `saved:save` / `saved:delete` | `query` / `action` | Saved-query recipes in the `workspace` and `project` scopes. |
168+
169+
## Source
170+
171+
[`plugins/data-inspector`](https://github.com/devframes/devframe/tree/main/plugins/data-inspector)

docs/plugins/git.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Status, a SourceTree-style commit graph, branches, and diffs are read-only. Stag
1515
## Standalone
1616

1717
```sh
18-
npx @devframes/plugin-git # dev server (live RPC over WebSocket)
19-
npx @devframes/plugin-git --write # also enable staging / committing from the UI
20-
npx @devframes/plugin-git build # static deploy → dist-static/
18+
pnpx @devframes/plugin-git # dev server (live RPC over WebSocket)
19+
pnpx @devframes/plugin-git --write # also enable staging / committing from the UI
20+
pnpx @devframes/plugin-git build # static deploy → dist-static/
2121
```
2222

2323
## Programmatic

docs/plugins/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ This is the framework-agnostic promise in practice. The browser bundle is the au
2626

2727
## Running a plugin
2828

29-
Most plugins publish a `bin`, so the quickest path is `npx`:
29+
Most plugins publish a `bin`, so the quickest path is `pnpx`:
3030

3131
```sh
32-
npx @devframes/plugin-inspect # the Devframe Inspector, standalone
33-
npx @devframes/plugin-og # inspect Open Graph metadata and social cards
34-
npx @devframes/plugin-git # the Git dashboard against the current repo
32+
pnpx @devframes/plugin-inspect # the Devframe Inspector, standalone
33+
pnpx @devframes/plugin-og # inspect Open Graph metadata and social cards
34+
pnpx @devframes/plugin-git # the Git dashboard against the current repo
3535
```
3636

3737
Each also exports a `create…Devframe` factory (or, for the Accessibility Inspector, a ready-made definition) you can drive through any adapter — see the individual pages for the factory name, options, and host-mount snippets.

docs/plugins/inspect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The three introspection `query` functions are agent-exposed and bake into the st
2020
## Standalone
2121

2222
```sh
23-
npx @devframes/plugin-inspect
23+
pnpx @devframes/plugin-inspect
2424
```
2525

2626
Opens the inspector against a fresh standalone devframe connection — handy as a reference and for poking at the introspection RPCs themselves. The CLI prints the URL it serves on.

docs/plugins/og.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,39 @@ outline: deep
44

55
# Open Graph Viewer
66

7-
Inspect a page's resolved Open Graph and Twitter metadata and compare its social cards across common platforms.
7+
Inspect a page's resolved Open Graph and Twitter metadata and compare its social cards across common platforms, built as a **Vue** SPA.
88

9-
## Run Standalone
9+
Package: `@devframes/plugin-og` · framework: **Vue + Vite**
10+
11+
## What it does
12+
13+
Enter any HTTP or HTTPS page reachable from the devframe process. The viewer resolves relative image and icon URLs against the fetched document, renders the resulting social cards for Twitter, Facebook, LinkedIn, and Telegram, and identifies missing metadata with a ready-to-use Nuxt `useSeoMeta()` snippet.
14+
15+
The standalone server requires devframe's trust handshake by default because it can request developer-supplied URLs. Set `auth: false` only for an isolated local environment.
16+
17+
## Standalone
1018

1119
```sh
12-
npx @devframes/plugin-og
20+
pnpx @devframes/plugin-og
1321
```
1422

15-
Enter any HTTP or HTTPS page reachable from the devframe process. The viewer resolves relative image and icon URLs against the fetched document and identifies missing metadata with a ready-to-use Nuxt `useSeoMeta()` snippet.
23+
## Mount into a Vite host
1624

17-
## Create A Definition
25+
```ts
26+
// vite.config.ts
27+
import { ogVitePlugin } from '@devframes/plugin-og/vite'
28+
import { defineConfig } from 'vite'
29+
30+
export default defineConfig({
31+
plugins: [
32+
ogVitePlugin(),
33+
],
34+
})
35+
```
36+
37+
## Programmatic
38+
39+
`createOgDevframe(options)` returns a definition you can deploy through any adapter:
1840

1941
```ts
2042
import { createOgDevframe } from '@devframes/plugin-og'
@@ -26,4 +48,14 @@ export default createOgDevframe({
2648

2749
`defaultUrl` supplies the initial target and makes `devframe build` bake that page into the static RPC dump. The resulting report keeps its assets relative and runs from any deployment path.
2850

29-
The standalone server requires devframe's trust handshake by default because it can request developer-supplied URLs. Set `auth: false` only for an isolated local environment.
51+
## RPC surface
52+
53+
All functions are namespaced `devframes:plugin:og:*`:
54+
55+
| Function | Type | Returns |
56+
|----------|------|---------|
57+
| `resolve-metadata` | `query` | Fetches an HTTP or HTTPS page and returns its normalized title, language, Open Graph, Twitter, and link metadata. |
58+
59+
## Source
60+
61+
[`plugins/og`](https://github.com/devframes/devframe/tree/main/plugins/og)

docs/plugins/terminals.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Interactive shells run on a real pseudo-terminal via [`zigpty`](https://github.c
1919
## Standalone
2020

2121
```sh
22-
npx @devframes/plugin-terminals
22+
pnpx @devframes/plugin-terminals
2323
```
2424

2525
## Mount into a Vite host
@@ -72,6 +72,25 @@ await rpc.call('hub:docks:activate', {
7272

7373
It works whether the panel is already open (it reacts to the `devframe:docks:active` shared-state slot) or mounts in response to the switch (it reads the slot on start and converges). Focus is one-shot: an unknown or not-yet-arrived session id waits for that session to appear, and the user's own tab clicks are always honored afterward. A session id that never appears is a no-op — the default selection (most-recent session) stands.
7474

75+
## RPC surface
76+
77+
All functions are namespaced `devframes:plugin:terminals:*`:
78+
79+
| Function | Type | Purpose |
80+
|----------|------|---------|
81+
| `list` | `query` (snapshot) | The current sessions with their status, mode, and command. |
82+
| `presets` | `query` (snapshot) | The declared launcher presets. |
83+
| `spawn` | `action` | Start a new session from a preset id, or a command + mode. Interactive sessions accept input; readonly sessions only stream output. |
84+
| `write` | `action` | Send input to an interactive session. |
85+
| `resize` | `action` | Resize a session's PTY to the given columns and rows. |
86+
| `restart` | `action` | Restart a session's process, keeping its id and scrollback. |
87+
| `rename` | `action` | Rename a session. |
88+
| `terminate` | `action` | End a session's running process; keeps the session and its scrollback. |
89+
| `remove` | `action` | Kill a session and discard it (process, stream, and scrollback). |
90+
| `clear-exited` | `action` | Discard every stopped session at once; running sessions are left untouched. |
91+
92+
Status (and every mutation above) is mirrored into shared state, so every connected panel stays in sync.
93+
7594
## Source
7695

7796
[`plugins/terminals`](https://github.com/devframes/devframe/tree/main/plugins/terminals)

plugins/a11y/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ behave identically; the panel's `websocket` / `static` tag is the only tell.
6565
Standalone, without a host app:
6666

6767
```sh
68-
pnpm -C plugins/a11y dev # panel only, at /__devframes_plugin_a11y/
68+
pnpx @devframes/plugin-a11y # the published package, panel only, at /__devframes_plugin_a11y/
69+
pnpm -C plugins/a11y dev # from source: same, at /__devframes_plugin_a11y/
6970
```
7071

7172
## File map

plugins/a11y/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import a11yDevframe from './index.ts'
44

55
/**
66
* Build the standalone CLI for the a11y inspector — backs the package `bin`
7-
* (`devframes_plugin_a11y`) and `npx @devframes/plugin-a11y`. Wraps the
7+
* (`devframes_plugin_a11y`) and `pnpx @devframes/plugin-a11y`. Wraps the
88
* default {@link createA11yDevframe} definition with devframe's
99
* `dev` / `build` / `spa` command shell.
1010
*/

0 commit comments

Comments
 (0)