Skip to content

Commit 1365c21

Browse files
ci: apply automated fixes
1 parent 7d8d8d5 commit 1365c21

5 files changed

Lines changed: 89 additions & 68 deletions

File tree

‎docs/router/framework/react/routing/file-naming-conventions.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ File-based routing requires that you follow a few simple file naming conventions
2020
> **💡 Remember:** The file-naming conventions for your project could be affected by what [options](../../../../api/file-based-routing.md) are configured.
2121
2222
> [!NOTE] To escape a trailing underscore, for example `/posts[_].tsx`, usage of the upgraded [Non-Nested Routes](../routing-concepts#non-nested-routes) is required.
23+
2324
## Dynamic Path Params
2425

2526
Dynamic path params can be used in both flat and directory routes to create routes that can match a dynamic segment of the URL path. Dynamic path params are denoted by the `$` character in the filename:

‎docs/router/framework/react/routing/routing-concepts.md‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -353,35 +353,37 @@ The following table shows which component will be rendered based on the URL:
353353
- The `posts_.$postId.edit.tsx` route **does not share** the same `posts` prefix as the other routes and therefore will be treated as if it is a top-level route and will render `<PostEditor>`.
354354

355355
> [!NOTE]
356-
> While using non-nested routes with file-based routing already works brilliantly, it might misbehave in certain conditions.
357-
> Many of these limitations have already been addressed and will be released in the next major version of TanStack Router.
356+
> While using non-nested routes with file-based routing already works brilliantly, it might misbehave in certain conditions.
357+
> Many of these limitations have already been addressed and will be released in the next major version of TanStack Router.
358358
>
359359
> To start enjoying these benefits early, you can enable the experimental `nonNestedRoutes` flag in the router plugin configuration:
360360
>
361361
> ```ts
362362
> export default defineConfig({
363-
> plugins: [
364-
> tanstackRouter({
365-
> // some config,
366-
> experimental: {
367-
> nonNestedRoutes: true,
368-
> },
369-
> }),
370-
> ],
363+
> plugins: [
364+
> tanstackRouter({
365+
> // some config,
366+
> experimental: {
367+
> nonNestedRoutes: true,
368+
> },
369+
> }),
370+
> ],
371371
> })
372372
> ```
373373
>
374-
> *It is important to note that this does bring a slight change in how non-nested routes are referenced in useParams, useNavigate, etc. For this reason this has been released as a feature flag.
375-
> The trailing underscore is no longer expected in the path:*
376-
>
374+
> _It is important to note that this does bring a slight change in how non-nested routes are referenced in useParams, useNavigate, etc. For this reason this has been released as a feature flag.
375+
> The trailing underscore is no longer expected in the path:_
376+
>
377377
> Previously:
378+
>
378379
> ```ts
379-
> useParams({from: '/posts_/$postId/edit'})
380+
> useParams({ from: '/posts_/$postId/edit' })
380381
> ```
381-
>
382+
>
382383
> Now:
384+
>
383385
> ```ts
384-
> useParams({from: '/posts/$postId/edit'})
386+
> useParams({ from: '/posts/$postId/edit' })
385387
> ```
386388
387389
## Excluding Files and Folders from Routes

‎e2e/react-router/basic-file-based/package.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"type": "module",
55
"scripts": {
66
"dev": "vite --port 3000",
7-
"dev:nonnested": "MODE=nonnested VITE_MODE=nonnested vite --port 3000",
7+
"dev:nonnested": "MODE=nonnested VITE_MODE=nonnested vite --port 3000",
88
"dev:e2e": "vite",
99
"build": "vite build && tsc --noEmit",
10-
"build:nonnested": "MODE=nonnested VITE_MODE=nonnested vite build && tsc --noEmit",
10+
"build:nonnested": "MODE=nonnested VITE_MODE=nonnested vite build && tsc --noEmit",
1111
"serve": "vite preview",
12-
"serve:nonnested": "MODE=nonnested VITE_MODE=nonnested vite preview",
12+
"serve:nonnested": "MODE=nonnested VITE_MODE=nonnested vite preview",
1313
"start": "vite",
14-
"start:nonnested": "MODE=nonnested VITE_MODE=nonnested vite",
14+
"start:nonnested": "MODE=nonnested VITE_MODE=nonnested vite",
1515
"test:e2e": "pnpm run test:e2e:nonnested && pnpm run test:e2e:default",
16-
"test:e2e:default": "rm -rf port*.txt; playwright test --project=chromium",
17-
"test:e2e:nonnested": "rm -rf port*.txt; MODE=nonnested playwright test --project=chromium"
16+
"test:e2e:default": "rm -rf port*.txt; playwright test --project=chromium",
17+
"test:e2e:nonnested": "rm -rf port*.txt; MODE=nonnested playwright test --project=chromium"
1818
},
1919
"dependencies": {
2020
"@tanstack/react-router": "workspace:^",

‎e2e/solid-router/basic-file-based/package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"type": "module",
55
"scripts": {
66
"dev": "vite --port 3000",
7-
"dev:nonnested": "MODE=nonnested VITE_MODE=nonnested vite --port 3000",
7+
"dev:nonnested": "MODE=nonnested VITE_MODE=nonnested vite --port 3000",
88
"dev:e2e": "vite",
99
"build": "vite build && tsc --noEmit",
10-
"build:nonnested": "MODE=nonnested VITE_MODE=nonnested vite build && tsc --noEmit",
10+
"build:nonnested": "MODE=nonnested VITE_MODE=nonnested vite build && tsc --noEmit",
1111
"serve": "vite preview",
12-
"serve:nonnested": "MODE=nonnested VITE_MODE=nonnested vite preview",
12+
"serve:nonnested": "MODE=nonnested VITE_MODE=nonnested vite preview",
1313
"start": "vite",
14-
"start:nonnested": "MODE=nonnested VITE_MODE=nonnested vite",
15-
"test:e2e": "pnpm run test:e2e:nonnested && pnpm run test:e2e:default",
16-
"test:e2e:default": "rm -rf port*.txt; playwright test --project=chromium",
17-
"test:e2e:nonnested": "rm -rf port*.txt; MODE=nonnested playwright test --project=chromium"
14+
"start:nonnested": "MODE=nonnested VITE_MODE=nonnested vite",
15+
"test:e2e": "pnpm run test:e2e:nonnested && pnpm run test:e2e:default",
16+
"test:e2e:default": "rm -rf port*.txt; playwright test --project=chromium",
17+
"test:e2e:nonnested": "rm -rf port*.txt; MODE=nonnested playwright test --project=chromium"
1818
},
1919
"dependencies": {
2020
"@tanstack/solid-router": "workspace:^",

‎packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts‎

Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,64 +14,82 @@ import { Route as NestedIndexRouteImport } from './routes/nested/index'
1414
import { Route as NestedChildRouteImport } from './routes/nested/child'
1515

1616
const IndexRoute = IndexRouteImport.update({
17-
id: '/',path: '/',getParentRoute: () => rootRouteImport
18-
}as any)
17+
id: '/',
18+
path: '/',
19+
getParentRoute: () => rootRouteImport,
20+
} as any)
1921
const NestedIndexRoute = NestedIndexRouteImport.update({
20-
id: '/nested/',path: '/nested/',getParentRoute: () => rootRouteImport
21-
}as any)
22+
id: '/nested/',
23+
path: '/nested/',
24+
getParentRoute: () => rootRouteImport,
25+
} as any)
2226
const NestedChildRoute = NestedChildRouteImport.update({
23-
id: '/nested/child',path: '/nested/child',getParentRoute: () => rootRouteImport
24-
}as any)
27+
id: '/nested/child',
28+
path: '/nested/child',
29+
getParentRoute: () => rootRouteImport,
30+
} as any)
2531

