11import type {
22 ClientEntrypoint ,
3+ QraftClientFactoryEntrypointConfig ,
34 QraftPrecreatedClientEntrypointConfig ,
45 QraftTreeShakeOptions ,
56 ServicesTarget ,
@@ -12,34 +13,40 @@ export function normalizeEntrypoints(
1213) : ClientEntrypoint [ ] {
1314 return ( options . entrypoints ?? [ ] ) . map ( ( entrypoint ) => {
1415 if ( entrypoint . kind === 'clientFactory' ) {
15- const services = normalizeServices (
16- entrypoint . factory . moduleSpecifier ,
17- entrypoint . services
18- ) ;
19- const reactContext = normalizeReactContext (
20- entrypoint . factory . moduleSpecifier ,
21- entrypoint . reactContext
22- ) ;
23-
24- return {
25- kind : 'generatedFactory' ,
26- key : composeGeneratedFactoryEntrypointKey (
27- entrypoint . factory . exportName ,
28- entrypoint . factory . moduleSpecifier ,
29- services . moduleSpecifierBase ,
30- services . directory ,
31- reactContext ?. moduleSpecifier ?? ''
32- ) ,
33- factory : entrypoint . factory ,
34- services,
35- reactContext,
36- } ;
16+ return normalizeClientFactoryEntrypoint ( entrypoint ) ;
3717 }
3818
3919 return normalizePrecreatedEntrypoint ( entrypoint ) ;
4020 } ) ;
4121}
4222
23+ function normalizeClientFactoryEntrypoint (
24+ config : QraftClientFactoryEntrypointConfig
25+ ) : ClientEntrypoint {
26+ const services = normalizeServices (
27+ config . factory . moduleSpecifier ,
28+ config . services
29+ ) ;
30+ const reactContext = normalizeReactContext (
31+ config . factory . moduleSpecifier ,
32+ config . reactContext
33+ ) ;
34+
35+ return {
36+ kind : 'generatedFactory' ,
37+ key : composeGeneratedFactoryEntrypointKey (
38+ config . factory . exportName ,
39+ config . factory . moduleSpecifier ,
40+ services . moduleSpecifierBase ,
41+ services . directory ,
42+ reactContext ?. moduleSpecifier ?? ''
43+ ) ,
44+ factory : config . factory ,
45+ services,
46+ reactContext,
47+ } ;
48+ }
49+
4350function normalizePrecreatedEntrypoint (
4451 config : QraftPrecreatedClientEntrypointConfig
4552) : ClientEntrypoint {
0 commit comments