Enable Remix v3_routeConfig future flag
Some checks failed
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled

This commit is contained in:
Kalle 2024-12-01 21:55:43 +02:00
parent a74901829c
commit b2b13e6aa7
4 changed files with 266 additions and 336 deletions

241
app/routes.ts Normal file
View File

@ -0,0 +1,241 @@
import {
type RouteConfig,
index,
prefix,
route,
} from "@remix-run/route-config";
export default [
index("features/front-page/routes/index.tsx"),
route("/patrons-list", "features/front-page/routes/patrons-list.ts"),
route("/settings", "features/settings/routes/settings.tsx"),
route("/suspended", "features/ban/routes/suspended.tsx"),
route("/u", "features/user-search/routes/u.tsx"),
route("/u/:identifier", "features/user-page/routes/u.$identifier.tsx", [
index("features/user-page/routes/u.$identifier.index.tsx"),
route("art", "features/user-page/routes/u.$identifier.art.tsx"),
route("edit", "features/user-page/routes/u.$identifier.edit.tsx"),
route("seasons", "features/user-page/routes/u.$identifier.seasons.tsx"),
route("vods", "features/user-page/routes/u.$identifier.vods.tsx"),
route("builds", "features/user-page/routes/u.$identifier.builds.tsx"),
route(
"builds/new",
"features/user-page/routes/u.$identifier.builds.new.tsx",
),
route("results", "features/user-page/routes/u.$identifier.results.tsx"),
route(
"highlights",
"features/user-page/routes/u.$identifier.results.highlights.tsx",
),
]),
route("/badges", "features/badges/routes/badges.tsx", [
route(":id", "features/badges/routes/badges.$id.tsx", [
route("edit", "features/badges/routes/badges.$id.edit.tsx"),
]),
]),
...prefix("/calendar", [
index("features/calendar/routes/calendar.tsx"),
route("new", "features/calendar/routes/calendar.new.tsx"),
route(":id", "features/calendar/routes/calendar.$id.tsx"),
route(
":id/report-winners",
"features/calendar/routes/calendar.$id.report-winners.tsx",
),
route("map-pool-events", "features/calendar/routes/map-pool-events.ts"),
]),
route("/maps", "features/map-list-generator/routes/maps.tsx"),
route("/upload", "features/img-upload/routes/upload.tsx"),
route("/upload/admin", "features/img-upload/routes/upload.admin.tsx"),
route("/plans", "features/map-planner/routes/plans.tsx"),
route("/analyzer", "features/build-analyzer/routes/analyzer.tsx"),
route(
"/object-damage-calculator",
"features/object-damage-calculator/routes/object-damage-calculator.tsx",
),
route("/to/:id", "features/tournament/routes/to.$id.tsx", [
index("features/tournament/routes/to.$id.index.tsx"),
route("register", "features/tournament/routes/to.$id.register.tsx"),
route("teams", "features/tournament/routes/to.$id.teams.tsx"),
route("teams/:tid", "features/tournament/routes/to.$id.teams.$tid.tsx"),
route("join", "features/tournament/routes/to.$id.join.tsx"),
route("admin", "features/tournament/routes/to.$id.admin.tsx"),
route("seeds", "features/tournament/routes/to.$id.seeds.tsx"),
route("results", "features/tournament/routes/to.$id.results.tsx"),
route("streams", "features/tournament/routes/to.$id.streams.tsx"),
route("subs", "features/tournament-subs/routes/to.$id.subs.tsx"),
route("subs/new", "features/tournament-subs/routes/to.$id.subs.new.tsx"),
route("brackets", "features/tournament-bracket/routes/to.$id.brackets.tsx"),
route(
"brackets/subscribe",
"features/tournament-bracket/routes/to.$id.brackets.subscribe.tsx",
),
route(
"matches/:mid",
"features/tournament-bracket/routes/to.$id.matches.$mid.tsx",
),
route(
"matches/:mid/subscribe",
"features/tournament-bracket/routes/to.$id.matches.$mid.subscribe.tsx",
),
]),
...prefix("/org/:slug", [
index("features/tournament-organization/routes/org.$slug.tsx"),
route("edit", "features/tournament-organization/routes/org.$slug.edit.tsx"),
]),
route("/faq", "features/info/routes/faq.tsx"),
route("/contributions", "features/info/routes/contributions.tsx"),
route("/privacy-policy", "features/info/routes/privacy-policy.tsx"),
route("/support", "features/info/routes/support.tsx"),
route("/t", "features/team/routes/t.tsx"),
...prefix("/t/:customUrl", [
index("features/team/routes/t.$customUrl.tsx"),
route("edit", "features/team/routes/t.$customUrl.edit.tsx"),
route("roster", "features/team/routes/t.$customUrl.roster.tsx"),
route("join", "features/team/routes/t.$customUrl.join.tsx"),
]),
...prefix("/vods", [
index("features/vods/routes/vods.tsx"),
route("new", "features/vods/routes/vods.new.tsx"),
route(":id", "features/vods/routes/vods.$id.tsx"),
]),
...prefix("/builds", [
index("features/builds/routes/builds.tsx"),
...prefix(":slug", [
index("features/builds/routes/builds.$slug.tsx"),
route("stats", "features/build-stats/routes/builds.$slug.stats.tsx"),
route("popular", "features/build-stats/routes/builds.$slug.popular.tsx"),
]),
]),
...prefix("/xsearch", [
index("features/top-search/routes/xsearch.tsx"),
route("/player/:id", "features/top-search/routes/xsearch.player.$id.tsx"),
]),
route("/leaderboards", "features/leaderboards/routes/leaderboards.tsx"),
route("/links", "features/links/routes/links.tsx"),
...prefix("/art", [
index("features/art/routes/art.tsx"),
route("new", "features/art/routes/art.new.tsx"),
]),
...prefix("/q", [
index("features/sendouq/routes/q.tsx"),
route("rules", "features/sendouq/routes/q.rules.tsx"),
route("info", "features/sendouq/routes/q.info.tsx"),
route("looking", "features/sendouq/routes/q.looking.tsx"),
route("preparing", "features/sendouq/routes/q.preparing.tsx"),
route("match/:id", "features/sendouq/routes/q.match.$id.tsx"),
route("settings", "features/sendouq-settings/routes/q.settings.tsx"),
route("streams", "features/sendouq-streams/routes/q.streams.tsx"),
]),
route("/play", "features/sendouq/routes/play.tsx"),
route("/trusters", "features/sendouq/routes/trusters.ts"),
route("/weapon-usage", "features/sendouq/routes/weapon-usage.tsx"),
route("/tiers", "features/sendouq/routes/tiers.tsx"),
...prefix("/lfg", [
index("features/lfg/routes/lfg.tsx"),
route("new", "features/lfg/routes/lfg.new.tsx"),
]),
route("/admin", "features/admin/routes/admin.tsx"),
...prefix("/a", [
index("features/articles/routes/a.tsx"),
route(":slug", "features/articles/routes/a.$slug.tsx"),
]),
route("/plus", "features/plus-suggestions/routes/plus.tsx", [
index("features/plus-suggestions/routes/plus.index.tsx"),
route(
"suggestions",
"features/plus-suggestions/routes/plus.suggestions.tsx",
[
route(
"/plus/suggestions/new",
"features/plus-suggestions/routes/plus.suggestions.new.tsx",
),
route(
"/plus/suggestions/comment/:tier/:userId",
"features/plus-suggestions/routes/plus.suggestions.comment.$tier.$userId.tsx",
),
],
),
route("list", "features/plus-voting/routes/plus.list.ts"),
route("voting", "features/plus-voting/routes/plus.voting.tsx"),
route(
"voting/results",
"features/plus-voting/routes/plus.voting.results.tsx",
),
]),
route("/patrons", "features/api-private/routes/patrons.tsx"),
route("/seed", "features/api-private/routes/seed.tsx"),
route("/users", "features/api-private/routes/users.tsx"),
...prefix("/api", [
route(
"/user/:identifier",
"features/api-public/routes/user.$identifier.ts",
),
route(
"/calendar/:year/:week",
"features/api-public/routes/calendar.$year.$week.ts",
),
route("/tournament/:id", "features/api-public/routes/tournament.$id.ts"),
route(
"/tournament/:id/teams",
"features/api-public/routes/tournament.$id.teams.ts",
),
route(
"/tournament/:id/brackets/:bidx",
"features/api-public/routes/tournament.$id.brackets.$bidx.ts",
),
route(
"/tournament/:id/brackets/:bidx/standings",
"features/api-public/routes/tournament.$id.brackets.$bidx.standings.ts",
),
route(
"/tournament-match/:id",
"features/api-public/routes/tournament-match.$id.ts",
),
route("/org/:id", "features/api-public/routes/org.$id.ts"),
]),
route("/theme", "features/theme/routes/theme.ts"),
...prefix("/auth", [
index("features/auth/routes/auth.tsx"),
route("callback", "features/auth/routes/auth.callback.tsx"),
route("create-link", "features/auth/routes/auth.create-link.tsx"),
route("login", "features/auth/routes/auth.login.tsx"),
route("logout", "features/auth/routes/auth.logout.tsx"),
route("impersonate", "features/auth/routes/auth.impersonate.tsx"),
route("impersonate/stop", "features/auth/routes/auth.impersonate.stop.tsx"),
]),
] satisfies RouteConfig;

