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:
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user