filipedeschamps / rss-feed-emitter

Super RSS News Feed aggregator written in Node.js and ES6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1. What to do first when creating a JavaScript module from scratch

filipedeschamps opened this issue · comments

This is a very nice question and there's no doubt that you can approach this problem in very different ways.

I've compiled below an ordered list with the most natural path you can take, but probably most of the developers in the world won't get to the finish line if they don't understand the most important thing I consider in development:

How to not give up halfway

Give up in the middle or even in the near end of the development of a module is more popular than you can imagine. This happens not due do the lack of development skills, but to the lack of commitment.

Most people try to deliver a module as fast as they can for one simple reason: if they stop that development sprint, the module is doomed. They bind the development energy source into motivation, and this is a strong but short lifetime energy. You have to bind your development into a long lasting energy, like discipline.

Github helps you in an amazing way with the Contributions calendar. Try to keep a streak in it, even if you have only 5 minutes in the day to create an issue to keep the gamification going inside your head. Yes, create an issue and do nothing more in a day will help you infinitely more than do nothing. If you don't believe me, read Thinking, Fast and Slow book to understand how your brain works, specially the mental shotgun effect. It's amazing.

But anyway, try to find any strategy you think it's better for you.

What your module will do exactly

Well, you don't need to write down a huge specification of what your module will do, but keep in your mind the main feature and, specially, what's going to be the user experience while using it.

If this is your first module, don't try to solve a huge and complex problem, or even a real world problem. Sometimes, it's better to reinvent the wheel because if you find yourself blocked somehow, you can always take a look on how other people solved the problem to get some inspiration.

Bottom line is: don't mess with your commitment, and try to solve something simple at first.

Next step

2. Create a Github repository

Index

  1. What to do first when creating a JavaScript module from scratch
  2. Create a Github repository
  3. Download it locally, add a package.json and publish it to npm
  4. Scratch the public interface of your module
  5. Try to scratch an overview of the internals
  6. Create the path structure
  7. Configure ESLint and EditorConfig files
  8. Create the skeleton of the public interface
  9. Add transpiler dependencies
  10. Create your first automated test to cover the public interface
  11. Generate code coverage reports
  12. Configure Code Climate for code coverage
  13. Configure Travis CI for automated tests
  14. Publish it to Github to test the integrations
  15. Build and Pre Publish scripts
  16. Create a release tag, merge into master and publish to npm and Github
  17. Bonus: how to watch tests with Mocha
  18. Bonus: how to mock requests in Unit Tests
  19. Bonus: Commented source code

It's great!!

Hey @filipedeschamps, great idea to create a sort of tutorial on the matter but, I must ask, why the issue format? Why not publish it in the project Wiki or even as a blog post?

Just curious, nice job! 👍

@felipegtx thanks 👍

I don't like Github's wiki format and I find issues to be more social, your can receive comments like yours, reference them better inside commits and create tags. IMHO, issues are much much more powerful than wiki has to offer.

Yea, I agree @filipedeschamps, writing this sort of thing as an issue is better than using a wiki. But like @felipegtx says, you can write it as a blog post instead. Anyway it's a great work you've accomplished. Thanks.