23
package-lock.json generated
View File

@ -71,6 +71,7 @@
"@biomejs/biome": "1.9.4",
"@playwright/test": "^1.49.0",
"@remix-run/dev": "^2.15.0",
"@remix-run/route-config": "^2.15.0",
"@types/better-sqlite3": "^7.6.12",
"@types/node-cron": "^3.0.11",
"@types/nprogress": "^0.2.3",
@ -3980,6 +3981,28 @@
}
}
},
"node_modules/@remix-run/route-config": {
"version": "2.15.0",
"resolved": "https://registry.npmjs.org/@remix-run/route-config/-/route-config-2.15.0.tgz",
"integrity": "sha512-i1m17W5jpOXsH5NyZfudHk89qOom/67faYX31qI8Zzv8fgj1hM2NYGoExcpumhL2tvMKSpEW4oE+95adrCGpGw==",
"dev": true,
"license": "MIT",
"dependencies": {
"lodash": "^4.17.21"
},
"engines": {
"node": ">=18.0.0"
},
"peerDependencies": {
"@remix-run/dev": "^2.15.0",
"typescript": "^5.1.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/@remix-run/router": {
"version": "1.21.0",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.21.0.tgz",

View File

@ -87,6 +87,7 @@
"@biomejs/biome": "1.9.4",
"@playwright/test": "^1.49.0",
"@remix-run/dev": "^2.15.0",
"@remix-run/route-config": "^2.15.0",
"@types/better-sqlite3": "^7.6.12",
"@types/node-cron": "^3.0.11",
"@types/nprogress": "^0.2.3",

View File

@ -19,342 +19,7 @@ export default defineConfig(() => {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
routes: (defineRoutes) => {
return defineRoutes((route) => {
route("/", "features/front-page/routes/index.tsx");
route("/settings", "features/settings/routes/settings.tsx");
route(
"/patrons-list",
"features/front-page/routes/patrons-list.ts",
);
route("/suspended", "features/ban/routes/suspended.tsx");
route("/u", "features/user-search/routes/u.tsx");
route(
"/u/:identifier",
"features/user-page/routes/u.$identifier.tsx",
() => {
route(
"/u/:identifier",
"features/user-page/routes/u.$identifier.index.tsx",
);
route(
"/u/:identifier/art",
"features/user-page/routes/u.$identifier.art.tsx",
);
route(
"/u/:identifier/edit",
"features/user-page/routes/u.$identifier.edit.tsx",
);
route(
"/u/:identifier/seasons",
"features/user-page/routes/u.$identifier.seasons.tsx",
);
route(
"/u/:identifier/vods",
"features/user-page/routes/u.$identifier.vods.tsx",
);
route(
"/u/:identifier/builds",
"features/user-page/routes/u.$identifier.builds.tsx",
);
route(
"/u/:identifier/builds/new",
"features/user-page/routes/u.$identifier.builds.new.tsx",
);
route(
"/u/:identifier/results",
"features/user-page/routes/u.$identifier.results.tsx",
);
route(
"/u/:identifier/results/highlights",
"features/user-page/routes/u.$identifier.results.highlights.tsx",
);
},
);
route("/badges", "features/badges/routes/badges.tsx", () => {
route(
"/badges/:id",
"features/badges/routes/badges.$id.tsx",
() => {
route(
"/badges/:id/edit",
"features/badges/routes/badges.$id.edit.tsx",
);
},
);
});
route("/calendar", "features/calendar/routes/calendar.tsx");
route("/calendar/new", "features/calendar/routes/calendar.new.tsx");
route("/calendar/:id", "features/calendar/routes/calendar.$id.tsx");
route(
"/calendar/:id/report-winners",
"features/calendar/routes/calendar.$id.report-winners.tsx",
);
route(
"/calendar/map-pool-events",
"features/calendar/routes/map-pool-events.ts",
);
route("/maps", "features/map-list-generator/routes/maps.tsx");
route("/upload", "features/img-upload/routes/upload.tsx");
route(
"/upload/admin",
"features/img-upload/routes/upload.admin.tsx",
);
route("/plans", "features/map-planner/routes/plans.tsx");
route("/analyzer", "features/build-analyzer/routes/analyzer.tsx");
route(
"/object-damage-calculator",
"features/object-damage-calculator/routes/object-damage-calculator.tsx",
);
route("/to/:id", "features/tournament/routes/to.$id.tsx", () => {
route("/to/:id", "features/tournament/routes/to.$id.index.tsx");
route(
"/to/:id/register",
"features/tournament/routes/to.$id.register.tsx",
);
route(
"/to/:id/teams",
"features/tournament/routes/to.$id.teams.tsx",
);
route(
"/to/:id/teams/:tid",
"features/tournament/routes/to.$id.teams.$tid.tsx",
);
route(
"/to/:id/join",
"features/tournament/routes/to.$id.join.tsx",
);
route(
"/to/:id/admin",
"features/tournament/routes/to.$id.admin.tsx",
);
route(
"/to/:id/seeds",
"features/tournament/routes/to.$id.seeds.tsx",
);
route(
"/to/:id/results",
"features/tournament/routes/to.$id.results.tsx",
);
route(
"/to/:id/streams",
"features/tournament/routes/to.$id.streams.tsx",
);
route(
"/to/:id/subs",
"features/tournament-subs/routes/to.$id.subs.tsx",
);
route(
"/to/:id/subs/new",
"features/tournament-subs/routes/to.$id.subs.new.tsx",
);
route(
"/to/:id/brackets",
"features/tournament-bracket/routes/to.$id.brackets.tsx",
);
route(
"/to/:id/brackets/subscribe",
"features/tournament-bracket/routes/to.$id.brackets.subscribe.tsx",
);
route(
"/to/:id/matches/:mid",
"features/tournament-bracket/routes/to.$id.matches.$mid.tsx",
);
route(
"/to/:id/matches/:mid/subscribe",
"features/tournament-bracket/routes/to.$id.matches.$mid.subscribe.tsx",
);
});
route(
"/org/:slug",
"features/tournament-organization/routes/org.$slug.tsx",
);
route(
"/org/:slug/edit",
"features/tournament-organization/routes/org.$slug.edit.tsx",
);
route("/faq", "features/info/routes/faq.tsx");
route("/contributions", "features/info/routes/contributions.tsx");
route("/privacy-policy", "features/info/routes/privacy-policy.tsx");
route("/support", "features/info/routes/support.tsx");
route("/t", "features/team/routes/t.tsx");
route("/t/:customUrl", "features/team/routes/t.$customUrl.tsx");
route(
"/t/:customUrl/edit",
"features/team/routes/t.$customUrl.edit.tsx",
);
route(
"/t/:customUrl/roster",
"features/team/routes/t.$customUrl.roster.tsx",
);
route(
"/t/:customUrl/join",
"features/team/routes/t.$customUrl.join.tsx",
);
route("/vods", "features/vods/routes/vods.tsx");
route("/vods/new", "features/vods/routes/vods.new.tsx");
route("/vods/:id", "features/vods/routes/vods.$id.tsx");
route("/builds", "features/builds/routes/builds.tsx");
route("/builds/:slug", "features/builds/routes/builds.$slug.tsx");
route(
"/builds/:slug/stats",
"features/build-stats/routes/builds.$slug.stats.tsx",
);
route(
"/builds/:slug/popular",
"features/build-stats/routes/builds.$slug.popular.tsx",
);
route("/xsearch", "features/top-search/routes/xsearch.tsx");
route(
"/xsearch/player/:id",
"features/top-search/routes/xsearch.player.$id.tsx",
);
route(
"/leaderboards",
"features/leaderboards/routes/leaderboards.tsx",
);
route("/links", "features/links/routes/links.tsx");
route("/art", "features/art/routes/art.tsx");
route("/art/new", "features/art/routes/art.new.tsx");
route("/play", "features/sendouq/routes/play.tsx");
route("/q", "features/sendouq/routes/q.tsx");
route("/q/rules", "features/sendouq/routes/q.rules.tsx");
route("/q/info", "features/sendouq/routes/q.info.tsx");
route("/q/looking", "features/sendouq/routes/q.looking.tsx");
route("/q/preparing", "features/sendouq/routes/q.preparing.tsx");
route("/q/match/:id", "features/sendouq/routes/q.match.$id.tsx");
route("/trusters", "features/sendouq/routes/trusters.ts");
route(
"/q/settings",
"features/sendouq-settings/routes/q.settings.tsx",
);
route(
"/q/streams",
"features/sendouq-streams/routes/q.streams.tsx",
);
route("/weapon-usage", "features/sendouq/routes/weapon-usage.tsx");
route("/tiers", "features/sendouq/routes/tiers.tsx");
route("/lfg", "features/lfg/routes/lfg.tsx");
route("/lfg/new", "features/lfg/routes/lfg.new.tsx");
route("/admin", "features/admin/routes/admin.tsx");
route("/a", "features/articles/routes/a.tsx");
route("/a/:slug", "features/articles/routes/a.$slug.tsx");
route("/plus", "features/plus-suggestions/routes/plus.tsx", () => {
route("/plus", "features/plus-suggestions/routes/plus.index.tsx");
route(
"/plus/suggestions",
"features/plus-suggestions/routes/plus.suggestions.tsx",
() => {
route(
"/plus/suggestions/new",
"features/plus-suggestions/routes/plus.suggestions.new.tsx",
);
route(
"/plus/suggestions/comment/:tier/:userId",
"features/plus-suggestions/routes/plus.suggestions.comment.$tier.$userId.tsx",
);
},
);
route("/plus/list", "features/plus-voting/routes/plus.list.ts");
route(
"/plus/voting",
"features/plus-voting/routes/plus.voting.tsx",
);
route(
"/plus/voting/results",
"features/plus-voting/routes/plus.voting.results.tsx",
);
});
route("/patrons", "features/api-private/routes/patrons.tsx");
route("/seed", "features/api-private/routes/seed.tsx");
route("/users", "features/api-private/routes/users.tsx");
route(
"/api/user/:identifier",
"features/api-public/routes/user.$identifier.ts",
);
route(
"/api/calendar/:year/:week",
"features/api-public/routes/calendar.$year.$week.ts",
);
route(
"/api/tournament/:id",
"features/api-public/routes/tournament.$id.ts",
);
route(
"/api/tournament/:id/teams",
"features/api-public/routes/tournament.$id.teams.ts",
);
route(
"/api/tournament/:id/brackets/:bidx",
"features/api-public/routes/tournament.$id.brackets.$bidx.ts",
);
route(
"/api/tournament/:id/brackets/:bidx/standings",
"features/api-public/routes/tournament.$id.brackets.$bidx.standings.ts",
);
route(
"/api/tournament-match/:id",
"features/api-public/routes/tournament-match.$id.ts",
);
route("/api/org/:id", "features/api-public/routes/org.$id.ts");
route("/theme", "features/theme/routes/theme.ts");
route("/auth", "features/auth/routes/auth.tsx");
route("/auth/callback", "features/auth/routes/auth.callback.tsx");
route(
"/auth/create-link",
"features/auth/routes/auth.create-link.tsx",
);
route("/auth/login", "features/auth/routes/auth.login.tsx");
route("/auth/logout", "features/auth/routes/auth.logout.tsx");
route(
"/auth/impersonate",
"features/auth/routes/auth.impersonate.tsx",
);
route(
"/auth/impersonate/stop",
"features/auth/routes/auth.impersonate.stop.tsx",
);
});
v3_routeConfig: true,
},
}),
tsconfigPaths(),