Skip to content

refactor(start): update app directory handling in defineConfig function - #2617

Merged
SeanCassiere merged 4 commits into
TanStack:mainfrom
logan-anderson:feature/make-appDirectory-work
Oct 24, 2024
Merged

refactor(start): update app directory handling in defineConfig function#2617
SeanCassiere merged 4 commits into
TanStack:mainfrom
logan-anderson:feature/make-appDirectory-work

Conversation

@logan-anderson

Copy link
Copy Markdown
Contributor

Fixes #2600

How to test In router/examples/react/start-basic

  • Move app into src/app
  • update app.config.ts to look like
import { defineConfig } from '@tanstack/start/config'
import tsConfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
  tsr: {
    appDirectory: './src/app',
  },
  vite: {
    plugins: [
      tsConfigPaths({
        projects: ['./tsconfig.json'],
      }),
    ],
  },
})
  • update tsconfig.json
{
...
    "paths": {
-      "~/*": ["./app/*"]
+      "~/*": ["./src/app/*"]
    },

}
  • run the app and see that everything works

@schiller-manuel

Copy link
Copy Markdown
Collaborator

Thanks for taking this on!
Can you please modify one of the e2e/start tests to use this custom config so we actually test it?

@nx-cloud

nx-cloud Bot commented Oct 22, 2024

Copy link
Copy Markdown
Contributor

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 63b81b1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@pkg-pr-new

pkg-pr-new Bot commented Oct 22, 2024

Copy link
Copy Markdown

Open in Stackblitz

More templates

@tanstack/create-router

pnpm add https://pkg.pr.new/@tanstack/create-router@2617

@tanstack/history

pnpm add https://pkg.pr.new/@tanstack/history@2617

@tanstack/react-cross-context

pnpm add https://pkg.pr.new/@tanstack/react-cross-context@2617

@tanstack/eslint-plugin-router

pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-router@2617

@tanstack/react-router

pnpm add https://pkg.pr.new/@tanstack/react-router@2617

@tanstack/react-router-with-query

pnpm add https://pkg.pr.new/@tanstack/react-router-with-query@2617

@tanstack/router-arktype-adapter

pnpm add https://pkg.pr.new/@tanstack/router-arktype-adapter@2617

@tanstack/router-cli

pnpm add https://pkg.pr.new/@tanstack/router-cli@2617

@tanstack/router-devtools

pnpm add https://pkg.pr.new/@tanstack/router-devtools@2617

@tanstack/router-generator

pnpm add https://pkg.pr.new/@tanstack/router-generator@2617

@tanstack/router-plugin

pnpm add https://pkg.pr.new/@tanstack/router-plugin@2617

@tanstack/router-valibot-adapter

pnpm add https://pkg.pr.new/@tanstack/router-valibot-adapter@2617

@tanstack/router-zod-adapter

pnpm add https://pkg.pr.new/@tanstack/router-zod-adapter@2617

@tanstack/router-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/router-vite-plugin@2617

@tanstack/start-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/start-vite-plugin@2617

@tanstack/virtual-file-routes

pnpm add https://pkg.pr.new/@tanstack/virtual-file-routes@2617

@tanstack/start

pnpm add https://pkg.pr.new/@tanstack/start@2617

commit: 63b81b1

@SeanCassiere SeanCassiere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Edit: Perhaps, instead of changing one of the existing examples, instead, just create a simple new e2e example with a couple of pages which use a server function.

@SeanCassiere SeanCassiere changed the title refactor(config): update app directory handling in defineConfig function refactor(start): update app directory handling in defineConfig function Oct 23, 2024
@logan-anderson

Copy link
Copy Markdown
Contributor Author

Added a new test project as per @SeanCassiere suggestion

@SeanCassiere
SeanCassiere merged commit caae48c into TanStack:main Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not customize app folder

3 participants