giraffe-fsharp / giraffe-template

A dotnet new template for Giraffe web applications.
Apache License 2.0
37 stars 22 forks source link

Discussion around the new directory layout, build files, paket etc. #6

Closed dsincl12 closed 6 years ago

dsincl12 commented 6 years ago

So after adding the new --ViewEngine none option I was playing around with the templates and got a bit annoyed that the cleanliness that existed before isn't there anymore.

Now you end up with directories like Projects/WebSocketApp/src/WebSocketApp/ with the different build files and maybe I'm missing the point (I know paket support is in the pipe) but maybe this is the wrong way to go? Or maybe we should split the template?

In a couple of months we'll probably have better support in Visual Studio and it would've been nice to just be able to open an existing Giraffe project and continue working with it but it seems we're maybe cutting that option out?

Anyway just want to get a discussion around this going.

dustinmoris commented 6 years ago

Hi David, I set the directory structure to what I thought would be default for other .NET Core apps as well, like:

MyApp
+-- README.md
+-- build.sh
+-- build.cmd
+-- src
|      +-- MyApp
|      |      +-- MyApp.fsproj
|      |      +-- Domain.fs
|      |      +-- Something.fs
|      +-- MyApp.DataLayer
|             +-- RepositoryA.fs
|             +-- RepositoryB.fs
+-- tests
       +-- MyApp.Tests
       |      +-- MyApp.Tests.fsproj
       |      +-- Tests.fs
       +-- MyApp.DataLayer.Tests
       |      +-- MyApp.Tests.fsproj
       |      +-- Tests.fs

The Giraffe templates only have one project in src and in tests, but in theory I thought this would be the expected folder layout. Why do you think this is not clean anymore or it will interfere with full VS?

I'm happy to revert anything back which causes issues..

dburriss commented 6 years ago

@dsincl12 I would be interested in suggestions for improvements as well. I worked on another template project at work that did not have lots of folders like this but instead had A LOT of conditionals. Although it keeps a single code base for all options it is difficult to reason about. In comparing I prefer this for now but as you allude to, the copy/paste could get out of hand when too many permutations are in play.

dsincl12 commented 6 years ago

Sorry for not getting back sooner, holidays and all... Anyway I'm creating different kind of projects and trying out different layouts and I will get back to this issue when I have something more concrete to add to the discussion.

dustinmoris commented 6 years ago

Hey, this issue has been a bit stale for a while now. The project has massively evolved since this was created. I will close it for now, but if you think there's still an improvement which can be made to the current structure then please feel free to open a new issue!

Thanks!