Skip to content

Commit

Permalink
Remove @remix-run/routes-option-adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
brookslybrand committed Nov 5, 2024
1 parent ec6db8c commit 15a6d3a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 66 deletions.
82 changes: 37 additions & 45 deletions app/routes.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
import { type RouteConfig } from "@remix-run/route-config";
import { remixRoutesOptionAdapter } from "@remix-run/routes-option-adapter";

export const routes: RouteConfig = await remixRoutesOptionAdapter(
(defineRoutes) => {
return defineRoutes((route) => {
route("/__components", "components/_playground/playground.tsx");
route("/color-scheme", "actions/color-scheme.ts");

route("/", "pages/home.tsx", { index: true });
route("/brand", "pages/brand.tsx");
route("/healthcheck", "pages/healthcheck.tsx");

// Pre v7 inline API docs
route("/en/:ref", "pages/docs-layout.tsx", { id: "v6-guides" }, () => {
route("", "pages/docs-index.tsx", {
index: true,
id: "v6-index",
});
route("*", "pages/doc.tsx", { id: "v6-guide" });
});

route("/v6/*", "pages/redirect-v6-doc.tsx");
route("/v7/api/:pkg/*", "pages/redirect-v7-doc.tsx");
route("/v7/docs/*", "pages/redirect-v7-doc.tsx", {
id: "v7-docs-redirect",
});

route("/:ref?/docs", "pages/docs-layout.tsx", { id: "docs" }, () => {
route("", "pages/docs-index.tsx", { index: true });
route("*", "pages/doc.tsx");
});

// TODO: uncomment after v7
// route("/:ref?/api", "pages/api-redirect.ts");

route("/:ref?/api/:pkg", "pages/api-layout.tsx", { id: "api" }, () => {
route("", "pages/api-index.tsx", { index: true });
route("*", "pages/api-doc.tsx");
});

route("/*", "pages/notfound.tsx");
});
}
);
import { type RouteConfig, route, index } from "@remix-run/route-config";

export const routes: RouteConfig = [
route("/__components", "components/_playground/playground.tsx"),
route("/color-scheme", "actions/color-scheme.ts"),

index("pages/home.tsx"),
route("/brand", "pages/brand.tsx"),
route("/healthcheck", "pages/healthcheck.tsx"),

// Pre v7 inline API docs
route("/en/:ref", "pages/docs-layout.tsx", { id: "v6-guides" }, [
index("pages/docs-index.tsx", { id: "v6-index" }),
route("*", "pages/doc.tsx", { id: "v6-guide" }),
]),

route("/v6/*", "pages/redirect-v6-doc.tsx"),
route("/v7/api/:pkg/*", "pages/redirect-v7-doc.tsx"),
route("/v7/docs/*", "pages/redirect-v7-doc.tsx", {
id: "v7-docs-redirect",
}),

route("/:ref?/docs", "pages/docs-layout.tsx", { id: "docs" }, [
index("pages/docs-index.tsx"),
route("*", "pages/doc.tsx"),
]),

// TODO: uncomment after v7
// route("/:ref?/api", "pages/api-redirect.ts"),

route("/:ref?/api/:pkg", "pages/api-layout.tsx", { id: "api" }, [
index("pages/api-index.tsx"),
route("*", "pages/api-doc.tsx"),
]),

route("/*", "pages/notfound.tsx"),
];
20 changes: 0 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@remix-run/node": "2.14.0-pre.0",
"@remix-run/react": "2.14.0-pre.0",
"@remix-run/route-config": "^2.14.0-pre.0",
"@remix-run/routes-option-adapter": "^2.14.0-pre.0",
"@remix-run/serve": "2.14.0-pre.0",
"bcryptjs": "^2.4.3",
"cheerio": "^1.0.0-rc.12",
Expand Down

0 comments on commit 15a6d3a

Please sign in to comment.