Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Collections of project templates for the stack Haskell build tool.

License

Notifications You must be signed in to change notification settings

alessandrocandolini/stack-templates

Repository files navigation

CI

stack-templates

A collection of project templates for the Stack Haskell build tool.

Templates are written in the hsfiles format leveraging Mustache syntax for placeholder substitution. However, the Stack templating mechanism offers limited support for sharing common parts between templates. As a result, each template is independent, and changes to shared content must be manually updated in every template.

To create a new project based on one of these templates run

stack <options> new <project-name> alessandrocandolini/<name of the corresponding hsfile>

assuming stack is installed in the system. Here, <options> is any command-line option available for stack, <project-name> is the name of the project that will be created and <name of the corresponding hsfile> is the name of a hsfile in this repo. For example,

stack new hello-world alessandrocandolini/cli-template

or

stack --resolver nightly-2020-12-12 new hello-world alessandrocandolini/cli-template

Refer to Stack templates documentation for more information on how to provide and use templates, and to the official stack documentation for a comprehensive list of available options when running stack.

Templates

cli-template

Generates a simple CLI application with command-line arguments parsed using optparse-applicative. Tests are written using HSpec with automatic test discovery powered by hspec-discover. By default, several general-purpose libraries are included (e.g., aeson for json parsing, neat-interpolation for multi-line support and string interpolation, etc.).

servant-server-template

Generates a basic Servant server running on wai. The server includes a single health check endpoint:

GET /status

It returns a hardcoded 200 response:

{"status":"ok"}

A simple test is also generated to verify the health check implementation.

The template also includes libraries similar to those in the cli-template.

AOC

A specialized variant of cli-template specifically designed for Advent of Code projects.

Codecov token

⚠️ Tokenless uploading of the code coverage reports to Codecov is no longer supported in codecov-action v4.

To enable the GitHub Actions CI in the generated project to automatically upload test coverage reports, make sure to set the CODECOV_TOKEN environment variable in the GitHub repository settings. To do this, navigate to Settings > Secrets and variables > Actions > New repository secret. The token can be found under Setting > Global Upload Token

About

Collections of project templates for the stack Haskell build tool.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published