2632
export interface FileRoutesByFullPath {
27-
'/': typeof IndexRoute,'/nested/child': typeof NestedChildRoute,'/nested': typeof NestedIndexRoute
33+
'/': typeof IndexRoute
34+
'/nested/child': typeof NestedChildRoute
35+
'/nested': typeof NestedIndexRoute
2836
}
2937
export interface FileRoutesByTo {
30-
'/': typeof IndexRoute,'/nested/child': typeof NestedChildRoute,'/nested': typeof NestedIndexRoute
38+
'/': typeof IndexRoute
39+
'/nested/child': typeof NestedChildRoute
40+
'/nested': typeof NestedIndexRoute
3141
}
3242
export interface FileRoutesById {
33-
'__root__': typeof rootRouteImport,
34-
'/': typeof IndexRoute,'/nested/child': typeof NestedChildRoute,'/nested/': typeof NestedIndexRoute
43+
__root__: typeof rootRouteImport
44+
'/': typeof IndexRoute
45+
'/nested/child': typeof NestedChildRoute
46+
'/nested/': typeof NestedIndexRoute
3547
}
3648
export interface FileRouteTypes {
37-
fileRoutesByFullPath: FileRoutesByFullPath
38-
fullPaths: '/'|'/nested/child'|'/nested'
39-
fileRoutesByTo: FileRoutesByTo
40-
to: '/'|'/nested/child'|'/nested'
41-
id: '__root__'|'/'|'/nested/child'|'/nested/'
42-
fileRoutesById: FileRoutesById
49+
fileRoutesByFullPath: FileRoutesByFullPath
50+
fullPaths: '/' | '/nested/child' | '/nested'
51+
fileRoutesByTo: FileRoutesByTo
52+
to: '/' | '/nested/child' | '/nested'
53+
id: '__root__' | '/' | '/nested/child' | '/nested/'
54+
fileRoutesById: FileRoutesById
4355
}
4456
export interface RootRouteChildren {
45-
IndexRoute: typeof IndexRoute,NestedChildRoute: typeof NestedChildRoute,NestedIndexRoute: typeof NestedIndexRoute
57+
IndexRoute: typeof IndexRoute
58+
NestedChildRoute: typeof NestedChildRoute
59+
NestedIndexRoute: typeof NestedIndexRoute
4660
}
4761

