File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,9 +85,7 @@ export function genRemoteConfig(remoteConfigs?: RemoteConfig[]) {
8585 const variants = remoteConfigs ?. [ 0 ] ?. variants ;
8686 if ( ! variants ?. length ) return ;
8787 return JSONToType (
88- remoteConfigs ! [ 0 ] . variants ?. map ( ( { variant : { payload } } ) => ( {
89- config : { payload } ,
90- } ) ) ,
88+ remoteConfigs ! [ 0 ] . variants ?. map ( ( { variant : { payload } } ) => payload ) ,
9189 ) ;
9290}
9391
@@ -96,7 +94,7 @@ export function genTypes(features: Feature[], format: GenFormat = "react") {
9694 features . forEach ( ( { key, name, remoteConfigs } ) => {
9795 const definition = genRemoteConfig ( remoteConfigs ) ;
9896 if ( ! definition ) return ;
99- const configName = `${ pascalCase ( name ) } Config ` ;
97+ const configName = `${ pascalCase ( name ) } ConfigPayload ` ;
10098 configDefs . set ( key , { name : configName , definition } ) ;
10199 } ) ;
102100
@@ -112,7 +110,7 @@ ${features
112110 . map ( ( { key } ) => {
113111 const config = configDefs . get ( key ) ;
114112 return indentLines (
115- `"${ key } ": ${ config ?. definition ? config . name : "boolean" } ;` ,
113+ `"${ key } ": ${ config ?. definition ? `{ config: { payload: ${ config . name } } }` : "boolean" } ;` ,
116114 4 ,
117115 ) ;
118116 } )
You can’t perform that action at this time.
0 commit comments