firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

feat: Add global dataDir for emulator persistence

Open christhompsongoogle opened this issue 5 months ago • 0 comments

Implements a global emulators.dataDir setting in firebase.json to allow users to easily persist and re-load emulator data across sessions.

Key changes:

  • Added emulators.dataDir to firebase.json schema.
  • Updated firebase init emulators to prompt for dataDir configuration.
  • Added --ephemeral flag to emulators:start and emulators:exec to ignore dataDir for a single run.
  • Emulators now automatically import data from dataDir on startup if it exists and contains valid export metadata.
  • Emulators now automatically export data to dataDir on clean shutdown if dataDir is configured (and not overridden by --export-on-exit flag).
  • Handled deprecation of emulators.dataconnect.dataDir, preferring the global emulators.dataDir with warnings.
  • Added unit tests for the new functionality.

Description

Scenarios Tested

Sample Commands

christhompsongoogle avatar Jun 24 '25 23:06 christhompsongoogle