Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/emulator/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export class Constants {
// Environment variable to discover the tasks emulator.
static CLOUD_TASKS_EMULATOR_HOST = "CLOUD_TASKS_EMULATOR_HOST";

static NEXT_PUBLIC_PREFIX = "NEXT_PUBLIC_";

// Environment variable to discover the Emulator HUB
static FIREBASE_EMULATOR_HUB = "FIREBASE_EMULATOR_HUB";
static FIREBASE_GA_SESSION = "FIREBASE_GA_SESSION";
Expand Down
12 changes: 12 additions & 0 deletions src/emulator/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,45 @@
case Emulators.FIRESTORE:
env[Constants.FIRESTORE_EMULATOR_HOST] = host;
env[Constants.FIRESTORE_EMULATOR_ENV_ALT] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIRESTORE_EMULATOR_HOST] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIRESTORE_EMULATOR_ENV_ALT] = host;
break;
case Emulators.DATABASE:
env[Constants.FIREBASE_DATABASE_EMULATOR_HOST] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIREBASE_DATABASE_EMULATOR_HOST] = host;
break;
case Emulators.STORAGE:
env[Constants.FIREBASE_STORAGE_EMULATOR_HOST] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIREBASE_STORAGE_EMULATOR_HOST] = host;
// The protocol is required for the Google Cloud Storage Node.js Client SDK.
env[Constants.CLOUD_STORAGE_EMULATOR_HOST] = `http://${host}`;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.CLOUD_STORAGE_EMULATOR_HOST] = `http://${host}`;

Check failure on line 35 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 35 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`

Check failure on line 35 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Insert `⏎·········`

Check failure on line 35 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 35 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`
break;
case Emulators.AUTH:
env[Constants.FIREBASE_AUTH_EMULATOR_HOST] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIREBASE_AUTH_EMULATOR_HOST] = host;
break;
case Emulators.HUB:
env[Constants.FIREBASE_EMULATOR_HUB] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIREBASE_EMULATOR_HUB] = host;
break;
case Emulators.PUBSUB:
env[Constants.PUBSUB_EMULATOR_HOST] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.PUBSUB_EMULATOR_HOST] = host;
break;
case Emulators.EVENTARC:
env[Constants.CLOUD_EVENTARC_EMULATOR_HOST] = `http://${host}`;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.CLOUD_EVENTARC_EMULATOR_HOST] = `http://${host}`;

Check failure on line 51 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 51 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`

Check failure on line 51 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Insert `⏎·········`

Check failure on line 51 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 51 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`
break;
case Emulators.TASKS:
env[Constants.CLOUD_TASKS_EMULATOR_HOST] = host;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.CLOUD_TASKS_EMULATOR_HOST] = host;
break;
case Emulators.DATACONNECT:
env[Constants.FIREBASE_DATACONNECT_EMULATOR_HOST] = `http://${host}`;
env[Constants.FIREBASE_DATACONNECT_ENV_ALT] = `http://${host}`;
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIREBASE_DATACONNECT_EMULATOR_HOST] = `http://${host}`;

Check failure on line 60 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 60 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`

Check failure on line 60 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Insert `⏎·········`

Check failure on line 60 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 60 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`
env[Constants.NEXT_PUBLIC_PREFIX + Constants.FIREBASE_DATACONNECT_ENV_ALT] = `http://${host}`;

Check failure on line 61 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 61 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`

Check failure on line 61 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Insert `⏎·········`

Check failure on line 61 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (20)

Insert `⏎·········`

Check failure on line 61 in src/emulator/env.ts

View workflow job for this annotation

GitHub Actions / unit (22)

Insert `⏎·········`
// Originally, there was a typo in this env var name. To avoid breaking folks unecessarily,
// we'll keep setting this.
env["FIREBASE_DATACONNECT_EMULATOR_HOST"] = host;
Expand Down
Loading