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