Move plugin-contract.md into README's Building plugins section; remove docs/, repoint all references

This commit is contained in:
2026-06-26 23:12:40 +02:00
parent 2b88bf1c0d
commit d8cf257940
11 changed files with 403 additions and 475 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Scheduling — the reference plugin
A worked example of the [plugin contract](../../docs/plugin-contract.md). Copy this folder, rename
A worked example of the [plugin contract](../../README.md#building-plugins). Copy this folder, rename
it (the folder name becomes the plugin id and mount path), and point it at your own backend.
What it demonstrates:
+1 -1
View File
@@ -1,6 +1,6 @@
// Reference plugin: a worked example of the contract — a list page that fetches upstream
// data, a CSRF-guarded form that forwards a write upstream, and permission-gated nav. Copy this
// folder, rename it, point it at your own backend. Full contract: docs/plugin-contract.md.
// folder, rename it, point it at your own backend. Full contract: README.md → Building plugins.
import { definePlugin } from "../../src/plugin-host/plugin-api.ts";
import { assertHttpUrl, createShift, createUpstream, listShifts, newShiftForm, overview, READ, SCHEDULING_PATH, SHIFTS_PATH, WRITE } from "./shifts.ts";
+2 -2
View File
@@ -3,9 +3,9 @@
// host renders. The plugin holds no state of its own (README "Stateless") — data lives upstream.
//
// Handlers are factories bound to a ShiftsUpstream, and `fetch` is injectable, so they unit-test as
// pure functions against a mock upstream with no network (docs/plugin-contract.md → dev/test story).
// pure functions against a mock upstream with no network (README.md → Local dev & test story).
// One import from the host's plugin-api barrel — the stable author surface (see docs/plugin-contract.md).
// One import from the host's plugin-api barrel — the stable author surface (see README.md → Building plugins).
import { can, CSRF_FIELD, GuardError, type PageChrome, parseListQuery, readFormBody, type RouteHandler, tracedFetch } from "../../src/plugin-host/plugin-api.ts";
export const SCHEDULING_PATH = "/scheduling"; // the plugin's public overview page