Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : Added markdown-toc package to auto-generate toc with husky pre commit hook. #1280

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
npm run format:fix
npm run lint:fix
npm run typecheck
npm run update-toc
palisadoes marked this conversation as resolved.
Show resolved Hide resolved

git add .
18 changes: 18 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Contributor Covenant Code of Conduct

# Table of Contents

<!-- toc -->

- [Our Pledge](#our-pledge)
- [Our Standards](#our-standards)
- [Enforcement Responsibilities](#enforcement-responsibilities)
- [Scope](#scope)
- [Enforcement](#enforcement)
- [Enforcement Guidelines](#enforcement-guidelines)
- [1. Correction](#1-correction)
- [2. Warning](#2-warning)
- [3. Temporary Ban](#3-temporary-ban)
- [4. Permanent Ban](#4-permanent-ban)
- [Attribution](#attribution)

<!-- tocstop -->

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
Expand Down
16 changes: 15 additions & 1 deletion CODE_STYLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Talawa Admin Code Style

For Talawa Admin, most of the rules for the code style have been enforced with ESLint, but this document serves to provide an overview of the Code style used in Talawa Admin and the Rationale behind it.
Expand All @@ -7,6 +6,21 @@ The code style must be strictly adhered to, to ensure that there is consistency

code style should not be changed and must be followed.

# Table of Contents

<!-- toc -->

- [Tech Stack](#tech-stack)
- [Component Structure](#component-structure)
- [Code Style and Naming Conventions](#code-style-and-naming-conventions)
- [Test and Code Linting](#test-and-code-linting)
- [Folder/Directory Structure](#folderdirectory-structure)
- [Sub Directories of `src`](#sub-directories-of-src)
- [Imports](#imports)
- [Customising Bootstrap](#customising-bootstrap)

<!-- tocstop -->

## Tech Stack

- Typescript
Expand Down
26 changes: 14 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ If you are new to contributing to open source, please read the Open Source Guide

## Table of Contents

- [Contributing to Talawa-Admin](#contributing-to-talawa-admin)
- [Table of Contents](#table-of-contents)
- [Code of Conduct](#code-of-conduct)
- [Ways to Contribute](#ways-to-contribute)
- [Our Development Process](#our-development-process)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Branching Strategy](#branching-strategy)
- [Conflict Resolution](#conflict-resolution)
- [Contributing Code](#contributing-code)
- [Internships](#internships)
- [Community](#community)
<!-- toc -->

- [Code of Conduct](#code-of-conduct)
- [Ways to Contribute](#ways-to-contribute)
- [Our Development Process](#our-development-process)
- [Issues](#issues)
- [Pull Requests](#pull-requests)
- [Branching Strategy](#branching-strategy)
- [Conflict Resolution](#conflict-resolution)
- [Contributing Code](#contributing-code)
- [Internships](#internships)
- [Community](#community)

<!-- tocstop -->

## Code of Conduct

Expand Down
11 changes: 11 additions & 0 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Documentation
Welcome to our documentation guide. Here are some useful tips you need to know!

# Table of Contents

<!-- toc -->

- [Where to find our documentation](#where-to-find-our-documentation)
- [How to use Docusaurus](#how-to-use-docusaurus)
- [Other information](#other-information)

<!-- tocstop -->

## Where to find our documentation

Our documentation can be found in ONLY TWO PLACES:
Expand Down
57 changes: 28 additions & 29 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ This document provides instructions on how to set up and start a running instanc

# Table of Contents

- [Talawa-Admin Installation](#talawa-admin-installation)
- [Table of Contents](#table-of-contents)
<!-- toc -->

- [Prerequisites for Developers](#prerequisites-for-developers)
- [Installation](#installation)
- [Clone This Repository](#clone-this-repository)
- [Change Directory into the Cloned Repo](#change-directory-into-the-cloned-repo)
- [Setting up NPM](#setting-up-npm)
- [Setting up this repository](#setting-up-this-repository)
- [Setting up npm](#setting-up-npm)
- [Installing required packages/dependencies](#installing-required-packagesdependencies)
- [Configuration](#configuration)
- [Creating .env file](#creating-env-file)
- [Setting up REACT\_APP\_TALAWA\_URL in .env file](#setting-up-react_app_talawa_url-in-env-file)
- [Setting up REACT\_APP\_RECAPTCHA\_SITE\_KEY in .env file](#setting-up-react_app_recaptcha_site_key-in-env-file)
- [Setting up REACT_APP_TALAWA_URL in .env file](#setting-up-react_app_talawa_url-in-env-file)
- [Setting up REACT_APP_RECAPTCHA_SITE_KEY in .env file](#setting-up-react_app_recaptcha_site_key-in-env-file)
- [Post Configuration Steps](#post-configuration-steps)
- [Running Talawa-Admin](#running-talawa-admin)
- [Accessing Talawa-Admin](#accessing-talawa-admin)
Expand All @@ -29,6 +28,8 @@ This document provides instructions on how to set up and start a running instanc
- [pre-commit hook](#pre-commit-hook)
- [post-merge hook](#post-merge-hook)

<!-- tocstop -->

# Prerequisites for Developers

We recommend that you follow these steps before beginning development work on Talawa-Admin:
Expand All @@ -39,28 +40,28 @@ We recommend that you follow these steps before beginning development work on Ta
The INSTALLATION.md files in both repositories show you how. The Talawa-API INSTALLATION.md will also show you the Organization URL to use access Talawa Admin.

# Installation
You will need to have copies of your code on your local system. Here's how to do that.
## Clone This Repository

First you need a local copy of `talawa-admin`. Run the following command in the directory of choice on your local system.

```
git clone https://github.com/PalisadoesFoundation/talawa-admin
```
You will need to have copies of your code on your local system. Here's how to do that.

This will download a local copy of `talawa-admin` in that directory.
## Setting up this repository

## Change Directory into the Cloned Repo
First you need a local copy of `talawa-admin`. Run the following command in the directory of choice on your local system.

Right after cloning the repo you can change the directory of your current `terminal(shell)` to the root directory of cloned repository using this command:
1. Navigate to the folder where you want to setup the repository. Here, I will set it up in a folder called `talawa`.
2. Navigate to the folder and open a terminal in this folder (you can right-click and choose appropiate option based onn your OS). Next, we'll fork and clone the `talawa-admin` repository.
3. Navigate to [https://github.com/PalisadoesFoundation/talawa-admin/](hhttps://github.com/PalisadoesFoundation/talawa-admin/) and click on the `fork` button. It is placed on the right corner opposite the repository name `PalisadoesFoundation/talawa-admin`.
4. You should now see `talawa-admin` under your repositories. It will be marked as forked from `PalisadoesFoundation/talawa-admin`
5. Clone the repository to your local computer (replacing the values in `{{}}`):

```
cd talawa-admin
$ git clone https://github.com/{{YOUR GITHUB USERNAME}}/talawa-admin.git
```

This will setup the repository and the code files locally for you. For more detailed instructions on contributing code, and managing the versions of this repository with Git, checkout [CONTRIBUTING.md here](./CONTRIBUTING.md)

**NOTE:** `All the commands we're going to execute in the following instructions will assume you are in the root directory of the cloned talawa-admin project. If you fail to do so, the commands will not work.`

## Setting up NPM
## Setting up npm

If you've followed the previous steps you should have already set up node.js on your system. [Click here](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) for the official setup guide for npm.

Expand All @@ -71,8 +72,11 @@ Run the following command to install the packages and dependencies required by `
```
npm install --legacy-peer-deps
```

# Configuration

It's important to configure Talawa-Admin. Here's how to do it.

## Creating .env file

A file named .env is required in the root directory of talawa-admin for storing environment variables used at runtime. It is not a part of the repo and you will have to create it. For a sample of `.env` file there is a file named `.env.example` in the root directory. Create a new `.env` file by copying the contents of the `.env.example` into `.env` file. Use this command:
Expand All @@ -93,7 +97,7 @@ Follow the instructions from section [Setting up REACT_APP_TALAWA_URL in .env fi

## Setting up REACT_APP_TALAWA_URL in .env file

Add the endpoint for accessing talawa-api graphql service to the variable named `REACT_APP_TALAWA_URL` in the `.env` file.
Add the endpoint for accessing talawa-api graphql service to the variable named `REACT_APP_TALAWA_URL` in the `.env` file.

```
REACT_APP_TALAWA_URL="http://API-IP-ADRESS:4000/graphql/"
Expand Down Expand Up @@ -126,6 +130,7 @@ REACT_APP_RECAPTCHA_SITE_KEY="this_is_the_recaptcha_key"
```

# Post Configuration Steps

It's now time to start Talawa-Admin and get it running

## Running Talawa-Admin
Expand All @@ -148,12 +153,12 @@ http://localhost:3000/

The first time you navigate to the running talawa-admin's website you'll land at talawa-admin registration page. Sign up using whatever credentials you want and create the account. Make sure to remember the email and password you entered because they'll be used to sign you in later on.


## Talawa-Admin Login

Now sign in to talawa-admin using the `email` and `password` you used to sign up.

# Testing

It is important to test our code. If you are a contributor, please follow these steps.

## Running tests
Expand All @@ -177,7 +182,6 @@ You don't need to re-run the `npm run jest-preview` command each time, simply ru

![Debugging Test Demo](./public/images/jest-preview.webp)


## Linting code files

You can lint your code files using this command:
Expand All @@ -188,30 +192,25 @@ npm run lint:fix

## Husky for Git Hooks


We are using the package `Husky` to run git hooks that run according to different git workflows.

<br/>

#### pre-commit hook
We run a pre-commit hook which automatically runs code quality checks each time you make a commit and also fixes some of the issues. This way you don't have to run them manually each time.

We run a pre-commit hook which automatically runs code quality checks each time you make a commit and also fixes some of the issues. This way you don't have to run them manually each time.

If you don't want these pre-commit checks running on each commit, you can manually opt out of it using the `--no-verify` flag with your commit message as shown:-

git commit -m "commit message" --no-verify

<br/>


#### post-merge hook

We are also running a post-merge(post-pull) hook which will automatically run "npm install --legacy-peer-deps" only if there is any change made to pakage.json file so that the developer has all the required dependencies when pulling files from remote.


If you don't want this hook to run, you can manually opt out of this using the `no verify` flag while using the merge command(git pull):

git pull --no-verify
git pull --no-verify

<br/>

24 changes: 12 additions & 12 deletions ISSUE_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ In order to give everyone a chance to submit a issues reports and contribute to

___
## Table of Contents
<!-- TOC -->

- [Issue Report Guidelines](#issue-report-guidelines)
- [Table of Contents](#table-of-contents)
- [Issue Management](#issue-management)
- [New Issues](#new-issues)
- [Existing Issues](#existing-issues)
- [Feature Request Issues](#feature-request-issues)
- [Monitoring the Creation of New Issues](#monitoring-the-creation-of-new-issues)
- [General Guidelines](#general-guidelines)

<!-- /TOC -->

<!-- toc -->

- [Issue Management](#issue-management)
- [New Issues](#new-issues)
- [Existing Issues](#existing-issues)
- [Feature Request Issues](#feature-request-issues)
- [Monitoring the Creation of New Issues](#monitoring-the-creation-of-new-issues)
- [General Guidelines](#general-guidelines)

<!-- tocstop -->

___
## Issue Management

Expand Down
12 changes: 12 additions & 0 deletions PR_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@

In order to give everyone a chance to submit a pull request and contribute to the Talawa project, we have put restrictions in place. This section outlines the guidelines that should be imposed upon pull requests in the Talawa project.

# Table of Contents

<!-- toc -->

- [Pull Requests and Issues](#pull-requests-and-issues)
- [Linting and Formatting](#linting-and-formatting)
- [Testing](#testing)
- [Pull Request Processing](#pull-request-processing)
- [Only submit PRs against our `develop` branch, not the default `main` branch](#only-submit-prs-against-our-develop-branch-not-the-default-main-branch)

<!-- tocstop -->

## Pull Requests and Issues

1. Do not start working on any open issue and raise a PR unless the issue is assigned to you. PRs that don't meet these guidelines will be closed.
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ Core features include:

`talawa` is based on the original `quito` code created by the [Palisadoes Foundation][pfd] as part of its annual Calico Challenge program. Calico provides paid summer internships for Jamaican university students to work on selected open source projects. They are mentored by software professionals and receive stipends based on the completion of predefined milestones. Calico was started in 2015. Visit [The Palisadoes Foundation's website](http://www.palisadoes.org/) for more details on its origin and activities.

# Table of Contents

<!-- toc -->

- [Talawa Components](#talawa-components)
- [Documentation](#documentation)
- [Installation](#installation)

<!-- tocstop -->

# Talawa Components

`talawa` has these major software components:
Expand All @@ -37,4 +47,4 @@ Core features include:

# Installation

[Follow this guide](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/INSTALLATION.md)
[Follow this guide](https://github.com/PalisadoesFoundation/talawa-admin/blob/develop/INSTALLATION.md)
Loading
Loading