@@ -641,24 +641,16 @@ async function updatePackageJson(nonInteractive: boolean, projectDir: string): P
641
641
}
642
642
643
643
function renderConfig ( pluginNames : string [ ] , template : string , enableTelemetry : boolean ) : string {
644
- const imports = pluginNames . map ( ( pluginName ) =>
645
- generateImportStatement ( pluginToInfo [ pluginName ] . imports , pluginName ) ,
646
- ) ;
647
- if ( enableTelemetry ) {
648
- imports . push ( generateImportStatement ( "enableFirebaseTelemetry" , "@genkit-ai/firebase" ) ) ;
649
- }
650
- const telemetryBlock = enableTelemetry
651
- ? "\n// Collect telemetry data to enable production monitoring.\n" +
652
- "// See https://firebase.google.com/docs/genkit/observability/telemetry-collection.\n" +
653
- "enableFirebaseTelemetry();\n"
654
- : "" ;
644
+ const imports = pluginNames
645
+ . map ( ( pluginName ) => generateImportStatement ( pluginToInfo [ pluginName ] . imports , pluginName ) )
646
+ . join ( "\n" ) ;
655
647
const plugins =
656
648
pluginNames . map ( ( pluginName ) => ` ${ pluginToInfo [ pluginName ] . init } ,` ) . join ( "\n" ) ||
657
649
" /* Add your plugins here. */" ;
658
650
return template
659
- . replace ( "$GENKIT_CONFIG_IMPORTS" , imports . join ( "\n" ) )
651
+ . replace ( "$GENKIT_CONFIG_IMPORTS" , imports )
660
652
. replace ( "$GENKIT_CONFIG_PLUGINS" , plugins )
661
- . replace ( "$GENKIT_ENABLE_TELEMETRY" , telemetryBlock ) ;
653
+ . replace ( "$GENKIT_ENABLE_TELEMETRY" , enableTelemetry . toString ( ) ) ;
662
654
}
663
655
664
656
function generateImportStatement ( imports : string , name : string ) : string {
0 commit comments