The Yesod scaffolding, with branches for different versions.
If you want to send a pull request affecting all the different
flavors, please send it as a pull request against the postgres
branch. The scripts we use for building the scaffoldings automatically
merge changes from postgres
to all other branches.
If you have a patch which is backend-specific, please send a pull request to the appropriate branch, with a comment that this change applies only to the specific branch.
The code contained by the scaffolding itself is all contained on
separate branches. The master branch contains code for performing
merges between these branches, testing that the branches build
correctly, and generating the .hsfiles used by the
stack-template repository. (Note:
the full list of recognized branches is maintained in the
app/Main.hs
file on the master branch, in the branches
value.
The basic workflow for this repository is as follows:
-
Changes are made to one of the branches. If the change is intended to be applied to all variants, it should be made to the
postgres
branch (as mentioned above). -
Changes on a branch can be tested with normal Stack commands, e.g.
stack test --haddock
.
If you are a maintainer of this repo, you will additionally need to
merge changes from postgres
to other branches and deal with updating
the stack-templates
repo.
Install the yesod-scaffold
executable by running stack install
on the master
branch.
Merge changes from postgres
to all other branches by running
yesod-scaffold merge
. Note that there will often be merge conflicts,
which will need to be resolved and then the command rerun until all
branches merge successfully.
Confirm that changes build correctly by running yesod-scaffold build
. Usually you'll want to add --no-run-tests
if you don't have
databases set up locally. The Travis builds set up the databases for
proper testing, and you can rely on that. If you encounter a build
error on one of the branches, check it out, fix it up, and then rerun
yesod-scaffold build
.
Copy the template files in the hsfiles
directory. This directory
is populated after a successful yesod-scaffold build
run. Place the
stack-templates
directory as a sibling to the yesod-scaffold
directory, and then run the to-stack-templates.sh
script.