Repository navigation
docs(plugins): teach required-input validation in the column template - #80
Merged
Merged
Conversation
PRs #78/#79 added trim-and-throw guards for required inputs across the Grok-backed and moded social columns, but the `_template/` every new column is copied from — and the plugin contract README — never taught the pattern. A contributor scaffolding a new column inherits the exact gap those two PRs closed: Zod `.default("")` guarantees a field is present and typed, but not non-empty, so an empty query fires a wasted upstream call that returns an opaque error instead of a clear "X is required." - _template/server.ts: document the guard at the top of `fetch`, with the canonical `config.query.trim()` check and a note that the hello-world demo intentionally skips it. Comment-only — the template still runs as-is. - lib/columns/README.md: correct step 4 ("present" is not "non-empty") and add a "Validate required inputs" convention with the exact pattern and the note that a throw is caught by the shared API route as the column error state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…lly does Soften "every input-driven column" — the query-driven github columns (search/issues/prs/backlinks) don't guard, only the repo-based ones do — and correct the error surface: a thrown error becomes a fetch-error toast, not an inline column error state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Teach the required-input validation pattern in the canonical contributor path: the
_template/folder every new column is copied from, and the plugin-contract README (lib/columns/README.md).Why
PRs #78 and #79 added trim-and-throw guards for required inputs across the Grok-backed and moded social columns (
linkedin,youtube,bluesky,mastodon, thegithub-*family). But the reference contributors copy from never taught the pattern. A developer scaffolding a new column from_template/inherits the exact gap those two PRs closed:config.foois "present" — true, butz.string().default("")makes "present" include"".queryfires a wasted upstream request that returns an opaque error instead of a clear"X is required.".Putting the convention at the copy-source means every future column gets it for free — lowering the barrier to contributing a correct column, which is minitor's whole contribution model.
Changes
lib/columns/plugins/_template/server.ts: documents the guard at the top offetch, with the canonicalconfig.query.trim()/ throw check and a note that the hello-world demo intentionally skips it. Comment-only — the template still runs as-is, no behavior change.lib/columns/README.md: corrects step 4 (present is not non-empty) and adds a "Validate required inputs" convention showing the exact pattern, plus the note that a throw is caught by the shared API route (app/api/columns/[type]/route.ts) and rendered as the column's error state.No code behavior changes to any shipped column — template comment + contract docs only, so the build CI is unaffected.
Built autonomously by Aeon