Skip to content
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

Adding extensions to firebase init #5701

Merged
merged 5 commits into from
Apr 17, 2023
Merged

Adding extensions to firebase init #5701

merged 5 commits into from
Apr 17, 2023

Conversation

joehan
Copy link
Contributor

@joehan joehan commented Apr 17, 2023

Description

Adds extensions as an option to firebase init. If selected, this will set up an empty extensions section in firebase.json and create an empty extensions directory. If called from a directory that already has extensions set up, it will prompt users if they want to overwrite.

Scenarios Tested

Screenshot 2023-04-17 at 11 28 07 AM

init a fresh directory

Screenshot 2023-04-17 at 11 32 26 AM

init a directory that already has extensions:

Screenshot 2023-04-17 at 11 34 21 AM

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2023

Codecov Report

Patch coverage: 30.00% and project coverage change: -0.01 ⚠️

Comparison is base (4cc49d4) 55.74% compared to head (8887598) 55.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5701      +/-   ##
==========================================
- Coverage   55.74%   55.73%   -0.01%     
==========================================
  Files         324      324              
  Lines       21894    21905      +11     
  Branches     4466     4470       +4     
==========================================
+ Hits        12204    12209       +5     
- Misses       8609     8616       +7     
+ Partials     1081     1080       -1     
Impacted Files Coverage Δ
src/prompt.ts 72.00% <14.28%> (-22.45%) ⬇️
src/extensions/manifest.ts 73.43% <33.33%> (-4.35%) ⬇️
src/extensions/extensionsHelper.ts 50.95% <100.00%> (+0.60%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@joehan joehan requested review from pavelgj and elvisun April 17, 2023 19:14
.join("\n\t");
if (
!(await confirm({
message: `firebase.json already contains extensions:\n${currentExtensions}\nWould you like to overwrite them?`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested copy: "firebase.json already contains extensions:\n${currentExtensions}\nThese extensions will be removed from the manifest if you choose to re-initialize. Would you like to overwrite them?"

Just to be extra clear what overwrite means.

return;
}
}
config.set("extensions", {});
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't delete the .env files for the extensions. Rather than trying to overwrite it, can we just throw if something already exists to keep things simple?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a little awkward as is, but intentional. I'd like init to be idempotent so that it can more safely be used into scripts - init is meant as an interactive command, but some folks still try to use it non interactively.

I considered cleaning up the .env files, with a prompt, only in interactive mode, but leaving them doesn't have any ill effects.

@joehan joehan merged commit d1244ee into master Apr 17, 2023
@joehan joehan deleted the jh-ext-init branch April 17, 2023 19:48
ProfHercules pushed a commit to ProfHercules/firebase-tools that referenced this pull request May 5, 2023
* Adding extensions to firebase init

* changelog

* Formats
tonyjhuang pushed a commit that referenced this pull request May 22, 2023
* Adding extensions to firebase init

* changelog

* Formats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants