├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── Setup.hs ├── devrepo ├── haskeleton.tar.metainfo ├── haskeleton │ ├── .gitattributes │ ├── .gitignore │ ├── .stylish-haskell.yaml │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── HLint.hs │ ├── Haskeleton.hs.template │ ├── LICENSE-HASKELETON.md │ ├── LICENSE.md.template │ ├── Makefile.template │ ├── ProjectName.cabal.template │ ├── README-HASKELETON.md │ ├── README.md.template │ ├── Setup.hs │ ├── benchmark │ │ ├── Bench.hs.template │ │ └── ProjectNameBench.hs.template │ ├── executable │ │ └── Main.hs.template │ ├── library │ │ └── ProjectName.hs.template │ └── test-suite │ │ ├── DocTest.hs │ │ ├── HLint.hs │ │ ├── HPC.hs │ │ ├── Haddock.hs │ │ ├── ProjectNameSpec.hs.template │ │ └── Spec.hs ├── servant.tar.metainfo ├── servant │ ├── .projectile │ ├── LICENSE │ ├── ProjectName.cabal.template │ ├── Setup.hs │ ├── app │ │ └── Main.hs │ ├── application.conf.template │ ├── mysql.sql.template │ ├── src │ │ ├── AppConfig.hs │ │ ├── Auth │ │ │ ├── AuthHeader.hs │ │ │ └── DbAuth.hs │ │ ├── Convert │ │ │ └── UserConverter.hs │ │ ├── Db │ │ │ ├── Common.hs │ │ │ └── User.hs │ │ ├── Json │ │ │ └── User.hs │ │ └── Lib.hs │ ├── stack.yaml │ └── test │ │ └── Spec.hs ├── srv-converter ├── srv-converter.metainfo ├── srv-crud ├── srv-crud.metainfo ├── srv-db-entity ├── srv-db-entity.metainfo ├── srv-json-entity └── srv-json-entity.metainfo ├── img └── trurl.jpg ├── repository ├── registry.json └── templates │ ├── haskeleton.tar │ ├── haskeleton.tar.metainfo │ ├── servant.tar │ ├── servant.tar.metainfo │ ├── srv-converter │ ├── srv-converter.metainfo │ ├── srv-crud │ ├── srv-crud.metainfo │ ├── srv-db-entity │ ├── srv-db-entity.metainfo │ ├── srv-json-entity │ └── srv-json-entity.metainfo ├── src ├── Main.hs ├── Registry.hs ├── SimpleParams.hs └── Trurl.hs ├── stack.yaml ├── tests └── Main.hs └── trurl.cabal /.gitignore: -------------------------------------------------------------------------------- 1 | .stack-work/ 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | cache: 4 | directories: 5 | - $HOME/.stack 6 | 7 | matrix: 8 | include: 9 | - env: GHCVER=7.10.2 STACK_YAML=stack.yaml 10 | addons: 11 | apt: 12 | sources: [hvr-ghc] 13 | packages: [ghc-7.10.2] 14 | 15 | before_install: 16 | - mkdir -p ~/.local/bin 17 | - export PATH=/opt/ghc/$GHCVER/bin:$HOME/.local/bin:$PATH 18 | - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v0.1.2.0/stack-0.1.2.0-x86_64-linux.gz | gunzip > ~/.local/bin/stack 19 | - chmod a+x ~/.local/bin/stack 20 | 21 | script: 22 | - stack --no-terminal --skip-ghc-check setup 23 | - stack --no-terminal --skip-ghc-check build --ghc-options "-Wall -Werror" 24 | - stack --no-terminal --skip-ghc-check test --ghc-options "-Wall -Werror" 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, dbushenko 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * Neither the name of dbushenko nor the names of other 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | [![Build Status](https://travis-ci.org/dbushenko/trurl.png?branch=master)](https://travis-ci.org/dbushenko/trurl) 4 | 5 | Trurl is a haskell scaffolding tool named after great hyper-space engineer-constructor Trurl who (with his friend Klapaucius) is the hero of Stanislaw Lem's fiction. 6 | 7 | ![Trurl](https://raw.githubusercontent.com/dbushenko/trurl/master/img/trurl.jpg "Trurl") 8 | 9 | The tool is able to create template projects of any type and template files of any type. Though it was intended to generate template haskell code, you may also generate html/css/js in web projects and any other text files. 10 | 11 | ## Installation 12 | 13 | Build it from source using stack: 14 | 15 | git clone https://github.com/dbushenko/trurl.git 16 | cd trurl 17 | stack build 18 | stack install 19 | 20 | ## Quick Start 21 | 22 | Run following to create a template project: 23 | 24 | trurl new project MyProject haskeleton 25 | 26 | ## Usage 27 | 28 | Just run 'trurl' to see the help: 29 | 30 | trurl [parameters] 31 | update -- fetch the updates from repository 32 | new project -j [parameters_string] -- create project of specified type with specified name; optionally add JSON parameters, wrap it with \"\" or '' 33 | new project [parameters] -- create project of specified type with specified name; optionally add parameters 34 | new file -j [parameters_string] -- create file from the template with specified JSON parameters, wrap it with "" or '' 35 | new file [parameters] -- create file from the template with specified string parameters 36 | list -- print all available templates 37 | help