Skip to content

Commit 438aaae

Browse files
authored
Merge pull request #3 from superfaceai/chore/prepare-to-open-repo
docs: prepare to open the repository
2 parents 86164ce + d640504 commit 438aaae

File tree

2 files changed

+86
-7
lines changed

2 files changed

+86
-7
lines changed

CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contribution Guidelines
2+
3+
We welcome contributions to our [open source project on GitHub](https://github.com/superfaceai/passport-twitter-oauth2).
4+
5+
**Please open an issue first if you want to make larger changes**
6+
7+
## Help the community
8+
9+
1. Report an Error or a Bug
10+
2. Contribute to the Documentation
11+
3. Provide Support on Issues
12+
13+
## Need help?
14+
15+
If you have any question about this project (for example, how to use it) or if you just need some clarification about anything, please open an Issue at [Issues](https://github.com/superfaceai/passport-twitter-oauth2/issues).
16+
17+
## Contributing
18+
19+
Follow these steps:
20+
21+
1. **Fork & Clone** the repository
22+
2. **Setup** the Superface passport-twitter-oauth2
23+
- Install packages with `yarn install` or `npm install`
24+
- Format code with `yarn format:fix` or `npm run format:fix`
25+
3. **Update** [CHANGELOG](CHANGELOG.md). See https://keepachangelog.com/en/1.0.0/
26+
4. **Commit** changes to your own branch by convention. See https://www.conventionalcommits.org/en/v1.0.0/
27+
5. **Push** your work back up to your fork
28+
6. Submit a **Pull Request** so that we can review your changes
29+
30+
**NOTE: Be sure to merge the latest from "upstream" before making a pull request.**
31+
32+
**NOTE: Please open an issue first if you want to make larger changes**
33+
34+
### Contribute by reporting bugs
35+
36+
If you are experiencing bug or undocumented behavior please open an Issue with bug template at [Issues](https://github.com/superfaceai/passport-twitter-oauth2/issues).
37+
38+
### Contribute to documentation
39+
40+
Help us improve the documentation, you can report typos, improve examples.
41+
42+
## Copyright and Licensing
43+
44+
The Superface passport-twitter-oauth2 open source project is licensed under the [MIT License](LICENSE).

README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ passport.use(
4949
{
5050
consumerKey: TWITTER_CONSUMER_KEY,
5151
consumerSecret: TWITTER_CONSUMER_SECRET,
52-
callbackURL: "http://127.0.0.1:3000/auth/twitter/callback",
52+
callbackURL: 'http://127.0.0.1:3000/auth/twitter/callback',
5353
},
5454
function (accessToken, refreshToken, profile, done) {
5555
User.findOrCreate({ twitterId: profile.id }, function (err, user) {
@@ -71,17 +71,52 @@ For example, as route middleware in an [Express](http://expressjs.com/)
7171
application:
7272

7373
```javascript
74-
app.get("/auth/twitter", passport.authenticate("twitter"));
74+
app.get('/auth/twitter', passport.authenticate('twitter'));
7575

7676
app.get(
77-
"/auth/twitter/callback",
78-
passport.authenticate("twitter", {
79-
failureRedirect: "/login",
80-
scope: ["tweet.read", "tweet.write", "users.read"],
77+
'/auth/twitter/callback',
78+
passport.authenticate('twitter', {
79+
failureRedirect: '/login',
80+
scope: ['tweet.read', 'tweet.write', 'users.read'],
8181
}),
8282
function (req, res) {
8383
// Successful authentication, redirect home.
84-
res.redirect("/");
84+
res.redirect('/');
8585
}
8686
);
8787
```
88+
89+
## Development
90+
91+
When developing, start with cloning the repository using `git clone https://github.com/superfaceai/passport-twitter-oauth2.git`.
92+
93+
After cloning, the dependencies must be downloaded using `yarn install` or `npm install`.
94+
95+
Now the repository is ready for code changes.
96+
97+
The `package.json` also contains scripts (runnable by calling `yarn <script-name>` or `npm run <script-name>`):
98+
99+
- `format` - format the code (use `format:fix` to run autofix)
100+
- `test` - run tests
101+
102+
## Maintainers
103+
104+
- [Jan Halama](https://github.com/janhalama)
105+
106+
## Kudos
107+
108+
- [Jared Hanson](https://github.com/jaredhanson) author of Passport.js
109+
110+
## Contributing
111+
112+
**Please open an issue first if you want to make larger changes**
113+
114+
Feel free to contribute! Please follow the [Contribution Guide](CONTRIBUTING.md).
115+
116+
Note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
117+
118+
## License
119+
120+
`@superfaceai/passport-twitter-oauth2` project is licensed under the [MIT license](LICENSE).
121+
122+
© 2022 Superface s.r.o.

0 commit comments

Comments
 (0)