@@ -213,7 +213,7 @@ const helpText = dedent`
213213 --json Print the routes as JSON
214214 \`reveal\` Options:
215215 --config, -c Use specified Vite config file (string)
216- --no-typescript Generate plain JavaScript files
216+ --no-typescript Generate plain JavaScript files (deprecated; will be removed in v9)
217217 \`typegen\` Options:
218218 --watch Automatically regenerate types whenever route config (\`routes.ts\`) or route modules change
219219
@@ -461,10 +461,46 @@ test.describe("cli", () => {
461461 expect ( existsSync ( entryServerFile ) ) . toBeFalsy ( ) ;
462462 expect ( existsSync ( entryClientFile ) ) . toBeFalsy ( ) ;
463463
464- run ( [ "reveal" , "--no-typescript" ] , { cwd } ) ;
464+ let { stderr, status } = run ( [ "reveal" , "--no-typescript" ] , {
465+ cwd,
466+ env : {
467+ ...process . env ,
468+ FORCE_COLOR : undefined ,
469+ NO_COLOR : "1" ,
470+ } ,
471+ } ) ;
465472
466473 expect ( existsSync ( entryServerFile ) ) . toBeTruthy ( ) ;
467474 expect ( existsSync ( entryClientFile ) ) . toBeTruthy ( ) ;
475+ expect ( readFileSync ( entryServerFile , "utf-8" ) ) . toContain (
476+ "renderToPipeableStream" ,
477+ ) ;
478+ expect ( readFileSync ( entryServerFile , "utf-8" ) ) . not . toContain (
479+ "import type" ,
480+ ) ;
481+ expect ( stderr . toString ( ) . trim ( ) ) . toBe (
482+ "The --no-typescript flag is deprecated and will be removed in React Router v9." ,
483+ ) ;
484+ expect ( status ) . toBe ( 0 ) ;
485+ expect ( build ( { cwd } ) . status ) . toBe ( 0 ) ;
486+ } ) ;
487+
488+ test ( "generates a web JavaScript server entry for non-Node projects" , async ( ) => {
489+ const cwd = await createProject ( ) ;
490+ let packageJsonPath = path . join ( cwd , "package.json" ) ;
491+ let pkg = JSON . parse ( readFileSync ( packageJsonPath , "utf-8" ) ) ;
492+ delete pkg . dependencies [ "@react-router/express" ] ;
493+ delete pkg . dependencies [ "@react-router/node" ] ;
494+ delete pkg . dependencies [ "@react-router/serve" ] ;
495+ writeFileSync ( packageJsonPath , JSON . stringify ( pkg , null , 2 ) ) ;
496+
497+ let entryServerFile = path . join ( cwd , "app" , "entry.server.jsx" ) ;
498+
499+ run ( [ "reveal" , "entry.server" , "--no-typescript" ] , { cwd } ) ;
500+
501+ expect ( readFileSync ( entryServerFile , "utf-8" ) ) . toContain (
502+ "renderToReadableStream" ,
503+ ) ;
468504 } ) ;
469505 } ) ;
470506
0 commit comments