Skip to content

Commit

Permalink
chore: move start e2e and example projects from ./app to ./src (#3712)
Browse files Browse the repository at this point in the history
Using the below setting, the examples and e2e projects opt into the
future behavior of using `./src` as the app directory, rather than
'./app':

```ts
tsr: {
  appDirectory: 'src',
},
```

The `./src` directory is typically used for pure-TS Router projects, as
well as CRA. Thus this reduces the churn for a TS Router SPA to opt into
server features with TS Start.
  • Loading branch information
birkskyum authored Mar 9, 2025
1 parent a73bf99 commit f616ba9
Show file tree
Hide file tree
Showing 693 changed files with 199 additions and 120 deletions.
3 changes: 3 additions & 0 deletions e2e/react-start/basic-auth/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// app/services/session.server.ts
// src/services/session.server.ts
import { useSession } from '@tanstack/react-start/server'
import type { User } from '@prisma/client'

Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic-auth/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/basic-auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/basic-react-query/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic-react-query/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/basic-react-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/basic-rsc/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/react-start/basic-rsc/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/basic-rsc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/basic-tsr-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/app/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/basic/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/react-start/basic/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/basic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/clerk-basic/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/react-start/clerk-basic/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/clerk-basic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/scroll-restoration/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/scroll-restoration/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/scroll-restoration/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/server-functions/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
2 changes: 1 addition & 1 deletion e2e/react-start/server-functions/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
4 changes: 2 additions & 2 deletions e2e/react-start/server-functions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"target": "ES2022",
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": "",
"baseUrl": ".",
"paths": {
"~/*": ["app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/react-start/website/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/react-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/react-start/website/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/react-start/website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/solid-start/basic-tsr-config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/app/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/solid-start/basic/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/solid-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion e2e/solid-start/basic/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/solid-start/basic/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/solid-start/scroll-restoration/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/solid-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
2 changes: 1 addition & 1 deletion e2e/solid-start/scroll-restoration/tailwind.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./app/**/*.{js,jsx,ts,tsx}'],
content: ['./src/**/*.{js,jsx,ts,tsx}'],
}
2 changes: 1 addition & 1 deletion e2e/solid-start/scroll-restoration/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"paths": {
"~/*": ["./app/*"]
"~/*": ["./src/*"]
},
"noEmit": true
}
Expand Down
3 changes: 3 additions & 0 deletions e2e/solid-start/server-functions/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { defineConfig } from '@tanstack/solid-start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
tsr: {
appDirectory: 'src',
},
vite: {
plugins: [
tsConfigPaths({
Expand Down
Loading

0 comments on commit f616ba9

Please sign in to comment.