diff --git a/packages/react-router-dev/__tests__/cli-test.ts b/packages/react-router-dev/__tests__/cli-test.ts index 97a6d6ab8b..59c89726b0 100644 --- a/packages/react-router-dev/__tests__/cli-test.ts +++ b/packages/react-router-dev/__tests__/cli-test.ts @@ -121,7 +121,6 @@ describe("remix CLI", () => { --config, -c Use specified Vite config file (string) --no-typescript Generate plain JavaScript files \`typegen\` Options: - --config, -c Use specified Vite config file (string) --watch Automatically regenerate types whenever route config (\`routes.ts\`) or route modules change Build your project: @@ -150,8 +149,7 @@ describe("remix CLI", () => { Generate types for route modules: $ react-router typegen - $ react-router typegen --watch - $ react-router typegen --config vite.react-router.config.ts" + $ react-router typegen --watch" `); }); }); diff --git a/packages/react-router-dev/cli/commands.ts b/packages/react-router-dev/cli/commands.ts index e2a86935c2..7d0f4f0c6e 100644 --- a/packages/react-router-dev/cli/commands.ts +++ b/packages/react-router-dev/cli/commands.ts @@ -197,16 +197,13 @@ async function createClientEntry( return contents; } -export async function typegen( - root: string, - flags: { watch: boolean; config?: string } -) { +export async function typegen(root: string, flags: { watch: boolean }) { root ??= process.cwd(); if (flags.watch) { - await Typegen.watch(root, flags.config); + await Typegen.watch(root); await new Promise(() => {}); // keep alive return; } - await Typegen.run(root, flags.config); + await Typegen.run(root); } diff --git a/packages/react-router-dev/cli/run.ts b/packages/react-router-dev/cli/run.ts index e3be415400..588fe50af3 100644 --- a/packages/react-router-dev/cli/run.ts +++ b/packages/react-router-dev/cli/run.ts @@ -46,7 +46,6 @@ ${colors.blueBright("react-router")} --config, -c Use specified Vite config file (string) --no-typescript Generate plain JavaScript files \`typegen\` Options: - --config, -c Use specified Vite config file (string) --watch Automatically regenerate types whenever route config (\`routes.ts\`) or route modules change ${colors.underline("Build your project")}: @@ -76,7 +75,6 @@ ${colors.blueBright("react-router")} $ react-router typegen $ react-router typegen --watch - $ react-router typegen --config vite.react-router.config.ts `; /** diff --git a/packages/react-router-dev/package.json b/packages/react-router-dev/package.json index 052fc9ada9..dff8981c86 100644 --- a/packages/react-router-dev/package.json +++ b/packages/react-router-dev/package.json @@ -35,7 +35,8 @@ "react-router": "bin.js" }, "scripts": { - "build": "wireit" + "build": "wireit", + "typecheck": "tsc" }, "wireit": { "build": { diff --git a/packages/react-router-dev/tsconfig.json b/packages/react-router-dev/tsconfig.json index 619e776b2a..778b03c817 100644 --- a/packages/react-router-dev/tsconfig.json +++ b/packages/react-router-dev/tsconfig.json @@ -6,14 +6,16 @@ "target": "ES2022", "module": "ES2022", "moduleResolution": "Bundler", - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, + "strict": true, "jsx": "react", + "skipLibCheck": true, - "declaration": true, - "emitDeclarationOnly": true, + + "outDir": "dist", "rootDir": ".", - "outDir": "./dist" + "noEmit": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true } } diff --git a/packages/react-router-dev/vite/styles.ts b/packages/react-router-dev/vite/styles.ts index 1e16372135..530ab528cb 100644 --- a/packages/react-router-dev/vite/styles.ts +++ b/packages/react-router-dev/vite/styles.ts @@ -3,7 +3,7 @@ import type { ServerBuild } from "react-router"; import { matchRoutes } from "react-router"; import type { ModuleNode, ViteDevServer } from "vite"; -import type { ResolvedReactRouterConfig } from "./config"; +import type { ResolvedReactRouterConfig } from "../config/config"; import { resolveFileUrl } from "./resolve-file-url"; type ServerRouteManifest = ServerBuild["routes"];