Skip to content

Commit 15bdd32

Browse files
committed
Loosely type remix/rr types
1 parent 39bc9a3 commit 15bdd32

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@forge42/seo-tools",
3-
"version": "1.4.4",
3+
"version": "1.4.5",
44
"private": false,
55
"keywords": ["seo", "remix-seo", "seo-tools", "structured-data", "sitemap", "robots", "canonical", "seo-alternate"],
66
"description": "Framework agnostic set of helpers designed to help you create, maintain and develop your SEO",

src/remix/sitemap.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import type { Route, RouteManifest, ServerRoute } from "@remix-run/server-runtime/dist/routes.js"
22
import { type SitemapEntry, type SitemapRoute, generateSitemap } from "../sitemap"
33

4+
interface InternalServerRoute extends Omit<ServerRoute, "children"> {
5+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
6+
module: any
7+
}
48
export type SitemapFunctionReturnData = SitemapEntry | SitemapEntry[]
59

610
export type SitemapFunctionReturn = Promise<SitemapFunctionReturnData> | SitemapFunctionReturnData
@@ -30,7 +34,7 @@ const convertRemixPathToUrl = (routes: RouteManifest<Route | undefined>, route:
3034
return output === "" ? "/" : output
3135
}
3236

33-
const createExtendedRoutes = (routes: RouteManifest<Omit<ServerRoute, "children"> | undefined>) => {
37+
const createExtendedRoutes = (routes: RouteManifest<InternalServerRoute | undefined>) => {
3438
return Object.values(routes).map((route) => {
3539
return {
3640
...route,
@@ -45,7 +49,7 @@ const generateRemixSitemapRoutes = async ({
4549
}: {
4650
domain: string
4751
sitemapData?: unknown
48-
routes: RouteManifest<Omit<ServerRoute, "children"> | undefined>
52+
routes: RouteManifest<InternalServerRoute | undefined>
4953
}) => {
5054
// Add the url to each route
5155
const extendedRoutes = createExtendedRoutes(routes)
@@ -97,7 +101,7 @@ export interface RemixSitemapInfo {
97101
/**
98102
* The routes object from the remix server build. If not provided, the utility will try to import it.
99103
*/
100-
routes: RouteManifest<Omit<ServerRoute, "children"> | undefined>
104+
routes: RouteManifest<InternalServerRoute | undefined>
101105
}
102106

103107
/**

0 commit comments

Comments
 (0)