4862
declare module '@tanstack/react-router' {
4963
interface FileRoutesByPath {
5064
'/': {
51-
id: '/'
52-
path: '/'
53-
fullPath: '/'
54-
preLoaderRoute: typeof IndexRouteImport
55-
parentRoute: typeof rootRouteImport
56-
}
57-
'/nested/': {
58-
id: '/nested/'
59-
path: '/nested'
60-
fullPath: '/nested'
61-
preLoaderRoute: typeof NestedIndexRouteImport
62-
parentRoute: typeof rootRouteImport
63-
}
64-
'/nested/child': {
65-
id: '/nested/child'
66-
path: '/nested/child'
67-
fullPath: '/nested/child'
68-
preLoaderRoute: typeof NestedChildRouteImport
69-
parentRoute: typeof rootRouteImport
70-
}
65+
id: '/'
66+
path: '/'
67+
fullPath: '/'
68+
preLoaderRoute: typeof IndexRouteImport
69+
parentRoute: typeof rootRouteImport
70+
}
71+
'/nested/': {
72+
id: '/nested/'
73+
path: '/nested'
74+
fullPath: '/nested'
75+
preLoaderRoute: typeof NestedIndexRouteImport
76+
parentRoute: typeof rootRouteImport
77+
}
78+
'/nested/child': {
79+
id: '/nested/child'
80+
path: '/nested/child'
81+
fullPath: '/nested/child'
82+
preLoaderRoute: typeof NestedChildRouteImport
83+
parentRoute: typeof rootRouteImport
84+
}
7185
}
7286
}
7387

7488
const rootRouteChildren: RootRouteChildren = {
75-
IndexRoute: IndexRoute,NestedChildRoute: NestedChildRoute,NestedIndexRoute: NestedIndexRoute
89+
IndexRoute: IndexRoute,
90+
NestedChildRoute: NestedChildRoute,
91+
NestedIndexRoute: NestedIndexRoute,
7692
}
77-
export const routeTree = rootRouteImport._addFileChildren(rootRouteChildren)._addFileTypes<FileRouteTypes>()
93+
export const routeTree = rootRouteImport
94+
._addFileChildren(rootRouteChildren)
95+
._addFileTypes<FileRouteTypes>()

0 commit comments

Comments
 (0)