<commit_before># re-frame-template

Leiningen template for [reagent](https://github.com/reagent-project/reagent) web apps that implements the [re-frame](https://github.com/Day8/re-frame) pattern.

Through the use of profiles, this template lets the developer pick and choose what is included in their application.

## Usage

The base template includes:

* [re-frame](https://github.com/Day8/re-frame)
* [figwheel](https://github.com/bhauman/lein-figwheel)

To create an application with the base template:

```
lein new re-frame <project-name>
```

The optional profiles include:

* [garden](https://github.com/noprompt/garden) (`+garden`)
* [re-com](https://github.com/Day8/re-com) (`+re-com`)
* [secretary](https://github.com/gf3/secretary) (`+routes`)
* [cljs.test](https://groups.google.com/forum/#!topic/clojure/gnCl0CySSk8) (`+test`)
* [compojure](https://github.com/weavejester/compojure) (`+handler`)

To add a profile to the base template, just append the profile name (let's use `+re-com` as an example):

```
lein new re-frame <project-name> +re-com
```

Any combination of profiles can be added at once (let's add all the profiles as an example):

```
lein new re-frame <project-name> +garden +re-com +routes +test
```

## Development Mode

### Compile css (if using +garden):

Compile css file once.

```
lein garden once
```

Automatically recompile css file on change.

```
lein garden auto
```

### Run application:

```
lein clean
lein figwheel dev
```

Figwheel will automatically push cljs changes to the browser.

Wait a bit, then browse to [http://localhost:3449](http://localhost:3449).

### Run tests (if using +test):

```
lein clean
lein cljsbuild auto test
```

*Note: This requires [phantomjs](https://www.npmjs.com/package/phantomjs).*

## Production Build

```
lein clean
lein cljsbuild once min
```

## Contributing

Contributions are welcomed!  To add a new profile, this is what I'd recommend:

1. Add a file with the name of the profile [here](https://github.com/Day8/re-frame-template/tree/master/src/leiningen/new/options)
2. Look at the existing options in that folder for inspiration for what to include in that file
3. Update [project.clj](https://github.com/Day8/re-frame-template/blob/master/src/leiningen/new/re_frame.clj) with the profile
4. Add any new files [here](https://github.com/Day8/re-frame-template/tree/master/src/leiningen/new/re_frame) and use the {{ var-name }} syntax as needed
5. Update the [README](https://github.com/Day8/re-frame-template/tree/master/src/leiningen/new/re_frame) that will result when the template is used, as well as the top-level [README](https://github.com/Day8/re-frame-template/blob/master/README.md) for re-frame-template itself
6. In a terminal, at the root of re-frame-template, run `lein install`
7. Locally test that your profile works, `lein new re-frame <app-name> +<profile-name>`
8. Add your profile to [create-templates](https://github.com/Day8/re-frame-template/blob/master/create-templates.sh) and run the script to make sure the other profiles didn't break.

Desired profiles:

* `+heroku`

## On customizing a template:
1. Change `project.clj` to your own template name
2. Change `src/leiningen/new/<project_name.clj>` to your own project name.
3. Open that file, change the namespace to yours and rename the entrypoint function to your project's name as well.
4. In this project, you need to add any new files you want to build to `src/leiningen/new/options/base.clj`.

## License

```
The MIT License (MIT)<commit_msg>tutorial site<commit_after># re-frame-template

Leiningen template for [reagent](https://github.com/reagent-project/reagent) web apps that implements the [re-frame](https://github.com/Day8/re-frame) pattern.

Through the use of profiles, this template lets the developer pick and choose what is included in their application.

## Usage

The base template includes:

* [re-frame](https://github.com/Day8/re-frame)
* [figwheel](https://github.com/bhauman/lein-figwheel)

To create an application with the base template:

```
lein new re-frame <project-name>
```

The optional profiles include:

* [garden](https://github.com/noprompt/garden) (`+garden`)
* [re-com](https://github.com/Day8/re-com) (`+re-com`)
* [secretary](https://github.com/gf3/secretary) (`+routes`)
* [cljs.test](https://groups.google.com/forum/#!topic/clojure/gnCl0CySSk8) (`+test`)
* [compojure](https://github.com/weavejester/compojure) (`+handler`)

To add a profile to the base template, just append the profile name (let's use `+re-com` as an example):

```
lein new re-frame <project-name> +re-com
```

Any combination of profiles can be added at once (let's add all the profiles as an example):

```
lein new re-frame <project-name> +garden +re-com +routes +test
```

## Development Mode

### Compile css (if using +garden):

Compile css file once.

```
lein garden once
```

Automatically recompile css file on change.

```
lein garden auto
```

### Run application:

```
lein clean
lein figwheel dev
```

Figwheel will automatically push cljs changes to the browser.

Wait a bit, then browse to [http://localhost:3449](http://localhost:3449).

### Run tests (if using +test):

```
lein clean
lein cljsbuild auto test
```

*Note: This requires [phantomjs](https://www.npmjs.com/package/phantomjs).*

## Production Build

```
lein clean
lein cljsbuild once min
```

## Contributing

Contributions are welcomed!  To add a new profile, this is what I'd recommend:

1. Add a file with the name of the profile [here](https://github.com/Day8/re-frame-template/tree/master/src/leiningen/new/options)
2. Look at the existing options in that folder for inspiration for what to include in that file
3. Update [project.clj](https://github.com/Day8/re-frame-template/blob/master/src/leiningen/new/re_frame.clj) with the profile
4. Add any new files [here](https://github.com/Day8/re-frame-template/tree/master/src/leiningen/new/re_frame) and use the {{ var-name }} syntax as needed
5. Update the [README](https://github.com/Day8/re-frame-template/tree/master/src/leiningen/new/re_frame) that will result when the template is used, as well as the top-level [README](https://github.com/Day8/re-frame-template/blob/master/README.md) for re-frame-template itself
6. In a terminal, at the root of re-frame-template, run `lein install`
7. Locally test that your profile works, `lein new re-frame <app-name> +<profile-name>`
8. Add your profile to [create-templates](https://github.com/Day8/re-frame-template/blob/master/create-templates.sh) and run the script to make sure the other profiles didn't break.

Desired profiles:

* `+heroku`

## On customizing a template:
1. Change `project.clj` to your own template name
2. Change `src/leiningen/new/<project_name.clj>` to your own project name.
3. Open that file, change the namespace to yours and rename the entrypoint function to your project's name as well.
4. In this project, you need to add any new files you want to build to `src/leiningen/new/options/base.clj`.

Learned from http://jr0cket.co.uk/2015/03/clojure-templates-are-easy-with-leiningen.html

## License

```
The MIT License (MIT)
{'fraction_non_alphanumeric': 0.13619769727604605, 'fraction_numerical': 0.009969109800617803, 'mean_word_length': 4.449885233358837, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 32, 'lorem ipsum': 0, 'www.': 2, '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': '3447056', 'n_tokens_mistral': 2400, 'n_tokens_neox': 2270, 'n_words': 749}