Skip to content

Latest commit

 

History

History
136 lines (102 loc) · 5.43 KB

CONTRIBUTING.md

File metadata and controls

136 lines (102 loc) · 5.43 KB

Contributing Guide

Important Resources

General Information

Directory Structure

.
├── cosmicalc.css
├── data
│   ├── am.json
│   ├── bd.json
│   ├── bs.json
│   ├── cartridge.json
│   ├── cwp.json
│   ├── defaultwb.json
│   ├── fcac.json
│   ├── fixed.json
│   ├── hdac.json
│   ├── hd.json
│   ├── lg.json
│   ├── mainwp.json
│   ├── material.json
│   ├── subwp.json
│   ├── tuneup.json
│   └── wb.json
├── img
│   ├── favicon.ico
│   ├── frame
│   │   ├── LM.gif
│   │   ├── RM.gif
│   │   └── Thumbs.db
│   ├── loading.gif
│   ├── s1.png
│   └── Thumbs.db
├── index.html
├── js
│   ├── cosmicalc.js
│   └── jquery.min.js
└── varies.html
  • cosmicalc.css is the stylesheet of the application
  • data/ contains all in-game data used for simulation
  • img/ contains all images used
  • index.html is the entry point of the application
  • js/ contains the logic behind the application

How to contribute

Getting Started

If you are familiar with Git and GitHub, you may skip this section.

Make sure you have Git installed.

Note that there is a user-friendly GUI client GitHub Desktop as well if you don't want to use the command line.

Since there is already an official guide using GitHub Desktop. I will provide only commands here to help those not using the GUI client. The process should be similar so you can compare it step-by-step.

Glossary

  • Repository: A repository contains all of the project files, information, documentations, and also each file's revision history. Simply imagine it as the project's folder.
  • Fork: A personal copy of a repository. You can freely make changes to your own fork without affecting the main repository.
  • Clone: A copy of a repository which lives on your computer instead of online. We use Git to track changes and sync between your local clone and the online repository.
  • Commit: A commit is an individual change made to a file (or a set of files). It is similar to saving a file, but instead of just saving, Git creates a unique ID to help you keep track of each "revision" of the project.
  • Pull Request: To submit the changes (or to be precise, commits) you've made on your fork to the main repository, you create a Pull Request. This shows us the difference between your fork and the main repository.
  • Merge: Once your pull request is approved, changes made in your fork will be merged into the main repository.

Fork this repository

Make sure you are signed in. Click the Fork button on the top-right corner of this repository.

The forked repository will be under your name. For example, if your username is manimo, your fork will be at https://github.com/manimo/cosmiccalc/

Clone your fork

On your fork, click the Clone button and copy the url.

In the command line, run the following command:

git clone <fork-url>

For example, if the copied url is https://github.com/manimo/cosmiccalc.git:

git clone https://github.com/manimo/cosmiccalc.git

This will create a new directory named cosmiccalc/ under your current one. It contains the exact copy of this project.

Make and commit your changes

Simply edit the files to your liking. You can test if things work properly by opening index.html in your browser.

(Note: does not work on Chrome because it prevents loading local files for security reasons.)

After you are done. Open the command line inside the project directory (cosmiccalc/) and try this command:

git status

This will show you if any files have been changed. You can review what you did and make sure everything is correct.

If you are satisfied with the changes, commit your changes with the following commands:

git add .
git commit -m "write what you did here"

In the commit message ("write what you did here"), you can write anything as a note about the changes made in the commit.

After creating a commit, running git status will tell you that the directory is clean, meaning that no changes have been made after your latest commit.

Push your changes to GitHub

Time to sync up your clone with your online repository! If you run git status, it will tell you that you are ahead. This simply means that your local clone has commits which are not on GitHub.

Simply run:

git push origin master

Your forked repository is now in sync with your local clone.

Submitting Changes

Create a pull request. Click compare across fork and choose your fork as the head fork. We are merging commits from the head fork to the base fork.

In your pull request, briefly explain what you did. We will review your changes, possibly edit/request an edit, and finally merge your changes into the main repository.