diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..954e109 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,23 @@ +## Context + + +## Expected Behavior + + +## Actual Behavior + + +## Steps to Reproduce + + +1. +2. +3. +4. + +## Notes + + +## Your Environment +- Package Version: +- Environment (Go version, Glide version, etc): diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..3237553 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## Checklist + + +- [ ] Added Tests +- [ ] Tests Pass +- [ ] Squashed Commits + +## What + + + +## Why + + + +## Notes + + + + +## Related Issues + + +fixes # diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b20d6ea --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,51 @@ +# Contributing + +First of all, thank you for wanting to contibute to a Hyperdriven project! :raised_hands: + +We welcome and encourage contibutions (no matter how big or small) from **everyone**. By participating, you agree to abide by [our code of conduct](https://hyperdriven.net/code-of-conduct/). + +## Ways You Can Contribute + + - [Submit a Pull Request](#pull-requests) :octocat: :shipit: + - [Edit the Wiki](https://github.com/hyperdriven/hyperdrive/wiki) :pencil: + - [Report a Bug](https://github.com/hyperdriven/hyperdrive/issues/new?labels=bug) :beetle: + - [Suggest a Feature](https://github.com/hyperdriven/hyperdrive/issues/new?labels=enhancement) :bulb: + - [Get Involved in The Community](https://hyperdriven.net/community/) :busts_in_silhouette: + - [Tell us](mailto:hello@hypedriven.net) about your _hyperdriven API_. :mailbox_with_mail: + - Write about us on your blog or social media! :mega: + +## Pull Requests + +1. [Fork the repo](https://github.com/hyperdriven/hyperdrive#fork-destination-box) + +2. Clone your fork: + + git clone git@github.com:your-username/hyperdrive.git + +3. Set up your machine: + + ./scripts/setup + +4. Install dependencies: + + ./scripts/install + +5. Make sure the tests pass: + + ./scripts/test + +6. Make your change. Add tests, and ensure the tests pass: + + ./scripts/test + +7. Commit your changes (squash your commits, if needed), push your fork, and [submit a pull request](https://github.com/hyperdriven/hyperdrive/compare/) + +At this point you're waiting on us. We will try to review your submissions within three days -- typically sooner than that. We may suggest some changes, improvements or alternative approaches -- please be open to feedback, as we have to consider how your change fits into the over all design and vision of the project. + +Some things that will increase the chance that your pull request is accepted: + +- Break unrelated changes up into multiple pull requests -- our change log is generated automatically from merged pull requests. +- Add your changes to one of the existing files in our package, unless you are introducing an entirely new concept (in which case, you can create a new file). +- Write tests. We use [testify](https://github.com/stretchr/testify) for our unit tests. +- Follow the Golang [style guide](https://github.com/golang/go/wiki/CodeReviewComments). +- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). diff --git a/README.md b/README.md index a045392..790b2cc 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,26 @@ An opinionated micro-framework for creating Hypermedia APIs in Go. OR glide get github.com/hyperdriven/hyperdrive + +## Import -## Config + import "github.com/hyperdriven/hyperdrive" + +## Usage + +Refer to our [Quick Start Guide](https://hyperdriven.net/quick-start/) for how to use this package. + +## Config -Configuration of core features are done via Environment Variables, in accordence with [12 factor](https://12factor.net/config) principles. +Configuration of core features are done via Environment Variables, in accordence with [12 factor](https://12factor.net/config) principles, and is [detailed here](https://hyperdriven.net/configuration/) - - `HYPERDRIVE_ENV`: (default: `development`, type: `string`) The stage in your deployment pipeline the api is currently running in. A value of `production` changes behviour for some features (such as whether stack traces are logged during panic recovery). Other values, such as `staging`, can be used but currently have no meanin in the framework other than the one you give it in your own code. - - `PORT`: (default: `5000`, type: `int`) The port the server should listen on. - - `GZIP_LEVEL`: (default: `-1`, type: `int`) Accepts a value between `-2` and `9`. Invalid values will be silently discarded and the default of `-1` will be used. More info on compression levels can be found in the docs, but corresponds to `zlib` compression levels. - - `CORS_ENABLED`: (default: `true`, type: `bool`) Set this to `false` to disable CORS support. - - `CORS_HEADERS`: (type: `string`) A comma-seperated list of headers to allow and expose during CORS requests. These will be appended to the default set of headers that are always allowed: `Accept`, `Accept-Language`, `Content-Language`, and `Content-Type`. - - `CORS_ORIGINS`: (default: `*`, type: `string`) A comma-seperated list of origins to allow during CORS requests. These will replace the default value, which is to allow all origins. - - `CORS_CREDENTIALS`: (default: `true`, type: `bool`) Set this to `false` to disable authenticated CORS requests. +## Contributing -## Docs +Refer to our [Contributor's Guide](https://hyperdriven.net/contributing/) to learn more about how you can partipicate. +## More Info + + - [Hyperdriven.net](https://hyperdriven.net/) - [GoDoc](https://godoc.org/github.com/hyperdriven/hyperdrive) - [Wiki](https://github.com/hyperdriven/hyperdrive/wiki) - - [Examples](https://github.com/hyperdriven/hyperdrive-examples) + - [Example APIs](https://github.com/hyperdriven/hyperdrive-examples) diff --git a/scripts/debug b/scripts/debug new file mode 100755 index 0000000..f1cee2e --- /dev/null +++ b/scripts/debug @@ -0,0 +1,9 @@ +#!/usr/bin/env sh +set -e + +go version +if which glide > /dev/null; then + glide -v +else + echo "glide not installed" +fi diff --git a/scripts/setup b/scripts/setup index 562dc8f..59ffc9a 100755 --- a/scripts/setup +++ b/scripts/setup @@ -1,7 +1,9 @@ #!/usr/bin/env sh set -e -if which glide > /dev/null; then +# This script assumes you already have a proper go environment set up. + +if which glide > /dev/null; then echo "glide already installed" else go get -v github.com/Masterminds/glide @@ -14,5 +16,9 @@ else fi if [ "$TRAVIS" != "true"]; then - gem install github_changelog_generator --no-ri --no-rdoc + if which gem > /dev/null; then + gem install github_changelog_generator --no-ri --no-rdoc + else + echo "gem comand not found, skipping installation of github_changelog_generator" + fi fi