-
Notifications
You must be signed in to change notification settings - Fork 11
build(env): simplify local environment setup #1655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update modifies configuration files and Firebase initialization logic. It sets explicit default values and removes unused variables in Changes
Sequence Diagram(s)sequenceDiagram
participant Env as Environment Variables
participant FirebaseConfig as firebase_config.ts
participant Firebase as Firebase SDK
Env->>FirebaseConfig: Provide GOOGLE_CONFIG_BASE64 (optional), projectId, storageBucket
FirebaseConfig->>FirebaseConfig: Create AppOptions with projectId, storageBucket
alt GOOGLE_CONFIG_BASE64 exists
FirebaseConfig->>FirebaseConfig: Add credential to AppOptions
end
FirebaseConfig->>Firebase: initializeApp(AppOptions)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
CONTRIBUTING.md (1)
49-49
: Consider simplifying the language.The environment setup instruction is appropriately simplified. However, consider this minor style improvement:
-Environment variables are required in order to locally run this API. You can just copy the `.env.example` file to `.env`. +Environment variables are required to locally run this API. You can just copy the `.env.example` file to `.env`.🧰 Tools
🪛 LanguageTool
[style] ~49-~49: Consider a more concise word here.
Context: ...les Environment variables are required in order to locally run this API. You can just copy...(IN_ORDER_TO_PREMIUM)
.env.example (1)
8-8
: Caution: Static encryption key in example.
Including a fixedSEC_ENCRYPT_KEY
in version control can encourage insecure usage. It’s better to generate a unique key per environment and document key rotation.Apply this diff to add a warning and prompt users to replace the sample key:
-SEC_ENCRYPT_KEY=organized-local-a0a7be20e1f82141d915b1212d8db451c09ae6fa76dd89d78f8063fb1c148909 +# WARNING: Replace this sample key with a secure, environment-specific key. +SEC_ENCRYPT_KEY=organized-local-a0a7be20e1f82141d915b1212d8db451c09ae6fa76dd89d78f8063fb1c148909
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.env.example
(1 hunks).firebaserc.example
(1 hunks)CONTRIBUTING.md
(1 hunks)package.json
(1 hunks)src/v3/config/firebase_config.ts
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
CONTRIBUTING.md
[style] ~49-~49: Consider a more concise word here.
Context: ...les Environment variables are required in order to locally run this API. You can just copy...
(IN_ORDER_TO_PREMIUM)
🔇 Additional comments (5)
src/v3/config/firebase_config.ts (2)
1-1
: LGTM: AppOptions import added correctly.The addition of
AppOptions
type import supports the refactored initialization logic below.
6-12
: Well-structured conditional Firebase initialization.The refactor properly separates required configuration (projectId, storageBucket) from optional credentials, enabling local development without service account setup. The conditional credential inclusion aligns with the PR's goal of simplifying local environment setup.
.firebaserc.example (1)
3-3
: Good standardization of local project naming.Changing from placeholder to "organized-local" aligns with the standardized project naming used across other configuration files in this PR, simplifying local setup.
package.json (1)
13-13
: Excellent addition of explicit project flag.Adding
--project=organized-local
ensures the Firebase emulators start with the correct project configuration, making the local setup more reliable and consistent with the standardized project naming..env.example (1)
3-3
: FIREBASE_APP_NAME default set correctly.
Theorganized-local
value here matches your.firebaserc.example
and the emulator start scripts (--project=organized-local
), ensuring consistency across setup steps.
🎉 This PR is included in version 3.30.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.