From 759f9d5fd60964815bd81dc4dc5db169bd08b94c Mon Sep 17 00:00:00 2001 From: Josh Vlk Date: Fri, 10 Apr 2026 09:50:14 -0400 Subject: [PATCH] fix: add dom routes to fix Storage and Storage2 404s --- app/routes.res | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/routes.res b/app/routes.res index 674cc3357..918e44805 100644 --- a/app/routes.res +++ b/app/routes.res @@ -11,6 +11,17 @@ let stdlibPaths = { ->Array.filter(path => path !== "docs/manual/api/stdlib") } +let domPaths = { + let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/dom.json", "utf-8") + let json = JSON.parseOrThrow(rawFile) + switch json { + | Object(json) => Dict.keysToArray(json) + | _ => [] + } + ->Array.map(key => "docs/manual/api/" ++ key) + ->Array.filter(path => path !== "docs/manual/api/dom") +} + let beltPaths = { let rawFile = await Node.Fs.readFile("./markdown-pages/docs/api/belt.json", "utf-8") let json = JSON.parseOrThrow(rawFile) @@ -25,6 +36,9 @@ let beltPaths = { let stdlibRoutes = stdlibPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path})) +let domRoutes = + domPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path})) + let beltRoutes = beltPaths->Array.map(path => route(path, "./routes/ApiRoute.jsx", ~options={id: path})) @@ -65,6 +79,7 @@ let default = [ route("docs/manual/api/dom", "./routes/ApiRoute.jsx", ~options={id: "api-dom"}), ...stdlibRoutes, ...beltRoutes, + ...domRoutes, ...blogArticleRoutes, ...communityRoutes, ...mdxRoutes,