👍 First off, thanks for taking the time to contribute! 👍
The following is a set of guidelines for contributing to twitter-v2 and its packages, which are hosted on npm. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
What should I know before I get started?
This is still a small project, so design decisions are still made somewhat informally through discussion in pull requests and issues. However, broadly speaking there are a few ideas that are consistent.
- twitter-v2 is a thin client. Unlike some other packages (see twitter-api-v2 for an example) we're not trying to abstract Twitter's API layer through an ORM. We aim to simplify usage of Twitter's rest endpoints. This is less of a philosophical decision, and more of a practical one. By operating at the HTTP-layer, any new changes to the Twitter API are supported immediately by this package.
This section guides you through submitting a bug report. Following these guidelines helps maintainers and the community understand your report and reproduce the behavior.
Before creating bug reports, please check this list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible. Fill out the required template, the information it asks for helps us resolve issues faster.
Note: If you find a Closed issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
- Perform a cursory search to see if the problem has already been reported. If it has and the issue is still open, add a comment to the existing issue instead of opening a new one.
Bugs are tracked as GitHub issues. Create an issue and provide the following information by filling in the template.
Explain the problem and include additional details to help maintainers reproduce the problem:
- Use a clear and descriptive title for the issue to identify the problem.
- Describe the exact steps which reproduce the problem in as many details as
possible. For example, start by explaining how you configured your
authentication and which version of twitter-v2 you are using. When listing
steps, don't just say what you did, but explain how you did it. For
example, if you experienced a stream failure, did you leave it running
overnight or for five minutes? What does your
.close()
logic look like? - Provide specific examples to demonstrate the steps. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use Markdown code blocks.
- Describe the behavior you observed after following the steps and point out what exactly is the problem with that behavior.
- Explain which behavior you expected to see instead and why.
- If you're reporting that twitter-v2 crashed, include the stack trace.
- If the problem wasn't triggered by a specific action, describe what you were doing before the problem happened and any environment-related information that might be unusual. Are you running an old version of node? Running in a memory-squeezed VM? Etc...
This section guides you through submitting an enhancement suggestion, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion.
Before creating enhancement suggestions, please check this list as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please include as many details as possible. Fill in the template, including the steps that you imagine you would take if the feature you're requesting existed.
- Perform a cursory search to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
Enhancement suggestions are tracked as GitHub issues.
- Use a clear and descriptive title for the issue to identify the suggestion.
- Provide a step-by-step description of the suggested enhancement in as many details as possible.
- Provide specific examples to demonstrate the steps. Include copy/pasteable snippets which you use in those examples, as Markdown code blocks.
- Describe the current behavior and explain which behavior you expected to see instead and why.
- Explain why this enhancement would be useful to most twitter-v2 users.
Unsure where to begin contributing? You can start by looking through these
good first issue
and help wanted
issues:
- Good first issues - issues which should only require a few lines of code, and a test or two.
- Help wanted issues - issues which should be a bit more involved
than
good first issue
issues.
We current support unit tests and end-to-end test; both of which can be run with
npm test
. Note that end-to-end tests will require that you provide credentials
as environment variables to npm test
EG:
TWITTER_CONSUMER_KEY=foo \
TWITTER_CONSUMER_SECRET=bar \
TWITTER_BEARER_TOKEN=baz \
npm test
or disable end-to-end tests like so:
TWITTER_DISABLE_E2E=1 npm test
The process described here has several goals:
- Maintain quality
- Fix problems that are important to users
- Enable a sustainable system for maintainers to review contributions
Please follow these steps to have your contribution considered by the maintainers:
- Follow all instructions in the template
- Format your code (
npm run lint:fix
) - After you submit your pull request, verify that all
status checks are
passing
What if the status checks are failing?
If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.