{"id":18111642,"url":"https://github.com/laymer/terlplate","last_synced_at":"2025-10-13T16:42:56.907Z","repository":{"id":67405048,"uuid":"190953088","full_name":"Laymer/terlplate","owner":"Laymer","description":"GRiSP oriented Erlang project skeleton","archived":false,"fork":false,"pushed_at":"2019-06-09T02:04:21.000Z","size":812,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T13:56:48.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Laymer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-09T01:52:51.000Z","updated_at":"2019-06-09T02:04:23.000Z","dependencies_parsed_at":"2023-02-22T16:31:15.437Z","dependency_job_id":null,"html_url":"https://github.com/Laymer/terlplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laymer%2Fterlplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laymer%2Fterlplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laymer%2Fterlplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laymer%2Fterlplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Laymer","download_url":"https://codeload.github.com/Laymer/terlplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247452746,"owners_count":20941163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-01T01:06:59.305Z","updated_at":"2025-10-13T16:42:56.838Z","avatar_url":"https://github.com/Laymer.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`estuff`](https://github.com/Pouriya-Jahanbakhsh/estuff)\nErlang [rebar3](https://rebar3.org) template for making new Erlang/OTP project.\n\n\n# Build\n```sh\n~ $ git clone --depth=1 https://github.com/Pouriya-Jahanbakhsh/estuff \u0026\u0026 cd estuff\n...\n~/estuff $ make install # or gmake install on FreeBSD\n```\nYou can also use `make uninstall`. Note that you should replace your email in `./src/estuff.template`. \n\n\n# Usage\n\n## Creating new project\n```sh\n~ $ rebar3 new estuff foo \u0026\u0026 cd foo\n===\u003e Writing foo/src/foo.erl\n===\u003e Writing foo/src/foo_app.erl\n===\u003e Writing foo/src/foo_sup.erl\n===\u003e Writing foo/src/foo.app.src\n===\u003e Writing foo/src/foo_utils.erl\n===\u003e Writing foo/rebar.config\n===\u003e Writing foo/rebar.config.script\n===\u003e Writing foo/config/sys.config\n===\u003e Writing foo/config/vm.args\n===\u003e Writing foo/LICENSE\n===\u003e Writing foo/README.md\n===\u003e Writing foo/Makefile\n===\u003e Writing foo/tools/rebar3\n===\u003e Writing foo/tools/user_default.erl\n===\u003e Writing foo/test/foo_SUITE.erl\n===\u003e Writing foo/include/foo.hrl\n===\u003e Writing foo/tools/coverage_summary.awk\n===\u003e Writing foo/test/shell_quick_test.script\n===\u003e Writing foo/Dockerfile\n~/foo $\n```\n\n## Shell\n```sh\n~/foo $ make shell # use gmake on FreeBSD\nCompiling user_default module\n===\u003e Verifying dependencies...\n===\u003e Compiling foo\nErlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:256] [hipe] [kernel-poll:true]\nEshell V9.3  (abort with ^G)\n(foo@localhost)1\u003e\n```\nModule `foo` is loaded in shell:\n```erlang\n(foo@localhost)1\u003e foo: % use Tab key\nmodule_info/0  module_info/1  start/0        stop/0\n```\n\nYou can edit project files and recompile/reload all files without restarting shell:\n```erlang\n(foo@localhost)1\u003e cr(). % use c() to just compile them and use r() to just reload them\nmake[1]: Entering directory '~/foo'\nCompiling code\nmake[1]: Leaving directory '~/foo'\nReloading foo\nReloading foo_app\nReloading foo_sup\nReloading foo_utils\nok\n```\n\nYou can use `cl().` to clean the screen, I tested it on FreeBSD and Linux:\n```erlang\n\n\n\n\n\n\n\n\n% above commands\n(foo@localhost)2\u003e cl().\n```\nWill be:\n```erlang\n(foo@localhost)3\u003e\n\n\n\n\n\n\n\n```\n\nAlso you can have a quick test in shell using `test().`:\n```erlang\n(foo@localhost)3\u003e test().\nRunning ./test/shell_quick_test.script\n\n{ok,ok}\n(foo@localhost)4\u003e\n```\nJust edit `./test/shell_quick_test.script` and run it.\n\n## Test\n```sh\n~/foo $ make test\nCompiling code\nRunning tests\nCoverage summary:\n\tfoo_app                                 0   %\n\tfoo_utils                               100 %\n\tfoo                                     0   %\n\tfoo_sup                                 0   %\n\tTotal                                   0   %\n```\nIn above, Coverage summary is colored. Less than 15% will be Gray, Between 16% and 50% will be Red, Between 51% and 75 will be Orange and +76% will be Green.  \nYou can edit `./tools/coverage_summary.awk` if you want.\n\n## Release\n```sh\n~/foo $ make release\nCompiling code\nBuilding release foo-0.0.0\n\n~/foo $ ./foo-0.0.0/bin/foo console\nExec: ~/foo/foo-0.0.0/erts-9.3/bin/erlexec -boot ~/foo/foo-0.0.0/releases/0.0.0/foo -mode embedded -boot_var ERTS_LIB_DIR ~/foo/foo-0.0.0/lib -config ~/foo/foo-0.0.0/releases/0.0.0/sys.config -args_file ~/foo/foo-0.0.0/releases/0.0.0/vm.args -pa -- console\nRoot: ~/foo/foo-0.0.0\nErlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:256] [hipe] [kernel-poll:true]\nEshell V9.3  (abort with ^G)\n(foo@localhost)1\u003e\n```\n\n## Packaging\n```sh\n~/foo $ make package v=0 # set verbositiy to 0 to see less information\nCompiling code\nPackaging source to foo-0.0.0-src.tar.gz\nPackaging application to foo-0.0.0-app.tar.gz\nBuilding release foo-0.0.0\nPackaging release to foo-0.0.0-release.tar.gz\n\n~/foo $ ls *.tar.gz\nfoo-0.0.0-app.tar.gz  foo-0.0.0-release.tar.gz  foo-0.0.0-src.tar.gz \n```\n`NAME-VERSION-app.tar.gz`: contains application source with compiled erlang files.  \n`NAME-VERSION-release.tar.gz`: contains erlang release with all dependencies + sasl + erts.  \n`NAME-VERSION-src.tar.gz`: contains application source with build configuration files.  \n\n\n## Other make targets\n`all`: Compiles, Runs tests, Shows coverage summary and builds release package.  \n`compile`: Compiles code.  \n`dialyzer`: Runs dialyzer for this project.  \n`docs`: Makes `edoc` for this project.  \n`clean`: Runs `rebar3 clean`.  \n`distclean`: Runs `rebar3 clean` and removes `rebar.lock`, created release directory, `./ebin` directory, etc.  \n`push`: Runs tests and runs `git push origin master` if test passed.  \n`docker`: Builds docker image for project's release. At the time I did not test it.  \n\n# make options\nBy default its verbosity is `1`. Use  \n`v=2` to see commands.  \n`v=3` to see what options are passed to `rebar`.  \n`v=4` to enable `rebar3` debug too.  \n```sh\n~/foo $ make compile v=4\nCompiling code\n\\\n            export FOO_BUILD=COMPILE \u0026\u0026 \\\n            export DEBUG=1 \u0026\u0026 \\\n            export FOO_VERSION=0.0.0 \u0026\u0026 \\\n            export FOO_BUILD_DEBUG=1 \u0026\u0026 \\\n            /opt/estuff/test/foo/tools/rebar3 compile \\\n        \n===\u003e Evaluating config script \"rebar.config.script\"\nREBAR configuration for 'foo' with build type 'compile': [{erl_opts,\n                                                           [debug_info]},\n                                                          {deps,[]},\n                                                          {cover_enabled,true},\n                                                          {cover_export_enabled,\n                                                           true},\n                                                          {dialyzer,\n                                                           [{warnings,\n                                                             [no_return]},\n                                                            {plt_apps,\n                                                             top_level_deps},\n                                                            {plt_prefix,\n                                                             \"foo\"}]},\n                                                          {edoc_opts,[]},\n                                                          {relx,\n                                                           [{include_erts,\n                                                             true},\n                                                            {include_src,\n                                                             false},\n                                                            {dev_mode,false},\n                                                            {generate_start_script,\n                                                             true},\n                                                            {extended_start_script,\n                                                             true},\n                                                            {sys_config,\n                                                             \"./config/sys.config\"},\n                                                            {vm_args,\n                                                             \"./config/vm.args\"}]}]\n\n===\u003e Expanded command sequence to be run: [{default,app_discovery},\n                                                  {default,install_deps},\n                                                  {default,lock},\n                                                  {default,compile}]\n### Lots of rebar debug info\n\n===\u003e run_hooks(\"/opt/estuff/test/foo\", post_hooks, compile) -\u003e no hooks defined\n\n===\u003e run_hooks(\"/opt/estuff/test/foo\", post_hooks, compile) -\u003e no hooks defined\n\ncp -r /opt/estuff/test/foo/_build/default/lib/foo/ebin /opt/estuff/test/foo\n\n```\nAlso you can use `v=0` to see less information.  \n\nIf you want to save coverage summary in file, use `coverage` option:\n```sh\n~/foo $ make test coverage=COVERAGE_SUMMARY.txt\nCompiling code\nRunning tests\nCoverage summary:\n\tfoo_app                                 0   %\n\tfoo_utils                               100 %\n\tfoo                                     0   %\n\tfoo_sup                                 0   %\n\tTotal                                   0   %\n~/foo $ cat COVERAGE_SUMMARY.txt \nfoo_app                                 0   %\nfoo_utils                               100 %\nfoo                                     0   %\nfoo_sup                                 0   %\nTotal                                   0   %\n```\n\n# Contributing\nAll issues are welcomed. Before making a PR, Please open an issue and let's talk about it.  \n\n### Author\n`pouriya.jahanbakhsh@gmail.com`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaymer%2Fterlplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaymer%2Fterlplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaymer%2Fterlplate/lists"}