MiniScaffold, setting up a new F# project the easy way
Tags: fsharp, dotnet, dotnetcore, productivity
Published: 2020-06-26 10:02:53

---
title: MiniScaffold, setting up a new F# project the easy way
published: true
date: 2020-06-26 08:00:00 UTC
tags: fsharp,dotnet,dotnetcore,Productivity
canonical_url: https://SimonReynolds.ie/miniscaffold-setting-up-a-new-f-the-easy-way/
---

 ![MiniScaffold, setting up a new F# project the easy way](https://images.unsplash.com/photo-1588049089928-ceb048f61358?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=2000&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ)

Setting up a new project can be a pain. Especially if you want to split it into separate folders for clarity. You might want a `src` folder for the project itself, a `test` folder for the unit and integration tests, a `docs` folder for documentation. You are writing documentation for your work, right?

![MiniScaffold, setting up a new F# project the easy way](https://simonreynolds.ie/content/images/2020/06/giphy-1-.gif)<figcaption>Of course I always do too </figcaption>

If you're writing in F# you've probably long ago moved from NuGet to Paket, but the standard .NET templates still use NuGet so that has to be migrated. There's build scripts to write too. It could be an hour or more of work before you start working on the code you actually wanted to write.

Enter [MiniScaffold](https://github.com/TheAngryByrd/MiniScaffold/), a dotnet template that is for creating and publishing applications (supporting .NET Core 3.1) and libraries (supporting both .NETStandard 2.1 and .NET Framework 4.6.1

It's designed and built to take care of the humdrum for you, it gives you

- a clean and well separated folder structure
- a matching `.gitignore` file
- an `.editorconfig` file tweaked for F# development
- configures CI builds on [Appveyor](https://www.appveyor.com/) (for Windows) and [TravisCI](https://travis-ci.org/) (for Linux and macOS)
- fully configured build scripts using [FAKE](https://fake.build/)
- integrated package management with [Paket](https://fsprojects.github.io/Paket/)
- integrated unit testing ([Expecto](https://github.com/haf/expecto)) and code coverage reports ([AltCover](https://github.com/SteveGilham/altcover)/[ReportGenerator](https://github.com/danielpalme/ReportGenerator))
- automatic code formatting with [Fantomas](https://github.com/fsprojects/fantomas)

And that's just to get started, also included is a file named `CHANGELOG.md`. All you have to do is keep it updated with your notable changes, even reference the associated pull requests for those changes.

The generated build scripts include a `Release` action that will parse the `CHANGELOG.md` file, create a tag in GitHub with the version number specified, update any pull requests mentioned with the version number, publish a GitHub release for the version and even include any build artifacts in the `dist` folder! Doing all that is as easy as typing seven extra characters

<!--kg-card-begin: markdown-->
```bash
# Development build
./build.sh

# Release build
./build.sh Release
```
<!--kg-card-end: markdown-->

It's certainly an opiniated template, if you really wanted to go with a different test library for example, you'd have enough repeated work changing it each time that it would probably be better to fork the [github project](https://github.com/TheAngryByrd/MiniScaffold/) and customise it yourself. But I'd recommend trying it out first, it becomes second nature and is now my go to template for all F# projects!

To get started, install the template

<!--kg-card-begin: markdown-->
```bash
dotnet new -i "MiniScaffold::*"
```
<!--kg-card-end: markdown-->

Then go with

<!--kg-card-begin: markdown-->
```bash
# I'm building a library
dotnet new mini-scaffold -n MyCoolNewLib --githubUsername MyGithubUsername

# I'm building an application
dotnet new mini-scaffold -n MyCoolNewApp --githubUsername MyGithubUsername -ou console
```
<!--kg-card-end: markdown-->

The author of this template, [Jimmy Byrd](https://www.jimmybyrd.me/), has clearly put an incredible amount of effort into this and it is a great example of how creating a template (or any project) to simplify some repetitive task is always worth sharing with the community.