generouted
Advanced tools
Comparing version 1.13.4 to 1.13.5
{ | ||
"name": "generouted", | ||
"version": "1.13.4", | ||
"version": "1.13.5", | ||
"description": "Generated client-side file-based routes for Vite", | ||
@@ -93,11 +93,11 @@ "author": "Omar Elhawary <oedotme@gmail.com> (https://omarelhawary.me)", | ||
"@tanstack/react-location": "^3.7.4", | ||
"@types/react": "^18.2.8", | ||
"@types/react-dom": "^18.2.4", | ||
"@types/react": "^18.2.12", | ||
"@types/react-dom": "^18.2.5", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"react-router-dom": "^6.11.2", | ||
"react-router-dom": "^6.13.0", | ||
"solid-js": "^1.7.6", | ||
"typescript": "^5.1.3", | ||
"vite": "^4.3.9", | ||
"vitest": "^0.31.4" | ||
"vitest": "^0.32.2" | ||
}, | ||
@@ -104,0 +104,0 @@ "peerDependencies": { |
@@ -71,3 +71,3 @@ import { expect, test } from 'vitest' | ||
path: 'blog', | ||
id: 'blog', | ||
id: 'blog@blog/_layout', | ||
children: [ | ||
@@ -80,3 +80,3 @@ { path: 'tags', id: 'blog/tags' }, | ||
{ | ||
id: '(auth)', | ||
id: '(auth)@(auth)/_layout', | ||
children: [ | ||
@@ -83,0 +83,0 @@ { path: 'register', id: '(auth)/register' }, |
@@ -54,3 +54,3 @@ export const patterns = { | ||
const current = root ? routes : parent.children | ||
const found = current?.find((route) => route.path === path || route.id === path) | ||
const found = current?.find((route) => route.path === path || route.id?.split('@')?.[0] === path) | ||
const props = group ? (route?.component ? { id: path, path: '/' } : { id: path }) : { path } | ||
@@ -63,3 +63,3 @@ if (found) found.children ??= [] | ||
if (layout) { | ||
return Object.assign(parent, { ...route, id: parent.id || parent.path }) | ||
return Object.assign(parent, { ...route, id: `${parent.id || parent.path}@${route.id}` }) | ||
} | ||
@@ -66,0 +66,0 @@ |
26477