Commit b043f24
fix(cli): mount metadata-HMR SSE route under host-config
Host configs (their `plugins[]` holds instantiated Plugin objects) make
`shouldBootWithLibrary()` return false, so `serve` skips createStandaloneStack —
the only place `@objectstack/metadata`'s MetadataPlugin is composed. That plugin
registers `GET /api/v1/dev/metadata-events` in its start(), so serving a host
config (e.g. examples/app-showcase) left the Console's MetadataHmrReloader
hitting a 404 and never auto-reloading after a recompile.
Compose a lightweight, artifact-sourced MetadataPlugin in the host-config path,
mirroring the standalone stack's dev config. Guarded to keep blast radius small:
- isDev only — production / cloud host deployments are untouched
- flags.server — pointless without an HTTP server to mount on
- skipped when a MetadataPlugin is already present (standalone / artifact paths)
- skipped when no local compiled artifact resolves to source from
Verified: a minimal host-config `serve --dev` now returns 200
(text/event-stream) for GET /api/v1/dev/metadata-events; was 404.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>serve --dev
1 parent 8f23746 commit b043f24
3 files changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
852 | 901 | | |
853 | 902 | | |
854 | 903 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments