Skip to content

Commit 90af833

Browse files
committed
Generate undocumented endpoints
1 parent ec2b45b commit 90af833

3 files changed

Lines changed: 7 additions & 15 deletions

File tree

codegen/lib/connect.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,9 @@ export const connect = (
2828
metalsmith: Metalsmith,
2929
): void => {
3030
const metadata = metalsmith.metadata() as Metadata
31-
const { blueprint } = metadata
32-
33-
const namespaces = blueprint.namespaces.filter(
34-
({ isUndocumented }) => !isUndocumented,
35-
)
36-
const routes = blueprint.routes.filter(
37-
({ isUndocumented }) => !isUndocumented,
38-
)
31+
const {
32+
blueprint: { namespaces, routes },
33+
} = metadata
3934

4035
const nodes = [...namespaces, ...routes]
4136

codegen/lib/layouts/endpoints.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ export const setEndpointsLayoutContext = (
2222
file.className = getClassName('Endpoints')
2323
file.skipClientSessionImport = true
2424
file.endpoints = routes.flatMap((route) =>
25-
route.endpoints
26-
.filter(({ isUndocumented }) => !isUndocumented)
27-
.map((endpoint) => getEndpointLayoutContext(endpoint, route)),
25+
route.endpoints.map((endpoint) =>
26+
getEndpointLayoutContext(endpoint, route),
27+
),
2828
)
2929
file.routeImports = routes.map((route) => {
3030
return {

codegen/lib/layouts/route.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ export const setRouteLayoutContext = (
4949

5050
file.endpoints = []
5151
if (node != null && 'endpoints' in node) {
52-
const endpoints = node.endpoints.filter(
53-
({ isUndocumented }) => !isUndocumented,
54-
)
55-
file.endpoints = endpoints.map((endpoint) =>
52+
file.endpoints = node.endpoints.map((endpoint) =>
5653
getEndpointLayoutContext(endpoint, node),
5754
)
5855
}

0 commit comments

Comments
 (0)