Skip to content
vance edited this page Mar 24, 2023 · 2 revisions

Advice Generator App

Development guidelines

Branches

Active branches

  • main is the default and currently deployed on GitHub Pages
  • feature/layout-mobile is the main branch to use for editing the CSS. It's named this way because we're treating the mobile layout as the 'default' CSS of the site, as opposed to the desktop layout.
  • feature/layout-desktop should be used for media queries or other CSS edits to add responsiveness
  • feature/api
  • feature/readme
  • feature/dice-button can be used for any CSS related to the dice button, I guess?
  • feature/html-elements should be used for any changes that alter the HTML tags in index.html

New branches

When you should make a new branch:

  • You're working on something that doesn't fall under an existing branch
  • What you're doing could fall under an existing branch, but it currently has an open pull request, or someone else is actively working on that branch right now. (I believe this is recommended because it helps prevent unexpected changes or overwriting each other's commits)

Please name branches in one of these formats:

  • feature/<NAME-OF-FEATURE> when you're adding/extending something
  • hotfix/<NAME-OF-PROBLEM> when you're fixing a bug or mistake in existing code

Other tips

When you're about to start working on a feature (especially if you're not already assigned to an issue for it), it's good to say so on Discord, and say what branch you're doing it on. Keeping track of who's working on what will help us avoid merge conflicts from having multiple people editing the same things at the same time.

Commits

Avoid pushing a commit directly onto main.

Let's aim to use the principle of "atomic commits" and have each commit address only one topic. If you're about to use the word "and" in your commit message, that's a hint that you might want to split it up into separate commits.

It's recommended to phrase commit messages in the present tense, or to imagine that your message finishes the sentences "This commit will...": Add styles instead of Added styles

It's great to use multi-line commit messages to explain why you did something! Instead of git commit -m "msg", you can run just git commit without the -m argument and it will open a text editor for you to enter your commit message. Use the top line for the short commit message as usual, but then if you hit enter twice you can write more details down on the third line, and Git will store that as an extra description of the commit.

Video with advice about commits

Style

I (Vance) don't feel like we need to worry about this too much right now, but it's worth noting that Nikki uses Prettier, which is a code formatter that's available as a VS Code extension. If we all used Prettier then it would make our formatting more consistent and help avoid diffs caused by formatting (and I actually have seen open-source projects before that specifically require all contributors to use Prettier). Shrug. I kinda prefer VS Code's built-in formatter/don't want to add more extensions because my PC is very slow lol, but if we decide we want everyone to use the same formatting, then Prettier is probably the best way to do that.

Clone this wiki locally