feat(06-03): add raw groups, house middleware, and route:list

- GroupRaw plus sticky raw inheritance and registration-time house-envelope refusal via pact.HasHouseMiddleware
- Recover on raw routes writes a bare 500; non-raw keeps the house JSON body
- Router.Routes() and surf.RouteListCommand; generated main registers route:list
This commit is contained in:
Jakub Zych
2026-09-19 19:55:32 +02:00
parent 42b8295cc1
commit fa7e6d1870
8 changed files with 391 additions and 22 deletions

View File

@@ -111,6 +111,7 @@ func generateMain(m Manifest) ([]byte, error) {
b.WriteString("\t}\n")
b.WriteString("\tcommands := lagoon.RuntimeCommands(app, plugins)\n")
b.WriteString("\tcommands = append(commands, surf.ServeCommand(app, plugins))\n")
b.WriteString("\tcommands = append(commands, surf.RouteListCommand(app, plugins))\n")
b.WriteString("\tfor _, plugin := range plugins {\n")
b.WriteString("\t\tif hasCommands, ok := plugin.(pact.HasCommands); ok {\n")
b.WriteString("\t\t\tcommands = append(commands, hasCommands.Commands()...)\n")

View File

@@ -101,6 +101,9 @@ func TestGenerateStableQuotedImportsInManifestOrder(t *testing.T) {
if !bytes.Contains(mainSrc, []byte("surf.ServeCommand")) {
t.Fatalf("main does not register serve:\n%s", mainSrc)
}
if !bytes.Contains(mainSrc, []byte("surf.RouteListCommand")) {
t.Fatalf("main does not register route:list:\n%s", mainSrc)
}
if bytes.Contains(mainSrc, []byte("examples/hello")) {
t.Fatal("generated main hard-codes examples/hello")
}