`firebase target:apply firestore` does not currently work
firebase target:apply firestore does not currently work.
However firebase target:remove firestore does currently work.
This is a request to get firebase target:apply firestore working.
At the moment we have to add firestore targets to .firebaserc manually.
This is a script we are using as a workaround, for anyone having the same issue:
import { writeFileSync, readFileSync } from "node:fs"
import { join } from "node:path"
const FB_PROJECT = ""
const DATABASE_ID = ""
const TARGET = ""
const firebasercPath = join(process.cwd(), ".firebaserc")
const firebaserc = JSON.parse(readFileSync(firebasercPath, "utf8"))
firebaserc.targets[FB_PROJECT].firestore[TARGET] ||= []
firebaserc.targets[FB_PROJECT].firestore[TARGET].push(DATABASE_ID)
writeFileSync(firebasercPath, JSON.stringify(firebaserc, null, 2), "utf8")
@bigjimhere thanks for that ! I was successfully using your workaround on 14.15.1. However the workaround seems to break starting with 14.18.0 😞. I realized this when using 14.26.0 and backtracked until I found where thing stopped working. On versions >= 14.18.0 , the targets defined in .firebaserc no longer seem to get used and the cli keeps trying to use/create a default database (which doesn't exist in my case).
@joehan Any thoughts on this? Any other suggested workarounds for this on newer (>= 14.18.0) releases?