feat(packages/tuono-(router|fs-router-vite-plugin)): replace __route with __layout (#283)

This commit is contained in:
Marco Pasqualetti
2025-01-03 17:08:18 +01:00
committed by GitHub
parent cf56b3a53e
commit 0ef1252e1f
24 changed files with 82 additions and 78 deletions
@@ -1,6 +1,6 @@
import type { RouteNode } from './types'
import { multiSortBy } from './utils'
import { ROOT_PATH_ID } from './constants'
import { LAYOUT_PATH_ID } from './constants'
// Routes need to be sorted in order to iterate over the handleNode fn
// with first the items that might be parent routes
@@ -14,4 +14,4 @@ export const sortRouteNodes = (routes: Array<RouteNode>): Array<RouteNode> =>
(d): number => (d.filePath.match(/[./]route[.]/) ? -1 : 1),
(d): number => (d.routePath.endsWith('/') ? -1 : 1),
(d): string => d.routePath,
]).filter((d) => ![`/${ROOT_PATH_ID}`].includes(d.routePath || ''))
]).filter((d) => ![`/${LAYOUT_PATH_ID}`].includes(d.routePath || ''))