publish/scripts/installer.js
/**
 * Prompt the user through the configurable Firebase add-on services
 */
Prompt the user through the configurable Firebase add-on services
Prompt the user through the configurable Firebase add - on services
function promptQuestions() {
  prompt.get([{
    name: 'firestore',
    description: 'Are you using Firestore? (y/n)',
    default: 'n'
  }, {
    name: 'realtimedb',
    description: 'Are you using Realtime DB? (y/n)',
    default: 'n'
  }, {
    name: 'authentication',
    description: 'Are you using Firebase Authentication (pretty likely if you use Firestore or Realtime DB)? (y/n)',
    default: 'y'
  }, {
    name: 'remote_config',
    description: 'Are you using Firebase RemoteConfig? (y/n)',
    default: 'n'
  }, {
    name: 'performance_monitoring',
    description: 'Are you using Performance Monitoring? (y/n)',
    default: 'n'
  }, {
    name: 'messaging',
    description: 'Are you using Firebase Messaging? (y/n)',
    default: 'n'
  }, {
    name: 'crashlytics',
    description: 'Are you using Firebase Crashlytics? (y/n)',
    default: 'n'
  }, {
    name: 'crash_reporting',
    description: 'Are you using Firebase Crash Reporting? (answer "n" if you want to use Crashlytics instead) (y/n)',
    default: 'n'
  }, {
    name: 'storage',
    description: 'Are you using Firebase Storage? (y/n)',
    default: 'n'
  }, {
    name: 'functions',
    description: 'Are you using Firebase Cloud Functions? (y/n)',
    default: 'n'
  }, {
    name: 'facebook_auth',
    description: 'Are you using Firebase Facebook Authentication? (y/n)',
    default: 'n'
  }, {
    name: 'google_auth',
    description: 'Are you using Firebase Google Authentication? (y/n)',
    default: 'n'
  }, {
    name: 'admob',
    description: 'Are you using AdMob? (y/n)',
    default: 'n'
  }, {
    name: 'invites',
    description: 'Are you using Firebase Invites? (y/n)',
    default: 'n'
  }, {
    name: 'dynamic_links',
    description: 'Are you using Firebase Dynamic Links? (y/n)',
    default: 'n'
  }, {
    name: 'ml_kit',
    description: 'Are you using ML Kit? (y/n)',
    default: 'n'
  }], function (err, result) {
    if (err) {
      return console.log(err);
    }
    if (!isSelected(result.ml_kit)) {
      mergeConfig(result);
      promptQuestionsResult(result);
      askSaveConfigPrompt();
    } else {
      prompt.get([{
        name: 'ml_kit_text_recognition',
        description: 'With Ml Kit, do you want to recognize text? (y/n)',
        default: 'n'
      }, {
        name: 'ml_kit_barcode_scanning',
        description: 'With Ml Kit, do you want to scan barcodes? (y/n)',
        default: 'n'
      }, {
        name: 'ml_kit_face_detection',
        description: 'With Ml Kit, do you want to detect faces? (y/n)',
        default: 'n'
      }, {
        name: 'ml_kit_image_labeling',
        description: 'With Ml Kit, do you want to label images? (y/n)',
        default: 'n'
      }, {
        name: 'ml_kit_custom_model',
        description: 'With Ml Kit, do you want to use a custom TensorFlow Lite model? (y/n)',
        default: 'n'
      }], function (mlkitErr, mlkitResult) {
        if (mlkitErr) {
          return console.log(mlkitErr);
        }
        for (var attrname in mlkitResult) {
          result[attrname] = mlkitResult[attrname];
        }
        mergeConfig(result);
        promptQuestionsResult(result);
        askSaveConfigPrompt();
      });
    }
  });
}
function promptQuestions ( ) { prompt . get ( [ { name : 'firestore' , description : 'Are you using Firestore? (y/n)' , default : 'n' } , { name : 'realtimedb' , description : 'Are you using Realtime DB? (y/n)' , default : 'n' } , { name : 'authentication' , description : 'Are you using Firebase Authentication (pretty likely if you use Firestore or Realtime DB)? (y/n)' , default : 'y' } , { name : 'remote_config' , description : 'Are you using Firebase RemoteConfig? (y/n)' , default : 'n' } , { name : 'performance_monitoring' , description : 'Are you using Performance Monitoring? (y/n)' , default : 'n' } , { name : 'messaging' , description : 'Are you using Firebase Messaging? (y/n)' , default : 'n' } , { name : 'crashlytics' , description : 'Are you using Firebase Crashlytics? (y/n)' , default : 'n' } , { name : 'crash_reporting' , description : 'Are you using Firebase Crash Reporting? (answer "n" if you want to use Crashlytics instead) (y/n)' , default : 'n' } , { name : 'storage' , description : 'Are you using Firebase Storage? (y/n)' , default : 'n' } , { name : 'functions' , description : 'Are you using Firebase Cloud Functions? (y/n)' , default : 'n' } , { name : 'facebook_auth' , description : 'Are you using Firebase Facebook Authentication? (y/n)' , default : 'n' } , { name : 'google_auth' , description : 'Are you using Firebase Google Authentication? (y/n)' , default : 'n' } , { name : 'admob' , description : 'Are you using AdMob? (y/n)' , default : 'n' } , { name : 'invites' , description : 'Are you using Firebase Invites? (y/n)' , default : 'n' } , { name : 'dynamic_links' , description : 'Are you using Firebase Dynamic Links? (y/n)' , default : 'n' } , { name : 'ml_kit' , description : 'Are you using ML Kit? (y/n)' , default : 'n' } ] , function ( err , result ) { if ( err ) { return console . log ( err ) ; } if ( ! isSelected ( result . ml_kit ) ) { mergeConfig ( result ) ; promptQuestionsResult ( result ) ; askSaveConfigPrompt ( ) ; } else { prompt . get ( [ { name : 'ml_kit_text_recognition' , description : 'With Ml Kit, do you want to recognize text? (y/n)' , default : 'n' } , { name : 'ml_kit_barcode_scanning' , description : 'With Ml Kit, do you want to scan barcodes? (y/n)' , default : 'n' } , { name : 'ml_kit_face_detection' , description : 'With Ml Kit, do you want to detect faces? (y/n)' , default : 'n' } , { name : 'ml_kit_image_labeling' , description : 'With Ml Kit, do you want to label images? (y/n)' , default : 'n' } , { name : 'ml_kit_custom_model' , description : 'With Ml Kit, do you want to use a custom TensorFlow Lite model? (y/n)' , default : 'n' } ] , function ( mlkitErr , mlkitResult ) { if ( mlkitErr ) { return console . log ( mlkitErr ) ; } for ( var attrname in mlkitResult ) { result [ attrname ] = mlkitResult [ attrname ] ; } mergeConfig ( result ) ; promptQuestionsResult ( result ) ; askSaveConfigPrompt ( ) ; } ) ; } } ) ; }
Prompt the user through the configurable Firebase add-on services
Prompt the user through the configurable Firebase add - on services