jaspervdj / hakyll

A static website compiler library in Haskell
jaspervdj.be/hakyll
Other
2.69k stars 411 forks source link

Move hakyll-init into a separate package #515

Open sjakobi opened 7 years ago

sjakobi commented 7 years ago

Motivation:

Alternatively, hakyll-init could be replaced or supplemented by a stack template. The installation instructions could then look like this:

$ stack new my-site https://jaspervdj.be/hakyll/stack-template.hsfiles
$ cd my-site
$ stack build
jaspervdj commented 7 years ago

Yes, I think this is a good idea. It slims down the package a bit.

sjakobi commented 7 years ago

Do you want to keep hakyll-init in this repo or should it be moved into a separate repo?

In the first case, hakyll-init's files should be moved into a new top-level directory hakyll-init, leaving all other files in their current place, right?

jaspervdj commented 7 years ago

I think it is a bit cleaner to do it in a separate repository. I will set up a new empty repository and give you push access.

sjakobi commented 7 years ago

I think it is a bit cleaner to do it in a separate repository.

The decision is up to you of course, but I think there's a downside to this approach:

Any feature or issue that affects both hakyll-the-library and hakyll-init will have to be tracked across two repos now, requiring i.e. two PRs instead of one. The increased troublesomeness of changing both packages might result in the two packages going out of sync and hakyll-init getting less love than needed.

OTOH I don't have much experience with library maintenance so maybe there's a strong upside to separating the repos too…

jaspervdj commented 7 years ago

Yeah, I realize that, and I've discussed the monorepository approach many times. There's definitely huge wins, but since Hakyll is fairly mature, I don't expect that there will be many PRs that affect both libraries.

sjakobi commented 7 years ago

https://github.com/jaspervdj/hakyll-init is a complete package now (and has a first bug too!)

TODOs:

jaspervdj commented 7 years ago

I've decided to put this off for now. It doesn't really have any advantages except for Stack users, where it offers slightly faster install times & less disk space.

However, for Stack users, I believe the templates solution is better anyway, so we should use that instead. It seems like some changes are being made to the hsfiles format, so we'll see how that goes.

sjakobi commented 7 years ago

Ok!

It seems like some changes are being made to the hsfiles format, so we'll see how that goes.

Do you have a link for that?

jaspervdj commented 7 years ago

The README for stack-templates says:

There are plans to change the way Stack templates are done in the near future. Therefore, the project is not accepting new templates at this moment.

sjakobi commented 7 years ago

This doesn't sound to me like they are planning to change the .hsfiles format. I think they simply want to move away from having a single central template repository at https://github.com/commercialhaskell/stack-templates and instead have package maintainers distribute their templates on Hackage (as discussed in https://github.com/commercialhaskell/stack/issues/2681).


EDIT: I now see that they're also discussing a new template format in https://github.com/commercialhaskell/stack/issues/2681#issuecomment-251869389. I'd expect that format to be an alternative to .hsfiles though, not a replacement.


In summary I think we can expect that thestack new MY_PKG TEMPLATE_URL syntax will still work with the same .hsfiles format in a few months.

Which means that we can move forward with creating a template for hakyll. I'll probably submit a PR to that effect in the next 2 to 3 weeks.

I'm not yet sure what to do about the haskell-logo.png file though. It doesn't seem as if stack templates (or mustache templates in general) support binary files. I have created a StackOverflow question to be sure. Maybe we can replace it with an SVG?

sjakobi commented 7 years ago

It doesn't seem as if stack templates (or mustache templates in general) support binary files.

They do!