<commit_before># react-component-template

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nkbt/help)

[![Circle CI](https://circleci.com/gh/nkbt/react-component-template.svg?style=svg)](https://circleci.com/gh/nkbt/react-component-template)
[![Coverage Status](https://coveralls.io/repos/nkbt/react-component-template/badge.svg?branch=master)](https://coveralls.io/r/nkbt/react-component-template?branch=master)
[![Dependency Status](https://david-dm.org/nkbt/react-component-template.svg)](https://david-dm.org/nkbt/react-component-template)
[![devDependency Status](https://david-dm.org/nkbt/react-component-template/dev-status.svg)](https://david-dm.org/nkbt/react-component-template#info=devDependencies)

Base for React Components

## Reason

Developing and publishing multiple React components requires a lot of work to keep them all at the same code, ops, best-practices level. Most of configs are often copy-pasted. If one project updated, for exapmle, .eslintrc, other projects should follow to keep codebase consistent. Having growing number of components leads to a more diverged codebase that is exponentially harder to manage.


## Contents

- React module boilerplate dependencies and scripts
- .gitignore and .npmignore
- CircleCI config
- ESLint config - Nik Butenko
- Empty React component
- Example
- Tests and coverage


## Usage

1. Add as remote

  ```sh
  git remote add template <EMAIL>:nkbt/react-component-template.git
  ```

2. Merge to existing repo

  ```sh
  git merge --no-ff template/master
  ```

3. Fix conflicts
4. If update needed, repeat


# Template-based component features

## Installation

Considering the name is `react-my-component` and it is published to NPM

### NPM

```sh
npm install --save react-my-component
```


### Bower:
```sh
bower install --save https://npmcdn.com/react-my-component/build/react-my-component.js
```

or in `bower.json`

```json
{
  "dependencies": {
    "react-motion": "https://npmcdn.com/react-my-component/build/react-my-component.js"
  }
}
```

then include as
```html
<script src="bower_components/react-my-component/index.js"></script>
```


### 1998 Script Tag:
```html
<script src="https://npmcdn.com/react-my-component/build/react-my-component.js"></script>
(Module exposed as `ReactMyComponent`)
```


## Demo

Publishing on `gh-pages`:
- do a build
- allow `/example` in `.gitignore`
- commit and push to `gh-pages`<commit_msg>Typos in README<commit_after># react-component-template

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nkbt/help)

[![Circle CI](https://circleci.com/gh/nkbt/react-component-template.svg?style=svg)](https://circleci.com/gh/nkbt/react-component-template)
[![Coverage Status](https://coveralls.io/repos/nkbt/react-component-template/badge.svg?branch=master)](https://coveralls.io/r/nkbt/react-component-template?branch=master)
[![Dependency Status](https://david-dm.org/nkbt/react-component-template.svg)](https://david-dm.org/nkbt/react-component-template)
[![devDependency Status](https://david-dm.org/nkbt/react-component-template/dev-status.svg)](https://david-dm.org/nkbt/react-component-template#info=devDependencies)

Base for React Components

## Reason

Developing and publishing multiple React components requires a lot of work to keep them all at the same code, ops, best-practices level. Most of configs are often copy-pasted. If one project updated, for example, .eslintrc, other projects should follow to keep codebase consistent. Having growing number of components leads to a more diverged codebase that is exponentially harder to manage.


## Contents

- React module boilerplate dependencies and scripts
- .gitignore and .npmignore
- CircleCI config
- ESLint config, strict version of Airbnb code style guide
- Empty React component
- Example
- Tests and coverage (Tape, Isparta)
- End-to-End tests (Nightwatch, Selenium)


## Usage

1. Add as remote

  ```sh
  git remote add template <EMAIL>:nkbt/react-component-template.git
  ```

2. Merge to existing repo

  ```sh
  git merge --no-ff template/master
  ```

3. Fix conflicts
4. If update needed, repeat


# Template-based component features

## Installation

Considering the name is `react-my-component` and it is published to NPM

### NPM

```sh
npm install --save react-my-component
```


### Bower:
```sh
bower install --save https://npmcdn.com/react-my-component/build/react-my-component.js
```

or in `bower.json`

```json
{
  "dependencies": {
    "react-my-component": "https://npmcdn.com/react-my-component/build/react-my-component.js"
  }
}
```

then include as
```html
<script src="bower_components/react-my-component/index.js"></script>
```


### 1998 Script Tag:
```html
<script src="https://npmcdn.com/react-my-component/build/react-my-component.js"></script>
(Module exposed as `ReactMyComponent`)
```


## Demo

Publishing on `gh-pages`:
- do a build
- allow `/example` in `.gitignore`
- commit and push to `gh-pages`
{'fraction_non_alphanumeric': 0.1462824904291759, 'fraction_numerical': 0.004029820672980053, 'mean_word_length': 4.460946094609461, 'pattern_counts': {'":': 4, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 26, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2511255', 'n_tokens_mistral': 1695, 'n_tokens_neox': 1564, 'n_words': 400}