@@ -634,6 +634,40 @@ describe('normalizeOptions', () => {
634634 expect ( options ?. chosenAddOns . map ( ( addOn ) => addOn . id ) ) . toEqual ( [ 'biome' ] )
635635 } )
636636
637+ it . each ( [
638+ [ 'file-router' , false ] ,
639+ [ 'typescript' , true ] ,
640+ [ 'tsx' , true ] ,
641+ ] ) (
642+ 'normalizes Rsbuild with the legacy %s template alias' ,
643+ async ( template , routerOnly ) => {
644+ __testRegisterFramework ( {
645+ id : 'react' ,
646+ name : 'React' ,
647+ bundlers : [
648+ { id : 'vite' , name : 'Vite' , description : 'Build with Vite' } ,
649+ {
650+ id : 'rsbuild' ,
651+ name : 'Rsbuild' ,
652+ description : 'Build with Rsbuild' ,
653+ } ,
654+ ] ,
655+ defaultBundler : 'vite' ,
656+ getAddOns : ( ) => [ ] ,
657+ } )
658+
659+ const options = await normalizeOptions ( {
660+ projectName : 'test' ,
661+ framework : 'react' ,
662+ bundler : 'rsbuild' ,
663+ template,
664+ } )
665+
666+ expect ( options ?. bundler ) . toBe ( 'rsbuild' )
667+ expect ( options ?. routerOnly ) . toBe ( routerOnly )
668+ } ,
669+ )
670+
637671 it ( 'rejects unsupported Rsbuild add-ons during normalization' , async ( ) => {
638672 __testRegisterFramework ( {
639673 id : 'react' ,
@@ -816,6 +850,19 @@ describe('validateLegacyCreateFlags', () => {
816850 expect ( result . error ) . toBeUndefined ( )
817851 } )
818852
853+ it . each ( [ 'file-router' , 'typescript' , 'tsx' ] ) (
854+ 'allows Rsbuild with the legacy %s template alias' ,
855+ ( template ) => {
856+ const result = validateLegacyCreateFlags ( {
857+ bundler : 'rsbuild' ,
858+ template,
859+ } )
860+
861+ expect ( result . error ) . toBeUndefined ( )
862+ expect ( result . warnings [ 0 ] ) . toContain ( '--template' )
863+ } ,
864+ )
865+
819866 it . each ( [
820867 [ { starter : 'ecommerce' } , '--starter' ] ,
821868 [ { template : 'ecommerce' } , '--template' ] ,
0 commit comments