UNPKG

9.24 kBMarkdownView Raw
1# Contributing to EOSJS
2
3Interested in contributing? That's awesome! Here are some guidelines to get started quickly and easily:
4
5- [Reporting An Issue](#reporting-an-issue)
6 - [Bug Reports](#bug-reports)
7 - [Feature Requests](#feature-requests)
8 - [Change Requests](#change-requests)
9- [Working on EOSJS](#working-on-eosjs)
10 - [Feature Branches](#feature-branches)
11 - [Submitting Pull Requests](#submitting-pull-requests)
12 - [Testing](#testing)
13 - [Quality Assurance](#quality-assurance)
14- [Conduct](#conduct)
15- [Contributor License & Acknowledgments](#contributor-license--acknowledgments)
16- [References](#references)
17
18## Reporting An Issue
19
20If you're about to raise an issue because you think you've found a problem with EOSJS, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.
21
22The GitHub issue tracker is the preferred channel for [bug reports](#bug-reports), [feature requests](#feature-requests), and [submitting pull requests](#submitting-pull-requests), but please respect the following restrictions:
23
24* Please **search for existing issues**. Help us keep duplicate issues to a minimum by checking to see if someone has already reported your problem or requested your idea.
25
26* Please **be civil**. Keep the discussion on topic and respect the opinions of others. See also our [Contributor Code of Conduct](#conduct).
27
28### Bug Reports
29
30A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
31
32Guidelines for bug reports:
33
341. **Use the GitHub issue search** — check if the issue has already been
35 reported.
36
371. **Check if the issue has been fixed** — look for [closed issues in the
38 current milestone](https://github.com/EOSIO/eosjs/issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it
39 using the latest `develop` branch.
40
41A good bug report shouldn't leave others needing to chase you up for more information. Be sure to include the details of your environment and relevant tests that demonstrate the failure.
42
43[Report a bug](https://github.com/EOSIO/eosjs/issues/new?template=bug_report.md)
44
45### Feature Requests
46
47Feature requests are welcome. Before you submit one be sure to have:
48
491. **Use the GitHub search** and check the feature hasn't already been requested.
501. Take a moment to think about whether your idea fits with the scope and aims of the project.
511. Remember, it's up to *you* to make a strong case to convince the project's leaders of the merits of this feature. Please provide as much detail and context as possible, this means explaining the use case and why it is likely to be common.
52
53### Change Requests
54
55Change requests cover both architectural and functional changes to how EOSJS works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:
56
571. **Use the GitHub search** and check someone else didn't get there first
581. Take a moment to think about the best way to make a case for, and explain what you're thinking. Are you sure this shouldn't really be
59 a [bug report](#bug-reports) or a [feature request](#feature-requests)? Is it really one idea or is it many? What's the context? What problem are you solving? Why is what you are suggesting better than what's already there?
60
61## Working on EOSJS
62
63Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](https://github.com/EOSIO/eosjs/labels/good%20first%20issue) label in GitHub issues.
64
65Also, please follow these guidelines when submitting code:
66
67### Feature Branches
68
69To get it out of the way:
70
71- **[develop](https://github.com/EOSIO/eosjs/tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site.
72- **[master](https://github.com/EOSIO/eosjs/tree/master)** contains the latest release of EOSJS. This branch may be used in production. Do **NOT** use this branch to work on EOSJS's source.
73
74### Submitting Pull Requests
75
76Pull requests are awesome. If you're looking to raise a PR for something which doesn't have an open issue, please think carefully about [raising an issue](#reporting-an-issue) which your PR can close, especially if you're fixing a bug. This makes it more likely that there will be enough information available for your PR to be properly tested and merged.
77
78### Testing
79
80EOSJS is used by many libraries across the EOSIO ecosystem, so proper testing is absolutely essential prior to opening a pull request. This can be done in EOSJS by running `yarn build-production`. This command will build the distrubution bundles (`yarn build-all`) and test each environment accordingly (`yarn test-all`).
81
82#### Automated Unit Test Suite
83
84`yarn test` will run through the core functionality of each EOSJS module with Jest.
85
86#### Integration Test Suite
87
88Integration tests will only work with a local node running on port 8888 and with test accounts "bob" and "alice". This can be accomplished by following the [EOSIO Developer Getting Started Guide](https://developers.eos.io/eosio-home/docs/getting-the-software#section-step-1-1-start-keosd).
89
90##### Web Environment
91
92Run `yarn build-web` to create the `dist-web` folder and web distrubution modules then `yarn test-web`. This will run through the `tests/web.html` file using Cypress to inform you on the command line of any test failures.
93
94##### NodeJS Environment
95
96Run `yarn build` to build the NPM distribution bundle then run `yarn test-node`. This will create an out of box node environment with `tests/node.js` then test that environment with Jest and relay the results to the command line.
97
98### Quality Assurance
99
100Never underestimate just how useful quality assurance is. If you're looking to get involved with the code base and don't know where to start, checking out and testing a pull request is one of the most useful things you could do.
101
102Essentially, [check out the latest develop branch](#working-on-eosjs), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know!
103
104## Conduct
105
106While contributing, please be respectful and constructive, so that participation in our project is a positive experience for everyone.
107
108Examples of behavior that contributes to creating a positive environment include:
109- Using welcoming and inclusive language
110- Being respectful of differing viewpoints and experiences
111- Gracefully accepting constructive criticism
112- Focusing on what is best for the community
113- Showing empathy towards other community members
114
115Examples of unacceptable behavior include:
116- The use of sexualized language or imagery and unwelcome sexual attention or advances
117- Trolling, insulting/derogatory comments, and personal or political attacks
118- Public or private harassment
119- Publishing others’ private information, such as a physical or electronic address, without explicit permission
120- Other conduct which could reasonably be considered inappropriate in a professional setting
121
122## Contributor License & Acknowledgments
123
124Whenever you make a contribution to this project, you license your contribution under the same terms as set out in LICENSE, and you represent and warrant that you have the right to license your contribution under those terms. Whenever you make a contribution to this project, you also certify in the terms of the Developer’s Certificate of Origin set out below:
125
126```
127Developer Certificate of Origin
128Version 1.1
129
130Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1311 Letterman Drive
132Suite D4700
133San Francisco, CA, 94129
134
135Everyone is permitted to copy and distribute verbatim copies of this
136license document, but changing it is not allowed.
137
138
139Developer's Certificate of Origin 1.1
140
141By making a contribution to this project, I certify that:
142
143(a) The contribution was created in whole or in part by me and I
144 have the right to submit it under the open source license
145 indicated in the file; or
146
147(b) The contribution is based upon previous work that, to the best
148 of my knowledge, is covered under an appropriate open source
149 license and I have the right under that license to submit that
150 work with modifications, whether created in whole or in part
151 by me, under the same open source license (unless I am
152 permitted to submit under a different license), as indicated
153 in the file; or
154
155(c) The contribution was provided directly to me by some other
156 person who certified (a), (b) or (c) and I have not modified
157 it.
158
159(d) I understand and agree that this project and the contribution
160 are public and that a record of the contribution (including all
161 personal information I submit with it, including my sign-off) is
162 maintained indefinitely and may be redistributed consistent with
163 this project or the open source license(s) involved.
164```
165
166## References
167
168* Overall CONTRIB adapted from https://github.com/mathjax/MathJax/blob/master/CONTRIBUTING.md
169* Conduct section adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html