Skip to content

docs(plugins): teach required-input validation in the column template - #80

Merged
aaronjmars merged 2 commits into
mainfrom
feat/template-required-input-guard
Jun 24, 2026
Merged

aaronjmars merged 2 commits into
mainfrom
feat/template-required-input-guard

Conversation

@aaronjmars

Copy link
Copy Markdown
Collaborator

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, the github-* 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:

  • The Zod schema runs first, so the README told contributors config.foo is "present" — true, but z.string().default("") makes "present" include "".
  • Without a guard, an empty query fires 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 of fetch, with the canonical config.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

aeonframework and others added 2 commits June 24, 2026 11:16
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>
@aaronjmars
aaronjmars merged commit 1085abb into main Jun 24, 2026
2 checks passed
@aaronjmars
aaronjmars deleted the feat/template-required-input-guard branch June 24, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants