Skip to content

feat: public forms and the incoming webhook are served by core (dune#78) - #10

Merged
zumbrunn merged 3 commits into
mainfrom
feat/forms-from-core
Nov 3, 2026
Merged

zumbrunn merged 3 commits into
mainfrom
feat/forms-from-core

Conversation

@zumbrunn

@zumbrunn zumbrunn commented Nov 3, 2026

Copy link
Copy Markdown
Member

Draft: needs a published @dune/core that has duneorg/dune#79 and duneorg/dune#80. The @dune/core range in deno.json is still 0.35 and is set when that core ships (expected ^0.35.2); CI cannot pass until then, because the JSR core it resolves today has no BootstrapResult.submissions and no registerFormRoutes.

Part of duneorg/dune#78: public features must not depend on an admin plugin.

Forms, the legacy contact route and the incoming webhook are now served by @dune/core. This plugin keeps only the submissions management UI.

What changes

  • Removes public-api.ts, email.ts and webhook.ts; the plugin no longer registers /api/forms/:name, /api/contact or /api/webhook/incoming, nor sends the submission email/webhook.
  • submissions.ts re-exports createSubmissionManager and the submission types from @dune/core/forms, so existing importers keep working. The UI reads the same files through bootstrap.submissions.
  • On a core without BootstrapResult.submissions the plugin stops at startup with a message that says what to upgrade (or to stay on 3.1).
  • The incoming webhook's audit entries (system.rebuild, system.cache_purge) are written from core's new onSystemAction hook.
  • The data directory follows system.data_dir, falling back to the deprecated admin.dataDir, the same resolution core uses for the submissions it stores.
  • mountDuneAdmin() calls core's registerFormRoutes() so headless apps (bootstrap + mountDuneAdmin, no createDuneApp) still get the public routes; it is a no-op when already registered.
  • Security: dev/apply blocks writes to admin.incoming_webhooks because those are secret tokens. The tokens now live at system.webhooks, so that is blocked too (with a test).

Tests

239 pass (locally, against the workspace core). Lint shows the same 6 pre-existing problems as main.

Release

Core first (#79 is merged, #80 open), then the 24 h dependency-age window, then set the core range here and publish. Version is not bumped in this PR; this is a behaviour change for anyone relying on this plugin to serve the public form routes with an older core, so decide the bump at release.

Not touched: the now-unused nodemailer import and publicServerError in http.ts.

🤖 Generated with Claude Code

zumbrunn and others added 3 commits November 3, 2026 09:26
Removes public-api, email and webhook from the plugin. The submissions UI
reads the store from BootstrapResult.submissions, the incoming webhook's
audit entries are written from core's onSystemAction hook, the data dir
follows system.data_dir, and dev/apply blocks system.webhooks (the new
home of incoming-webhook tokens).

Needs a core that provides BootstrapResult.submissions; the dependency
range is set when that core is published.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… apps (dune#78)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…form routes)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zumbrunn
zumbrunn marked this pull request as ready for review November 3, 2026 13:23
@zumbrunn
zumbrunn merged commit 69f4443 into main Nov 3, 2026
4 of 5 checks passed
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.

1 participant