-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Contributing code
Thank you for your interest in contributing to LoopBack!
- How to contribute
- Reporting an issue
- Submitting a pull request
- Running tests
- Signing patches
- Contributor License Agreement
You can contribute in a number of ways:
- Report an issue. Reporting it first will ensure that it is in fact an issue, and there is not already a fix in the works.
- After reporting a bug, go one step further and fix it.
- Ensure that your effort is aligned with the project's roadmap by talking to the maintainers, especially if you are going to spend a lot of time on it.
- Adhere to code style outlined in the Google C++ Style Guide and Google Javascript Style Guide.
- Sign your patches to indicate that your are making your contribution available under the terms of the Contributor License Agreement.
- Submit a pull request through Github.
- Run tests; see Running tests.
If you are looking to contribute, but aren't sure where to start, review open pull requests for the module. For example: LoopBack open pull requests.
Also, please read the source code before contributing. If something is confusing, poorly documented, poorly commented, or could otherwise be improved: open a GitHub issue and link to the file and line of code with a useful description of what you would like to see or think is missing.
Code contributions should only be using features and language constructs available in v0.10.
Check your Node.js version via
node -v
in your terminal
At this time, we are still supporting Node.js v0.10 and do not transpile. We would like to change this in the near future (ie. drop support for versions older than 4/6 or transpile), but extra caution is required as this update would affect a large number of users. Thanks for your patience.
Follow this basic process:
- Search existing issues. It's possible someone has already reported the same problem.
- Make sure you have a GitHub account.
- Create a new issue for the bug. Clearly describe the issue, including steps to reproduce. Make sure you fill in the earliest version that you know has the issue.
For more information, see Reporting issues.
Follow the GitHub Flow.
- Create a GitHub issue for large changes and discuss the change there before coding. You can skip this step and submit the pull request for minor changes.
- Fork the repository on GitHub.
- Create a branch for you change/feature off of the master branch.
- Make your change. Remember to update tests as well as code! Always run all the tests to assure nothing else was accidentally broken. For bugs, adding a failing test and submitting a pull request usually leads to the bug being fixed quickly. For features, include tests that cover the entire feature. For remote / client facing features, include integration tests in the [loopback-example-app](](https://github.com/strongloop/loopback-example-app).
- Check for unnecessary whitespace with
git diff --check
before committing. - Make commits of logical units and push them to Github.
- Use a descriptive commit message, and follow 50/72 format.
- Use GitHub's pull requests to submit the patch. Feel free to issue the pull request as soon as you have something partial to show and get reviewed. You can add more commits to your pull request as you are progressing on the implementation. The title of the pull request should start with "WIP" for "work in progress" when the pull request is not complete yet.
- Request a code review. Add a specific committer to speed up this process. (for example,
@ritch
,@raymondfeng
). - Make any requested changes and push to your fork. Make sure your changes are still based on the latest code (use
git rebase upstream/master
).
All LoopBack projects follow the same convention for running tests. To run a projects test suite, change to the project's directory and run:
npm test
If a test is failing, you should open an issue on the appropriate repositories GitHub issues page.
Like many open source projects, we need you to agree to a contributor license agreement before we can merge in your changes.
In summary, by submitting your code, you are granting us a right to use that code under the terms of this agreement, including providing it to others. You are also certifying that you wrote it, and that you are allowed to license it to us. You are not giving up your copyright in your work. The license does not change your rights to use your own contributions for any other purpose.
Contributor License Agreements are important because they define the chain of ownership of a piece of software. Some companies won't allow the use of free software without clear agreements around code ownership. That's why many open source projects collect similar agreements from contributors. The LoopBack CLA is based on the Apache CLA.
To signify your agreement to these terms, add the following line to the bottom of your commit message. Use your real name and an actual e-mail address.
Signed-off-by: Random J Developer <[email protected]>
Alternatively you can use the git command line to automatically add this line, as follows:
$ git commit -sm "Replace rainbows by unicorns"
Individual Contributor License Agreement
By signing this Individual Contributor License Agreement
("Agreement"), and making a Contribution (as defined below) to
StrongLoop, Inc. ("StrongLoop"), You (as defined below) accept and
agree to the following terms and conditions for Your present and
future Contributions submitted to StrongLoop. Except for the license
granted in this Agreement to StrongLoop and recipients of software
distributed by StrongLoop, You reserve all right, title, and interest
in and to Your Contributions.
1. Definitions
"You" or "Your" shall mean the copyright owner or the individual
authorized by the copyright owner that is entering into this
Agreement with StrongLoop.
"Contribution" shall mean any original work of authorship,
including any modifications or additions to an existing work, that
is intentionally submitted by You to StrongLoop for inclusion in,
or documentation of, any of the products owned or managed by
StrongLoop ("Work"). For purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication
sent to StrongLoop or its representatives, including but not
limited to communication or electronic mailing lists, source code
control systems, and issue tracking systems that are managed by,
or on behalf of, StrongLoop for the purpose of discussing and
improving the Work, but excluding communication that is
conspicuously marked or otherwise designated in writing by You as
"Not a Contribution."
2. You Grant a Copyright License to StrongLoop
Subject to the terms and conditions of this Agreement, You hereby
grant to StrongLoop and recipients of software distributed by
StrongLoop, a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable copyright license to reproduce, prepare
derivative works of, publicly display, publicly perform,
sublicense, and distribute Your Contributions and such derivative
works under any license and without any restrictions.
3. You Grant a Patent License to StrongLoop
Subject to the terms and conditions of this Agreement, You hereby
grant to StrongLoop and to recipients of software distributed by
StrongLoop a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable (except as stated in this Section)
patent license to make, have made, use, offer to sell, sell,
import, and otherwise transfer the Work under any license and
without any restrictions. The patent license You grant to
StrongLoop under this Section applies only to those patent claims
licensable by You that are necessarily infringed by Your
Contributions(s) alone or by combination of Your Contributions(s)
with the Work to which such Contribution(s) was submitted. If any
entity institutes a patent litigation against You or any other
entity (including a cross-claim or counterclaim in a lawsuit)
alleging that Your Contribution, or the Work to which You have
contributed, constitutes direct or contributory patent
infringement, any patent licenses granted to that entity under
this Agreement for that Contribution or Work shall terminate as
of the date such litigation is filed.
4. You Have the Right to Grant Licenses to StrongLoop
You represent that You are legally entitled to grant the licenses
in this Agreement.
If Your employer(s) has rights to intellectual property that You
create, You represent that You have received permission to make
the Contributions on behalf of that employer, that Your employer
has waived such rights for Your Contributions, or that Your
employer has executed a separate Corporate Contributor License
Agreement with StrongLoop.
5. The Contributions Are Your Original Work
You represent that each of Your Contributions are Your original
works of authorship (see Section 8 (Submissions on Behalf of
Others) for submission on behalf of others). You represent that to
Your knowledge, no other person claims, or has the right to claim,
any right in any intellectual property right related to Your
Contributions.
You also represent that You are not legally obligated, whether by
entering into an agreement or otherwise, in any way that conflicts
with the terms of this Agreement.
You represent that Your Contribution submissions include complete
details of any third-party license or other restriction (including,
but not limited to, related patents and trademarks) of which You
are personally aware and which are associated with any part of
Your Contributions.
6. You Don't Have an Obligation to Provide Support for Your Contributions
You are not expected to provide support for Your Contributions,
except to the extent You desire to provide support. You may provide
support for free, for a fee, or not at all.
6. No Warranties or Conditions
StrongLoop acknowledges that unless required by applicable law or
agreed to in writing, You provide Your Contributions on an "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES
OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR
FITNESS FOR A PARTICULAR PURPOSE.
7. Submission on Behalf of Others
If You wish to submit work that is not Your original creation, You
may submit it to StrongLoop separately from any Contribution,
identifying the complete details of its source and of any license
or other restriction (including, but not limited to, related
patents, trademarks, and license agreements) of which You are
personally aware, and conspicuously marking the work as
"Submitted on Behalf of a Third-Party: [named here]".
8. Agree to Notify of Change of Circumstances
You agree to notify StrongLoop of any facts or circumstances of
which You become aware that would make these representations
inaccurate in any respect. Email us at [email protected].