Skip to content

Commit 580a024

Browse files
committed
Fix seam-http
1 parent d5beb97 commit 580a024

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

codegen/lib/connect.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ export const connect = (
1717
const metadata = metalsmith.metadata() as Metadata
1818
const { blueprint } = metadata
1919

20-
const rootRouteKey = `${rootPath}/seam-http.js`
21-
files[rootRouteKey] = { contents: Buffer.from('\n') }
22-
const file = files[rootRouteKey] as unknown as File
23-
file.layout = 'route.hbs'
24-
setRouteLayoutContext(file, null, blueprint)
25-
2620
const namespaces = blueprint.namespaces.filter(
2721
({ isUndocumented }) => !isUndocumented,
2822
)
@@ -32,6 +26,15 @@ export const connect = (
3226

3327
const routeIndexes: Record<string, Set<string>> = {}
3428

29+
const rootRouteKey = `${rootPath}/seam-http.ts`
30+
files[rootRouteKey] = { contents: Buffer.from('\n') }
31+
const file = files[rootRouteKey] as unknown as File
32+
file.layout = 'route.hbs'
33+
setRouteLayoutContext(file, null, blueprint)
34+
35+
routeIndexes[''] ??= new Set()
36+
routeIndexes['']?.add('seam-http.js')
37+
3538
for (const node of [...namespaces, ...routes]) {
3639
const path = toFilePath(node.path)
3740
const name = kebabCase(node.name)

0 commit comments

Comments
 (0)