## DO NOT USE !
# This repo has been replaced by [`frontend-cli`](https://github.com/theorchard/frontend-cli). 


## cookiecutter-react-webpack

Cookiecutter allows us to template out our boilerplate so we can easily create a new frontend project.


## Setup and Usage
You have two options for using this repo.

### Option 1 - Create boilerplate directly from Github

1) Create a Python virtual environment and activate it.
    ```
    python3.6 -m venv env
    source env/bin/activate
    ```
2) Install cookiecutter.
    ```
    pip3.6 install cookiecutter==1.5.1
    ```

3) Create a new react/webpack frontend project.
    ```
    cookiecutter git@github.com:theorchard/cookiecutter-react-webpack
    ```

4) Follow the prompts to enter templated values.

    If you'd like to use cookiecutter without any prompts include values for all keys in cookiecutter.json.
    ```
    cookiecutter --no-input . repo_name=pineapple description=Pineapplesauce webpack_entry_name=applesauce-bananas init_function=initApplesauceBananas
    ```

5) You can now deactivate your Python virtual environment.
    ```
    deactivate
    ```

6) Go to your new project. So, if you set "reporting" for repo_name in step 4, you can:
    ```
    cd frontend-reporting
    ```

7) Follow the instructions in the new project's README.md file to get it running.

8) Push up your new project to an empty Github repo and start coding!


### Option 2 - Fork cookiecutter-react-webpack
You will use this option when you want to contribute to the boilerplate.

```
python3.6 -m venv env
source env/bin/activate
pip3.6 install -r requirements.txt
```

To build a new project, run the following and follow the prompts.
```
cookiecutter .
```

## Contributing to React/Webpack Boilerplate
After forking this repo, you can begin to make boilerplate contributions. You will need to make sure that
you template your changes (in Jinja format) so that cookiecutter knows how to copy them.

All currently supported configurations are stored in `cookicutter.json`. Any piece of code that will need to be replaced with one of these configurations (e.g. `repo_name`) will need to be templated using `{{cookiecutter.XXXX}}`. For example, if you're adding a new file which imports from the app directory, you will need to use `{{cookiecutter.repo_name}}` in your import statement.
```
import Cowabunga from '{{cookiecutter.repo_name}}';
```

If you need to add support for new configurations, you will need to add them to `cookiecutter.json` first.
