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: 1 addition & 1 deletion examples/react/useGetIdTokenQuery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"dev:emulator": "cd ../../../ && firebase emulators:exec --project test-project 'cd examples/react/useGetIdTokenQuery && vite'",
"dev:emulator": "cd ../../../ && firebase emulators:exec --project demo-test-project 'cd examples/react/useGetIdTokenQuery && vite'",
"build": "npx vite build",
"preview": "vite preview"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"packageManager": "[email protected]",
"scripts": {
"test": "turbo test",
"test:emulator": "firebase emulators:exec --project test-project \"pnpm turbo test:ci\"",
"test:emulator": "firebase emulators:exec --project demo-test-project \"pnpm turbo test:ci\"",
"serve:coverage": "npx serve coverage",
"emulator": "firebase emulators:start --project test-project",
"emulator": "firebase emulators:start --project demo-test-project",
Comment on lines +7 to +9

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The project ID demo-test-project is hardcoded here and in other package.json files. This can make it difficult to maintain if the project ID changes.

To centralize this configuration, you could create a .firebaserc file in the project root with the following content:

{
  "projects": {
    "default": "demo-test-project"
  }
}

With this file, you can remove the --project demo-test-project flag from your firebase commands, as the Firebase CLI will automatically use the default project. For example, line 9 could be simplified to:
"emulator": "firebase emulators:start"

"emulator:kill": "lsof -t -i:4001 -i:8080 -i:9000 -i:9099 -i:9199 -i:8085 -i:9399 -i:9299 | xargs kill -9",
"format": "biome check .",
"format:fix": "biome check . --write",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:ci": "vitest --dom --coverage --run",
"build": "tsup",
"serve:coverage": "npx serve coverage",
"emulator": "firebase emulators:start --project test-project",
"emulator": "firebase emulators:start --project demo-test-project",
"emulator:kill": "lsof -t -i:4001 -i:8080 -i:9000 -i:9099 -i:9199 -i:8085 | xargs kill -9",
"check": "tsc --noEmit",
"publish-package": "pnpm run build && cd dist && npm publish"
Expand Down
6 changes: 3 additions & 3 deletions packages/react/vitest/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { expect } from "vitest";
import { connectorConfig } from "@/dataconnect/default-connector";

const firebaseTestingOptions = {
projectId: "test-project",
projectId: "demo-test-project",
apiKey: "test-api-key",
authDomain: "test-auth-domain",
};
Expand All @@ -38,7 +38,7 @@ if (!firebaseApp) {

async function wipeFirestore() {
const response = await fetch(
"http://localhost:8080/emulator/v1/projects/test-project/databases/(default)/documents",
"http://localhost:8080/emulator/v1/projects/demo-test-project/databases/(default)/documents",
{
method: "DELETE",
},
Expand All @@ -51,7 +51,7 @@ async function wipeFirestore() {

async function wipeAuth() {
const response = await fetch(
"http://localhost:9099/emulator/v1/projects/test-project/accounts",
"http://localhost:9099/emulator/v1/projects/demo-test-project/accounts",
{
method: "DELETE",
},
Expand Down
Loading