Skip to content

feat: support external emulator plugins#67

Open
jsj wants to merge 3 commits intovercel-labs:mainfrom
jsj:jsj/plugins
Open

feat: support external emulator plugins#67
jsj wants to merge 3 commits intovercel-labs:mainfrom
jsj:jsj/plugins

Conversation

@jsj
Copy link
Copy Markdown

@jsj jsj commented Apr 10, 2026

Summary

Adds a --plugin flag to load external emulator services at runtime without modifying the core package.

  • Plugins are loaded in parallel with guards against name collisions and duplicates
  • Threads through start, init, and list commands, and the programmatic createEmulator API

Motivation

The service list is growing steadily (#38 Clerk, #47 Stripe, #51 Resend) and each addition is a PR into core. This works today, but the trajectory points toward a repo that gets heavier with every service while many use cases — internal APIs, niche platform emulators, org-specific services — will never belong upstream.

The @emulators/* packages already follow a plugin-shaped contract internally. This PR exposes that contract so external consumers can load their own services the same way:

npx emulate start --plugin ./my-service.ts
npx emulate start --plugin @my-org/emulate-internal-api

No fork required, no upstream PR needed for services that only matter to one team.

Longer term this opens the door to a Vercel Skills-style architecture: a thin core runtime with a community gallery of service plugins, where built-in services are just the default set rather than the only option.

Plugin contract

A plugin module exports:

  • plugin (or default export) — a ServicePlugin with name and register(app)
  • Optional: seedFromConfig, label, endpoints, defaultFallback, initConfig

Test plan

  • Existing tests pass (6/6)
  • New test: external plugin loads and serves via createEmulator API
  • New test: initCommand generates config for an external plugin
  • Plugin name collision with built-in throws
  • Duplicate plugin names throw

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 10, 2026

@jsj is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

jsj added 2 commits April 10, 2026 12:25
emulate already uses a plugin-shaped internal architecture through per-service packages and ServicePlugin, but new emulators still require hardcoded core registry changes. This change reuses that existing service-entry path to allow external plugins while preserving built-in behavior and keeping scope limited to loading, listing, init, and programmatic startup.
…tection

Preserve ServiceName autocomplete with branded string pattern, load
plugins in parallel, and guard against name collisions with built-in
services or duplicate plugins.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d21292529

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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