From 9c6b79ace5b653d321a16e4ba3649e13a6e94169 Mon Sep 17 00:00:00 2001 From: Claudio Cortese Date: Mon, 3 Dec 2018 15:03:08 +0100 Subject: [PATCH] docs: update Readme.MD --- README.md | 103 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 136a85c..a997521 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,21 @@ # React Spy -[![GitHub contributors](https://img.shields.io/github/contributors/CloudPower97/react-spy.svg)](https://GitHub.com/CloudPower97/react-spy/graphs/contributors/) -[![made-for-react](https://img.shields.io/badge/Made%20for-React-1f425f.svg)](https://reactjs.org/) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![GitHub contributors](https://img.shields.io/github/contributors/CloudPower97/react-spy.svg?style=for-the-badge)](https://GitHub.com/CloudPower97/react-spy/graphs/contributors/) +[![made-for-react](https://img.shields.io/badge/Made%20for-React-1f425f.svg?style=for-the-badge)](https://reactjs.org/) +[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT) +[![GitHub release](https://img.shields.io/github/release/CloudPower97/react-spy.svg?style=for-the-badge)](https://GitHub.com/CloudPower97/react-spy/releases/) ## Table of Contents 1. [Overview](#Overview) -2. [Usage](#Usage) -3. [Contributing](#Contributing) - - [Linters](#Linters) - - [Testing](#Testing) - - [Commit Guidelines](#Commit-Guidelines) +2. [Install](#Install) +3. [Usage](#Usage) +4. [Contributing](#Contributing) + - [Development](#Development) + - [Linters](#Linters) + - [Testing](#Testing) + - [Commit Guidelines](#Commit-Guidelines) --- @@ -33,31 +36,43 @@ The difference here is that _React Spy_ does make internally uses of the [`Mutat --- +## Install + +`npm i @cloudpower97/react-spy` + +or + +`yarn add @cloudpower97/react-spy` + +--- + ## Usage ```javascript -import Scrollspy from 'react-spy' +import Scrollspy from '@cloudpower97/react-spy'
- - - +
... @@ -88,7 +103,27 @@ import Scrollspy from 'react-spy' Pull requests and [reporting an issue](https://github.com/CloudPower97/react-spy/issues) are always welcome :D -### Linters +### Development + +Fork and clone the repo: + +`git clone git@github.com:your-username/react-spy.git` + +Create a branch for the feature/fix: + +`git checkout -b feat:new-great-idea` + +Add tests and make them pass: + +`npm run test` + +or + +`yarn test` + +Push to your fork and submit a pull request. + +#### Linters
Prettier @@ -97,7 +132,7 @@ Pull requests and [reporting an issue](https://github.com/CloudPower97/react-spy To enforce a consistent style across the entire project we are using [`Prettier`](https://prettier.io/). -We are also using [`ESLint`](https://eslint.org/) to catch bugs and syntax errors during development and [`stylelint`](https://stylelint.io/) for CSS linting. +We are also using [`ESLint`](https://eslint.org/) to catch bugs and syntax errors during development. We run `Prettier` and `ESLint` before each commit thanks to [`Husky`](https://github.com/typicode/husky), so that you can focus on what matter the most : writing code. @@ -111,13 +146,13 @@ It will bother you only for changes it can't fix. All of the above assure us that our code base is always consistent with the rules we are using and bug free as much as possible. -### Testing +#### Testing Jest We are using [`Jest`](https://github.com/facebook/jest) and [`Enzyme`](https://github.com/airbnb/enzyme) to test our components. -### Commit Guidelines +#### Commit Guidelines We follow the [Angular Commit Guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits). @@ -125,6 +160,8 @@ Refer to their documentation for more information. Note: If you DON'T follow the [Angular Commit Guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits) you will not be able to commit your changes. +--- + ## Intersection Observer [Intersection Observer](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)