Skip to content

Commit bf6837a

Browse files
committed
feat: flat-routes implemented
1 parent de2f8c5 commit bf6837a

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

app/routes.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
import { index, type RouteConfig } from '@react-router/dev/routes';
1+
import { flatRoutes } from 'remix-flat-routes';
22

3-
export default [index('routes/home.tsx')] satisfies RouteConfig;
3+
import { remixRoutesOptionAdapter } from '@react-router/remix-routes-option-adapter';
4+
5+
export default remixRoutesOptionAdapter(defineRoutes => {
6+
return flatRoutes('routes', defineRoutes, {
7+
ignoredRouteFiles: ['**/.*'],
8+
});
9+
});
File renamed without changes.

bun.lock

+12
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@commitlint/cli": "^19.7.1",
2222
"@commitlint/config-conventional": "^19.7.1",
2323
"@react-router/dev": "^7.2.0",
24+
"@react-router/remix-routes-option-adapter": "^7.2.0",
2425
"@tailwindcss/vite": "^4.0.9",
2526
"@types/eslint": "^9.6.1",
2627
"@types/node": "^22",
@@ -49,6 +50,7 @@
4950
"prettier": "^3.5.2",
5051
"prettier-plugin-tailwindcss": "^0.6.11",
5152
"react-router-devtools": "^1.1.6",
53+
"remix-flat-routes": "^0.8.5",
5254
"tailwindcss": "^4.0.9",
5355
"typescript": "^5.8.2",
5456
"vite": "^5.4.11",
@@ -353,6 +355,8 @@
353355

354356
"@react-router/node": ["@react-router/[email protected]", "", { "dependencies": { "@mjackson/node-fetch-server": "^0.2.0", "source-map-support": "^0.5.21", "stream-slice": "^0.1.2", "undici": "^6.19.2" }, "peerDependencies": { "react-router": "7.2.0", "typescript": "^5.1.0" }, "optionalPeers": ["typescript"] }, "sha512-CqBHLwvvV4BB8htmaSwT+SOwX9B4RVOIiEdTlaIp12sNVCGSYDIEGbv3T4Wxeq8p5ynNfhNcdBeXtZ6ZPWVozA=="],
355357

358+
"@react-router/remix-routes-option-adapter": ["@react-router/[email protected]", "", { "peerDependencies": { "@react-router/dev": "^7.2.0", "typescript": "^5.1.0" }, "optionalPeers": ["typescript"] }, "sha512-y5LH81y4JMP392FUVdjH+JbT/Q/vzKVA5t/HBb/JIUFjh/KN5bKt4zIoWY7sbr95A61RSIBr4ZDLH/VZrxL35A=="],
359+
356360
"@react-router/serve": ["@react-router/[email protected]", "", { "dependencies": { "@react-router/express": "7.2.0", "@react-router/node": "7.2.0", "compression": "^1.7.4", "express": "^4.19.2", "get-port": "5.1.1", "morgan": "^1.10.0", "source-map-support": "^0.5.21" }, "peerDependencies": { "react-router": "7.2.0" }, "bin": { "react-router-serve": "bin.js" } }, "sha512-if6tQBqewTGv2/oGcgXh44XRyyWfxJICp6NAA++acbK1ol/1k/rcdIrSZXDP0Oz2+aItKTIXZR3sVYH/R80YXQ=="],
357361

358362
"@rollup/rollup-android-arm-eabi": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-qZdlImWXur0CFakn2BJ2znJOdqYZKiedEPEVNTBrpfPjc/YuTGcaYZcdmNFTkUj3DU0ZM/AElcM8Ybww3xVLzA=="],
@@ -1351,6 +1355,8 @@
13511355

13521356
"regexp.prototype.flags": ["[email protected]", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "get-proto": "^1.0.1", "gopd": "^1.2.0", "set-function-name": "^2.0.2" } }, "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA=="],
13531357

1358+
"remix-flat-routes": ["[email protected]", "", { "dependencies": { "fs-extra": "^11.2.0", "minimatch": "^10.0.1" }, "bin": { "migrate-flat-routes": "dist/cli.cjs" } }, "sha512-30GcEpvwqFXCyTKiCTeqI3QSNyTg+f0qLGeIc95y6o3gaOEIhbC37qWpe8HrVEkdnj48xUyaUK03jm1zYFkhfA=="],
1359+
13541360
"remix-themes": ["[email protected]", "", { "peerDependencies": { "react-router": ">=7.0.0" } }, "sha512-S1vIx86xdsMv+ceaWGWtlVZBMhU4tmZeBOBzOiZnhbHnGBbd5YeyIlZ5EL3BSEhZq35oEcINeTrMrVju9GPYEA=="],
13551361

13561362
"remove-accents": ["[email protected]", "", {}, "sha512-8g3/Otx1eJaVD12e31UbJj1YzdtVvzH85HV7t+9MJYk/u3XmkOUJ5Ys9wQrf9PCPK8+xn4ymzqYCiZl6QWKn+A=="],
@@ -1733,6 +1739,10 @@
17331739

17341740
"readable-stream/safe-buffer": ["[email protected]", "", {}, "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="],
17351741

1742+
"remix-flat-routes/fs-extra": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew=="],
1743+
1744+
"remix-flat-routes/minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ=="],
1745+
17361746
"restore-cursor/onetime": ["[email protected]", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="],
17371747

17381748
"send/debug": ["[email protected]", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
@@ -1809,6 +1819,8 @@
18091819

18101820
"morgan/debug/ms": ["[email protected]", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
18111821

1822+
"remix-flat-routes/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="],
1823+
18121824
"send/debug/ms": ["[email protected]", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
18131825

18141826
"wrap-ansi/string-width/emoji-regex": ["[email protected]", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="],

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@commitlint/cli": "^19.7.1",
3636
"@commitlint/config-conventional": "^19.7.1",
3737
"@react-router/dev": "^7.2.0",
38+
"@react-router/remix-routes-option-adapter": "^7.2.0",
3839
"@tailwindcss/vite": "^4.0.9",
3940
"@types/eslint": "^9.6.1",
4041
"@types/node": "^22",
@@ -63,6 +64,7 @@
6364
"prettier": "^3.5.2",
6465
"prettier-plugin-tailwindcss": "^0.6.11",
6566
"react-router-devtools": "^1.1.6",
67+
"remix-flat-routes": "^0.8.5",
6668
"tailwindcss": "^4.0.9",
6769
"typescript": "^5.8.2",
6870
"vite": "^5.4.11",

0 commit comments

Comments
 (0)