|
| 1 | +# Contributing | AngularFire |
| 2 | + |
| 3 | +Thank you for contributing to the Firebase community! |
| 4 | + |
| 5 | + - [Have a usage question?](#question) |
| 6 | + - [Think you found a bug?](#issue) |
| 7 | + - [Have a feature request?](#feature) |
| 8 | + - [Want to submit a pull request?](#submit) |
| 9 | + - [Need to get set up locally?](#local-setup) |
| 10 | + |
| 11 | + |
| 12 | +## <a name="question"></a>Have a usage question? |
| 13 | + |
| 14 | +We get lots of those and we love helping you, but GitHub is not the best place for them. Issues |
| 15 | +which just ask about usage will be closed. Here are some resources to get help: |
| 16 | + |
| 17 | +- Start with the [quickstart](../docs/quickstart.md) |
| 18 | +- Go through the [guide](../docs/guide/README.md) |
| 19 | +- Read the full [API reference](https://angularfire.firebaseapp.com/api.html) |
| 20 | +- Try out some [examples](../README.md#examples) |
| 21 | + |
| 22 | +If the official documentation doesn't help, try asking a question through our |
| 23 | +[official support channels](https://firebase.google.com/support/). |
| 24 | + |
| 25 | +**Please avoid double posting across multiple channels!** |
| 26 | + |
| 27 | +see |
| 28 | +## <a name="issue"></a>Think you found a bug? |
| 29 | + |
| 30 | +Yeah, we're definitely not perfect! |
| 31 | + |
| 32 | +Search through [old issues](https://github.com/firebase/angularfire/issues) before submitting a new |
| 33 | +issue as your question may have already been answered. |
| 34 | + |
| 35 | +If your issue appears to be a bug, and hasn't been reported, |
| 36 | +[open a new issue](https://github.com/firebase/angularfire/issues/new). Please use the provided bug |
| 37 | +report template and include a minimal repro. |
| 38 | + |
| 39 | +If you are up to the challenge, [submit a pull request](#submit) with a fix! |
| 40 | + |
| 41 | + |
| 42 | +## <a name="feature"></a>Have a feature request? |
| 43 | + |
| 44 | +Great, we love hearing how we can improve our products! After making sure someone hasn't already |
| 45 | +requested the feature in the [existing issues](https://github.com/firebase/angularfire/issues), go |
| 46 | +ahead and [open a new issue](https://github.com/firebase/angularfire/issues/new). Feel free to remove |
| 47 | +the bug report template and instead provide an explanation of your feature request. Provide code |
| 48 | +samples if applicable. Try to think about what it will allow you to do that you can't do today? How |
| 49 | +will it make current workarounds straightforward? What potential bugs and edge cases does it help to |
| 50 | +avoid? |
| 51 | + |
| 52 | + |
| 53 | +## <a name="submit"></a>Want to submit a pull request? |
| 54 | + |
| 55 | +Sweet, we'd love to accept your contribution! [Open a new pull request](https://github.com/firebase/angularfire/pull/new/master) |
| 56 | +and fill out the provided form. |
| 57 | + |
| 58 | +**If you want to implement a new feature, please open an issue with a proposal first so that we can |
| 59 | +figure out if the feature makes sense and how it will work.** |
| 60 | + |
| 61 | +Make sure your changes pass our linter and the tests all pass on your local machine. We've hooked |
| 62 | +up this repo with continuous integration to double check those things for you. |
| 63 | + |
| 64 | +Most non-trivial changes should include some extra test coverage. If you aren't sure how to add |
| 65 | +tests, feel free to submit regardless and ask us for some advice. |
| 66 | + |
| 67 | +Finally, you will need to sign our [Contributor License Agreement](https://cla.developers.google.com/about/google-individual) |
| 68 | +before we can accept your pull request. |
| 69 | + |
| 70 | + |
| 71 | +## <a name="local-setup"></a>Need to get set up locally? |
| 72 | + |
| 73 | +If you'd like to contribute to AngularFire, you'll need to do the following to get your environment |
| 74 | +set up. |
| 75 | + |
| 76 | +### Install Dependencies |
| 77 | + |
| 78 | +```bash |
| 79 | +$ git clone https://github.com/firebase/angularfire.git |
| 80 | +$ cd angularfire # go to the angularfire directory |
| 81 | +$ npm install -g grunt-cli # globally install grunt task runner |
| 82 | +$ npm install # install local npm build / test dependencies |
| 83 | +$ grunt install # install Selenium server for end-to-end tests |
| 84 | +``` |
| 85 | + |
| 86 | +### Create a Firebase Project |
| 87 | + |
| 88 | +1. Create a Firebase project [here](https://console.firebase.google.com). |
| 89 | +2. Set the `ANGULARFIRE_TEST_DB_URL` environment variable to your project's database URL: |
| 90 | + |
| 91 | +```bash |
| 92 | +$ export ANGULARFIRE_TEST_DB_URL="https://<YOUR-DATABASE-NAME>.firebaseio.com" |
| 93 | +``` |
| 94 | + |
| 95 | +3. Update the entire `config` variable in [`tests/initialize.js`](../tests/initialize.js) to |
| 96 | +correspond to your Firebase project. You can find your `apiKey` and `databaseUrl` by clicking the |
| 97 | +**Web Setup** button at `https://console.firebase.google.com/project/<projectId>/authentication/users`. |
| 98 | + |
| 99 | +### Download a Service Account JSON File |
| 100 | + |
| 101 | +1. Follow the instructions [here](https://firebase.google.com/docs/server/setup#add_firebase_to_your_app) |
| 102 | +on how to create a service account for your project and furnish a private key. |
| 103 | +2. Copy the credentials JSON file to `tests/key.json`. |
| 104 | + |
| 105 | +### Lint, Build, and Test |
| 106 | + |
| 107 | +```bash |
| 108 | +$ grunt # lint, build, and test |
| 109 | + |
| 110 | +$ grunt build # lint and build |
| 111 | + |
| 112 | +$ gulp test # run unit and e2e tests |
| 113 | +$ gulp test:unit # run unit tests |
| 114 | +$ gulp test:e2e # run e2e tests (via Protractor) |
| 115 | + |
| 116 | +$ grunt watch # lint, build, and test whenever source files change |
| 117 | +``` |
| 118 | + |
| 119 | +The output files - `angularfire.js` and `angularfire.min.js` - are written to the `/dist/` directory. |
0 commit comments