HostingSiteManager class

Manages Firebase Hosting sites and firebase target:apply mappings.

The orchestrator uses this to:

  1. Verify the release site exists. Firebase auto-creates a site called <projectId> when the project is created, so this is almost always a no-op verify, but we still check because firebase deploy --only hosting:release will fail loudly if the target points at a missing site.
  2. Create the beta site <projectId>-beta. This is not auto- created and is the most common reason a fresh project's beta hosting deploy fails.
  3. Apply target mappings into the project's .firebaserc so firebase deploy --only hosting:release / hosting:beta works.

All operations are idempotent: re-running has no effect when the resource already exists.

Template-agnostic: the same site/target wiring is used by Flutter web, Jaspr client, and Jaspr static templates because the hosting public path is set in firebase.json per-template (see ConfigGenerator._hostingPublicPath at oracular/lib/services/config_generator.dart:77-82).

Constructors

HostingSiteManager(String projectId, {required String workingDirectory, Map<String, String>? environment, ProcessRunner? runner})

Properties

betaSiteId String
Computed beta site id: <projectId>-beta.
no setter
environment Map<String, String>?
Optional environment vars passed on every firebase invocation. Critical: without this, firebase-tools inherits only the parent shell's env and falls back to ~/.config/configstore/firebase-tools.json for auth — which fails with "Failed to authenticate, have you run firebase login?" the moment the user logs out (or never logged in in the first place).
final
hashCode int
The hash code for this object.
no setterinherited
projectId String
Firebase project ID. Used as the release site id and as the prefix for the beta site (<projectId>-beta).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
workingDirectory String
Working directory for any firebase invocation that needs to touch .firebaserc / firebase.json (i.e. applyTargets).
final

Methods

applyTargets({String releaseTarget = 'release', String betaTarget = 'beta'}) Future<ApplyTargetsResult>
Apply firebase target:apply hosting release <projectId> and firebase target:apply hosting beta <projectId>-beta so firebase deploy --only hosting:release|hosting:beta works.
ensureBetaSite() Future<SiteEnsureResult>
Ensure the beta hosting site <projectId>-beta exists.
ensureReleaseSite() Future<SiteEnsureResult>
Ensure the release hosting site exists.
listSites() Future<List<String>?>
List the hosting site ids for this project. Returns null when the CLI invocation failed (auth / network / not-found etc) so callers can fall back to the optimistic create flow.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited