Skip to content

Contributing To Source Code

Can Cellek edited this page Feb 28, 2023 · 2 revisions

Thanks for your interest in contributing Dev Cheats! This guideline is more detailed version of contribution guideline, including data structures to help you speed up the process.

In order to contribute to the source of the project

  1. Fork the repository and create a new branch for your feature or enhancement.
  2. Use commit messages guideline for your commits.
  3. Send a pull request to the main branch using the pull request guideline.

Adding / Editing Documents

I really appreciate contributions in the form of new documents to the project. If you'd like to add a new document, please follow these steps:

Adding Document

  1. Create a new json file in the public/data/docs folder using the app's name as the file name. Please use kebab-case for the file name. You can use the template.json file as a starting point.
  2. Add the name of the new command to the public/data/list.json file to enable autosuggest functionality.

Editing Documents

Locate the document you want to edit within public/data/docs folder

Data Structures

Main

{
   "meta":{
      "title":"git", // CLI App name in kebab-case (ie. git)
      "contribs":[ "github_username1", "github_username2" ] // Contributor's GitHub usernames
      "complexity":[ "Basic", "Normal", "Advanced" ], // Complexity of the commands can be configured here
   },
   "categories":[
      {
         // Category data explained below. Multiple categories are allowed
      }
   ]
}

Category

{
   "name":"Create", // Category name (such Create for git init etc)
   "color":"blue",  // Category color
   "commands":[
      {
         // Command data explained below. Multiple commands for this catetgory are allowed
      }
   ]
}

Commands

{
   "name":"clone", // Command name
   "description":"Example command 3",          // Command description
   "url":"https://git-scm.com/docs/git-clone", // If available, url to original documentation (ie. git-scm)
   "keywords":"create clone", // Search keywords (category name, command name)     
   "complexity":2,            // Command complexity (Between 0 and 2 inclusive for Basic, Normal, Advanced as defined above)
   "usage":[
      {
         // Usage data explained below. Multiple entries for variations are allowed
      }
   ]
}

Command Usage

{
   "code":"git clone", // Code snippet to show
   "complexity":0,     // Usage complexity (Between 0 and 2 inclusive for Basic, Normal, Advanced as defined above)
   "description":"Clean and short description of what clone command does" // Yup...
}

New Enhancements

Any new features or enhancements should be discussed in an issue first. If you'd like to work on a new feature or enhancement, please follow these steps:

  1. Create a new issue and describe the feature or enhancement you'd like to work on.
  2. Wait for the issue to be approved by a maintainer.
  3. Fork the repository and create a new branch for your feature or enhancement.
  4. Use commit messages guideline for your commits.
  5. Send a pull request to the main branch using the pull request guideline.

Commit and PR Guidelines

Commit Messages

When writing commit messages, please follow these guidelines:

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Limit the first line to 72 characters or less
  • Reference issues and pull requests liberally after the first line

Pull Requests

While creating a Pull Request, please use the provided the required template and keep the following guidelines in mind:

  • Do not change design into a complicated and / or overwhelming experience
  • Do not include issue numbers in the PR title if any
  • If applicable, include screenshots or animated GIFs to showcase new features