Repository navigation
feat(plugin-test): add runtime-backed host - #3162
Conversation
🦋 Changeset detectedLatest commit: f36b985 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Scope checkThis PR changes 2,613 lines across 28 files. Large PRs are harder to review and more likely to be closed without review. If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs. See CONTRIBUTING.md for contribution guidelines. |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-test
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/registry-loader
@emdash-cms/registry-moderation
@emdash-cms/registry-verification
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
…into codex/runtime-plugin-test-host
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
docs | 8029c08 | Sep 16 2026, 08:58 PM |
Overlapping PRsThis PR modifies files that are also changed by other open PRs:
This may cause merge conflicts or duplicated work. A maintainer will coordinate. |
What does this PR do?
Adds the runtime-backed testing foundation for sandboxed plugin capabilities.
@emdash-cms/plugin-testnow exportscreatePluginRuntimeTestHost(). Its API separates direct sandbox transport, fixtures, production actions, observable-state inspectors, scheduled time control, cold restart, and disposal. It covers the shipped content lifecycle, plugin activation and deactivation, media upload, public comment submission and moderation, plugin-route policy, scheduled tasks, and captured email without adding planned plugin capabilities.The existing
createPluginTestHost()API remains compatible and is documented as a transport-level isolate harness. Generated plugin projects keep that fast Worker Loader test as their default; Node/workerd parity remains opt-in for plugin authors. The documentedemdashPluginTest()configuration supplies the virtual runtime modules required by the runtime host.Core route, comment, media, scheduler, and shutdown behavior is shared through production-owned boundaries so the runtime host does not copy business logic. The controlled scheduler clock applies to cron creation and recurrence as well as scheduled publishing, and each host run executes one production maintenance batch. Programmatic media uploads run both upload hook phases and preserve hook-transformed metadata.
The scheduler coverage also fixes ISO timestamps being misclassified as recurring schedules because the cron parser accepts them. ISO date-times, including timezone-less values, run once and are removed after a successful run.
Capability-specific helpers for schema discovery, translations, publication policy, Block Kit, binary HTTP, raw routes, taxonomies, redirects, expanded comment/media APIs, and encrypted settings remain with their owning capability PRs.
Type of change
This is a maintainer-directed testing-foundation PR; there is no separate Discussion URL.
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runAI-generated code disclosure
Screenshots / test output
Not applicable; this PR does not change rendered UI.
Validated locally:
publintforemdashand@emdash-cms/plugin-test.The local
attw --packinvocation foremdashcrashes insideattwwithCannot read properties of undefined (reading 'filename').npm packsucceeds and includes the newplugin-test-runtimeJavaScript and declaration entry points; CI remains authoritative for the package check.