feat(mesh)!: refuse to export a provider

A provider's value is the object it builds, which cannot cross a JSON wire.
What did cross became an app-scope binding the teacup resolved once at boot
and served from a cache the teapot no longer stood behind. A step is the
shape that travels; the error says so.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-09-12 15:40:24 -05:00
1 parent 419ba092d4
commit f6c05a0929
7 files changed
+70 -37

No files matched your search

+4 -4
View File
@@ -75,9 +75,9 @@ if (require.main === module) {
// ── Mesh Demo (teapot / teacup) ───────────────────────────────────────────
@Provider({ provides: 'config', export: true })
class ConfigProvider {
provide() {
@Step({ provides: 'config', needs: [], export: true })
class ConfigStep {
run() {
return { config: { env: 'demo' } };
}
}
@@ -98,7 +98,7 @@ class PingController {
}
}
@Module({ mountpoint: '/mesh', providers: [ConfigProvider], steps: [AuthStep], controllers: [PingController] })
@Module({ mountpoint: '/mesh', steps: [ConfigStep, AuthStep], controllers: [PingController] })
class TeapotModule {}
export const teapotApp = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: 'demo-secret' } });