yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
76 stars 39 forks source link

Outdated README instructions for developing on scaffolding #166

Closed MaxGabriel closed 7 years ago

MaxGabriel commented 7 years ago

The current README references yesod-scaffold-merge and yesod-scaffold-build which afaict no longer exist. I sort of reverse engineered the usage to be:

  1. Install dependencies: packdeps, cabal-install
  2. Run stack install
  3. Run yesod-scaffold build / make-template / merge / push. I am not sure what make-template does though, or how to use it.

My workflow for testing changes to the build script was was pretty hacky. I made a branch postgres-add-readme where I made changes to the scaffolding, then I changed this code to only reference that branch:

branches :: [Text]
branches = [ "postgres-add-readme"
           ]

master :: Text
master = "postgres-add-readme"

Is there a better way? Maybe something to do with make-template?

snoyberg commented 7 years ago

The individual -merge and -build executables got folded into the main yesod-scaffold executable as subcommands, so now anything which would have been yesod-scaffold-merge is just yesod-scaffold merge. I'll make that update.

Typically, if you're just making a change to one branch, using stack build in the normal way is all that's needed, the rest of the commands are meant for helping with updating branches and testing all of them at once, as well as ultimately creating the template files used by the stack-templates repo.

snoyberg commented 7 years ago

I've made a few updates to README.md, can you look them over?

MaxGabriel commented 7 years ago

README looks solid now, thanks @snoyberg! I think your changes are sufficient, especially because I think only a handful of people use this functionality, but if I was to look critically:

  1. It doesn't seem to be possible to get help text for the additional options of yesod-scaffold build or merge, even though the code defines them. This is maybe worth a separate issue unless I'm misusing --help:
maximiliantagher@Maximilians-MBP ~/D/C/H/y/yesod-scaffold> yesod-scaffold build --help
yesod-scaffold dev tools

Usage: yesod-scaffold [--version] [--help] COMMAND
  Provides functionality for working with the Yesod scaffolding

Available options:
  --version                Show version
  --help                   Show this help text

Available commands:
  build                    Compile all of the scaffoldings
  make-template            Make a template
  merge                    Perform merge
  push                     Push to origin
  1. make-template isn't documented in the README. Possibly it's not important enough to warrant being included in the README—I don't really understand how it's meant to be used.
snoyberg commented 7 years ago

You're right about the missing help info, see: https://github.com/fpco/optparse-simple/pull/7. I'll push a patch to use the newest version of optparse-simple.

It may be worth just removing make-template if it causes confusion. IIRC, its purpose is simply to create a single .hsfiles output, but the build command is the only one I use for that now.

MaxGabriel commented 7 years ago

Ok, I figured that's what make-template did, I just wasn't sure how to pass arguments to it correctly. I think I have it though:

yesod-scaffold make-template "." testFile.hsfiles postgres

I actually think that command is pretty useful and I would definitely have used it in the PRs I was working on. I'd say keep it!

MaxGabriel commented 7 years ago

How about this to clarify usage? https://github.com/yesodweb/yesod-scaffold/pull/167

snoyberg commented 7 years ago

LGTM

On Wed, Nov 1, 2017 at 12:23 AM, Maximilian Tagher <notifications@github.com

wrote:

How about this to clarify usage? #167 https://github.com/yesodweb/yesod-scaffold/pull/167

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yesodweb/yesod-scaffold/issues/166#issuecomment-340925268, or mute the thread https://github.com/notifications/unsubscribe-auth/AADBB0yPUNVGh5Riuitjgojn47TlVfi-ks5sx53GgaJpZM4QLpjG .

MaxGabriel commented 7 years ago

Think this is resolved now