Skip to content

Commit

Permalink
Revert "fix: catch-all server side handler"
Browse files Browse the repository at this point in the history
This reverts commit 7e8be92.
  • Loading branch information
Valerioageno authored and spacecodeur committed Jan 5, 2025
1 parent 97c83b4 commit c6de772
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
22 changes: 12 additions & 10 deletions packages/tuono-fs-router-vite-plugin/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ async function getRouteNodes(
} else if (fullPath.match(/\.(rs)$/)) {
const filePath = replaceBackslash(path.join(dir, dirent.name))
const filePathNoExt = removeExt(filePath)
let routePath = cleanPath(`/${filePathNoExt}`) || ''
let routePath =
cleanPath(`/${filePathNoExt.split('.').join('/')}`) || ''

if (routePath === 'index') {
routePath = '/'
Expand Down Expand Up @@ -166,16 +167,17 @@ export async function routeGenerator(config = defaultConfig): Promise<void> {
const imports = [
...sortedRouteNodes.map((node) => {
const extension = node.filePath.endsWith('mdx') ? '.mdx' : ''
return `const ${node.variableName as string
}Import = dynamic(() => import('./${replaceBackslash(
removeExt(
path.relative(
path.dirname(config.generatedRouteTree),
path.resolve(config.folderName, node.filePath),
),
false,
return `const ${
node.variableName as string
}Import = dynamic(() => import('./${replaceBackslash(
removeExt(
path.relative(
path.dirname(config.generatedRouteTree),
path.resolve(config.folderName, node.filePath),
),
)}${extension}'))`
false,
),
)}${extension}'))`
}),
].join('\n')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const IndexRoute = Index.update({
const PostscatchallRoute = Postscatchall.update({
path: '/posts/[...catch_all]',
getParentRoute: () => rootRoute,
hasHandler: true,
})

// Create and export the route tree
Expand Down
Empty file.

0 comments on commit c6de772

Please sign in to comment.