|
| 1 | +# jss-plugins — the out-of-tree experiment |
| 2 | + |
| 3 | +**Status: experimental.** Ports of [JavaScript Solid |
| 4 | +Server](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer)'s |
| 5 | +bundled features onto the [#206 plugin |
| 6 | +loader](https://jss.live/docs/features/plugins) (`createServer({ plugins })`, |
| 7 | +JSS ≥ 0.0.215) — each living **outside** the JSS tree, using only what a real |
| 8 | +third-party plugin gets. |
| 9 | + |
| 10 | +## Why |
| 11 | + |
| 12 | +Inside `src/`, the bundled features cheat: they import internals, share |
| 13 | +closures with server.js, and reach around WAC. Out here a port can only use |
| 14 | +the public surface — `activate(api)` plus the documented imports — so: |
| 15 | + |
| 16 | +- every port is an **honest test** of the plugin api, |
| 17 | +- every wall a port hits is a **seam discovery**, written up in |
| 18 | + [NOTES.md](./NOTES.md) before it becomes an upstream issue, |
| 19 | +- and core stays untouched: these are parallel implementations, not |
| 20 | + migrations. Nothing here removes or changes anything in JSS. |
| 21 | + |
| 22 | +This is the plugin-zero method |
| 23 | +([#582](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/582) → |
| 24 | +[#584](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/584) → |
| 25 | +[#588](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/588) → |
| 26 | +[#589](https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pull/589)) |
| 27 | +applied to JSS's own feature set. |
| 28 | + |
| 29 | +## The rule |
| 30 | + |
| 31 | +A plugin directory may import: |
| 32 | + |
| 33 | +1. `javascript-solid-server/auth.js` (`getAgent`) — the documented contract, |
| 34 | +2. whatever the `activate(api)` surface provides, |
| 35 | +3. its own npm dependencies. |
| 36 | + |
| 37 | +**Never `javascript-solid-server/src/...`.** If a port can't be written |
| 38 | +without internals, that gap is the finding — document it in the port's |
| 39 | +README and NOTES.md, ship the closest honest approximation. |
| 40 | + |
| 41 | +## Layout |
| 42 | + |
| 43 | +``` |
| 44 | +relay/ NIP-01 nostr relay (port of src/nostr/relay.js) |
| 45 | +webrtc/ WebRTC signaling rooms (port of src/webrtc/index.js) |
| 46 | +terminal/ WebSocket shell — GATED (port of src/terminal/index.js) |
| 47 | +tunnel/ reverse tunnel over WebSocket (port of src/tunnel/) |
| 48 | +notifications/ pod change notifications (port of src/notifications/ — the seam-forcer) |
| 49 | +pay/ HTTP 402 paid routes (port of src/mrc20.js pay mode — wall-report) |
| 50 | +compose.test.js ONE server, every plugin, from pure config |
| 51 | +serve.js demo composition |
| 52 | +NOTES.md findings log: what the api gave us, what it didn't |
| 53 | +``` |
| 54 | + |
| 55 | +Each directory: `plugin.js` (exports `activate(api)`), `test.js` (boots a |
| 56 | +real JSS from npm), `README.md` (usage + findings for that port). |
| 57 | + |
| 58 | +## Run |
| 59 | + |
| 60 | +```bash |
| 61 | +npm install |
| 62 | +npm test # every port's tests + the all-plugins composition |
| 63 | +npm run serve # one server: pods + every plugin |
| 64 | +``` |
| 65 | + |
| 66 | +## License |
| 67 | + |
| 68 | +AGPL-3.0-only, same as JSS — several ports adapt JSS source. |
0 commit comments