This guide is designed to get you started contributing to the Sails framework. It assumes you know how to use Github, but should be applicable whether this will be your first pull request or you're an active contributor to hundreds of projects.
Like any open-source project, we must have guidelines for contributions. It helps protect the quality of the code, and gives all of us confidence that our framework will stay robust and dependable. Whether it's a bug fix, or a huge new feature set, it's important that we consistently apply these checks and balances for all contributions to Sails.
Please check over the following requirements before submitting a pull request:
- Bug fixes should have accompanying tests where possible.
- Should follow our style guide to maintain code consistency (see
.jshint
file in repo)
If you have a high priority hot-fix for the currently deployed version, please let us know with an issue, and mention @mikermcneil. Also, for emergencies, please feel free to tweet @sailsjs.
Now that we are all on the same page, lets get to coding some awesomeness of our own :D
Start by forking the repository:
Then clone your fork into your local filesystem:
git clone [email protected]:YOUR_USER_NAME/sails.git
To merge recent changes into your fork, inside your project dir:
git remote add core https://github.com/balderdashy/sails.git
git fetch core
git merge core/master
additional details, see github
Make your enhancements, fix bugs, do your thang
.
Please write a test for your addition/fix. I know it kind of sucks if you're not used to it, but it's how we maintain great code.
For our test suite, we use mocha. You can run the tests with npm test
. If run into trouble with this part, please reach out to the Google Group!
When you're done, you can commit your fix, push up your code, and then go into github and submit a pull request. We'll look it over and get back to you ASAP.
If you forked Sails, and you want to test your Sails app against your fork, here's how you do it:
In your local copy of your fork of Sails:
npm link
In your Sails app's repo:
npm link sails
This creates a symbolic link as a local dependency (in your app's node_modules
folder). This has the effect of letting you run your app with the version Sails you linked
.
$ node app.js