Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve firebase init command in README.md file #157

Closed
beaufortfrancois opened this issue Sep 8, 2021 · 5 comments · Fixed by #159
Closed

Improve firebase init command in README.md file #157

beaufortfrancois opened this issue Sep 8, 2021 · 5 comments · Fixed by #159
Labels
enhancement New feature or request

Comments

@beaufortfrancois
Copy link
Member

README.md file says firebase init however it's not clear which firebase features to enable.
It would be better to have them listed properly as in firebase init [feature_name_1] [feature_name_2].

@beaufortfrancois beaufortfrancois added the enhancement New feature or request label Sep 8, 2021
@derekherman
Copy link
Collaborator

The project already has a firebase.json, so I would assume it reads the features from that file. If that is not the case then we could just change it to firebase init hosting, as Hosting is the only feature we need for this project.

@beaufortfrancois
Copy link
Member Author

Is this intended that firebase.json file is updated after running firebase init hosting command?

$ firebase init hosting

     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  /XXXXXXXXX/GitHub/kino

Before we get started, keep in mind:

  * You are initializing within an existing Firebase project directory


=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

i  .firebaserc already has a default project, using XXXXXX.

=== Hosting Setup

Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.

? What do you want to use as your public directory? public
? Configure as a single-page app (rewrite all urls to /index.html)? No
? Set up automatic builds and deploys with GitHub? No
✔  Wrote public/404.html
? File public/index.html already exists. Overwrite? No
i  Skipping write of public/index.html

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

✔  Firebase initialization complete!
$ git diff
diff --git a/firebase.json b/firebase.json
index a570099..e782939 100644
--- a/firebase.json
+++ b/firebase.json
@@ -1,10 +1,6 @@
 {
   "hosting": {
     "public": "public",
-    "rewrites": [{
-      "source": "**",
-      "destination": "/index.html"
-    }],
     "ignore": [
       "firebase.json",
       "**/.*",

@derekherman
Copy link
Collaborator

No, it is not intended that it would update the config file. What we want would be to initialize Firebase so it creates the .firebaserc but does not change the config file. The docs on that CLI command are very sparse.

@derekherman
Copy link
Collaborator

I think the option Configure as a single-page app (rewrite all urls to /index.html)? should be set to Yes and then it would leave the config file as-is.

@beaufortfrancois
Copy link
Member Author

Thank you @derekherman! You're right.
Here's the PR: #159

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants