In between work and school, you might want to do an open source project. On the one hand, I want to share my good code to help more developers, on the other hand, I want to get feedback and grow in the open source community. If the project can get a lot of attention, it will be even better. High Star is not only an important basis to measure the reliability of the open source project, but also the Github of the project maintainer can let the company know the candidate’s open source contribution, technical enthusiasm and programming habits in advance during the recruitment process, which will gain bonus points from the interviewer.

So how can open source projects get more Star numbers? Here’s how to improve and promote your open source project by summarizing some of the lessons I’ve learned while maintaining day.js.

Target users’ pain points

The content of the open source community, bucket sorting collection Markdown notes, framework construction, cool animation effects as well as a variety of tools such as libraries, frameworks are good open source direction, but considering the project of the function, the audience, development language, and so on factors, different types of projects to implement the degree of difficulty and accepted by the community also differ in thousands ways. But if the project targets the developer’s pain points and provides a good solution, it will get more attention. One person’s energy is always limited, only more people join in, use, feedback, iteration and promotion, can form a virtuous circle of open source projects.

For example, in my work, I found that moment.js could easily handle dates and times, but the library was too bulky to pack, and moving to several other lightweight time libraries in the community would add new learning costs and migration work. So the goal of day. js was to create a time and date library with the same API design, same functionality, and lighter weight as moment.js.

Choose an Open Source license

The open source agreement can be a detail that is easily overlooked when compared to the project’s own code, documentation, etc. An open source license is a license for software that describes the rights and obligations of users who acquire your open source code.

I made the mistake of not recognizing the importance of open source licenses and not adding any to the project in the early stages of the promotion. When the English community, which is more aware of copyright, publicized the project, they encountered great resistance and all kinds of doubts. They thought such a project was unprofessional and did not dare to try it easily, thus missing some initial users in vain.

For details on how to Choose an open source License for your project, see Choose License. If you want your project to be as widely promoted, used, and distributed as possible, consider choosing an open source license with a high degree of distribution freedom.

Specification submission record

It is necessary to have a canonical Git commit record, not only to give participants in a multi-party development a better understanding of the iteration history and progress of the project, but also to quickly locate and find the commit record of problematic code when problems occur. At the same time, we can also use tools to automatically generate update instructions (CHANGELOG) according to the submission record, which is convenient for users to know the specific content of each update and saves the project maintainer the pain of manual update. Git Commit Message Conventions One of the most used Git Commit Conventions in the front-end community is the Angular Commit Message Conventions. A Commit format includes Header, Body, and Footer:

<type>(<scope>): <subject>

<body>

<footer>
Copy the code

But it would be an exhausting and forgettable chore if we had to type a Commit Message every time we committed code. Two tools are recommended to assist us:

  • Use Commitizen for interactive Commit filling, as shown below. Simply follow the prompts to select the updated type and fill in the necessary information to automatically generate a compliant Commit record.
  • Use @semantic-release/ Changelog to automatically incrementally generate Changelog based on the type in Commit;

Semantic version number

Each community has its own version number specification, do not arbitrarily fill in the version number because it is their own open source project, otherwise it may cause unnecessary annoyance to users. Most packages in the NPM ecosystem use Semantic Versioning, i.e. version number A.B.C, where A is the major version number, B is the minor version number, and C is the revision number.

If an open source project commits a Commit as described above, you can use a Semantic-Release to automatically update the version number and release. This tool will determine whether the Commit Message is different. Submissions containing BREAKING CHANGE increase the large version number.

Promotion and analysis

No matter how beautiful a project is, if the author is not well known, and there is not much promotion, the project is likely to be lost among the many open source projects. In addition to promoting in the well-known domestic development community, I hope you don’t ignore the foreign communities and forums. In order to get more attention, it is necessary for us to internationalize our open source projects to help more developers. English is the lingua franca of software developers, and translating an English README is the first step toward internationalization.

In promoting Day.js, I’ll tweet about the features of my project in the hope that Twitter MOBS will give it a try (but be polite and don’t be too hard on ads) under tweets about the Date function and the moment. js library. A Star or a supportive tweet from a community celebrity can spread quickly on social networks, bringing huge traffic and attention to the project.

After each major function update or centralized promotion, we should understand the promotion effect and user satisfaction through the change of the project’s Pull Request, Issue, Star, Download Count and other data. Front-end engineers know that a visual graph of data helps us understand data better than a bunch of numbers.

Npmjs.com, for example, shows a line chart of changes in downloads to analyze how projects are being used and relied upon. Bestofjs.org shows a calendar color block diagram of the project’s Star number changes, with deeper squares indicating faster increments. The dark patches in the figure below are several successful promotions of the project, while some promotions did not bring great growth, so it is necessary to summarize experience and improve methods.

It’s not hard to start an open source project. Be brave and take the first step. However, it is not easy to maintain the open source project continuously. We need to find the motivation to maintain the project, provide necessary support to users, collect feedback from users, and constantly improve the project, thus forming a complete product closed loop to promote the continuous iteration and update of the project.

Of course, the number of Star is not so important. We have enriched the content of the open source community, helped more developers, expanded our vision and improved our ability from the experience of open source, which is more valuable harvest.

P.S. If you love the front end and open source, welcome to join our team. Here we have the open source UI library Element, a publishing system that has taken over 98% of the company’s front end projects, a static resource management platform that is better than JSDeliver and more interesting projects waiting for you. Please contact [email protected], ele.me big front end has you more exciting.