├── docs └── .keep ├── src ├── assets │ ├── fonts │ │ └── .keep │ ├── images │ │ ├── .keep │ │ └── elm.png │ ├── favicon.ico │ └── index.html ├── javascripts │ └── application.js ├── stylesheets │ ├── global │ │ ├── fonts.scss │ │ ├── mixins.scss │ │ ├── overloads.scss │ │ ├── settings.scss │ │ └── forms.scss │ ├── application.scss │ └── modules │ │ └── e-application-layout.scss └── elm │ ├── Application.elm │ └── Application │ └── Layout.elm ├── tests ├── .gitignore ├── elm-package.json └── Tests.elm ├── .gitignore ├── .editorconfig ├── elm-uninstall.sh ├── brunch-config.js ├── elm-package.json ├── package.json ├── LICENSE ├── .travis.yml └── README.md /docs/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/fonts/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | /elm-stuff/ 2 | -------------------------------------------------------------------------------- /src/javascripts/application.js: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | public/ 3 | **/elm-stuff/ 4 | .DS_Store 5 | npm-debug.log 6 | 7 | -------------------------------------------------------------------------------- /src/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khusnetdinov/elmkit/HEAD/src/assets/favicon.ico -------------------------------------------------------------------------------- /src/assets/images/elm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khusnetdinov/elmkit/HEAD/src/assets/images/elm.png -------------------------------------------------------------------------------- /src/stylesheets/global/fonts.scss: -------------------------------------------------------------------------------- 1 | @import "settings"; 2 | 3 | // Place here all relate to Fonts 4 | 5 | -------------------------------------------------------------------------------- /src/stylesheets/global/mixins.scss: -------------------------------------------------------------------------------- 1 | @import "settings"; 2 | 3 | // Here place all you custom global mixins 4 | 5 | -------------------------------------------------------------------------------- /src/stylesheets/global/overloads.scss: -------------------------------------------------------------------------------- 1 | @import "settings"; 2 | 3 | // Place here all relate to overloading 3rd party styles 4 | 5 | -------------------------------------------------------------------------------- /src/stylesheets/global/settings.scss: -------------------------------------------------------------------------------- 1 | // Here is best place for importing 3rd party libraries 2 | // And defining global variables 3 | -------------------------------------------------------------------------------- /src/stylesheets/global/forms.scss: -------------------------------------------------------------------------------- 1 | @import "settings"; 2 | 3 | // Place here all relate to globall styles for all forms components 4 | 5 | -------------------------------------------------------------------------------- /src/elm/Application.elm: -------------------------------------------------------------------------------- 1 | module Application exposing (main) 2 | 3 | import Html exposing (text) 4 | 5 | import Application.Layout as Layout exposing (view) 6 | 7 | main = 8 | Layout.view 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{package,elm-package}.json] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /src/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | @import "global/forms"; 2 | @import "global/fonts"; 3 | @import "global/mixins"; 4 | @import "global/overloads"; 5 | 6 | .body { 7 | display: block; 8 | position: relative; 9 | 10 | margin: 0; 11 | padding: 0; 12 | 13 | font: 16px / 16px; 14 | } 15 | 16 | @import "modules/e-application-layout"; 17 | -------------------------------------------------------------------------------- /src/stylesheets/modules/e-application-layout.scss: -------------------------------------------------------------------------------- 1 | @import "../global/settings"; 2 | 3 | .e-application-layout { 4 | display: block; 5 | position: relative; 6 | width: 450px; 7 | margin: 150px auto; 8 | padding: 0; 9 | text-align: center; 10 | color: #505050; 11 | 12 | > .elm-logo { 13 | width: 175px; 14 | height: 175px; 15 | } 16 | 17 | > .title { 18 | margin-top: 20px; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/elm/Application/Layout.elm: -------------------------------------------------------------------------------- 1 | module Application.Layout exposing (view) 2 | 3 | import Html exposing (div, img, h2, p, ul, li, a, text) 4 | import Html.Attributes exposing (class, src, alt, href) 5 | 6 | view = 7 | div [ class "e-application-layout" ] 8 | [ img [ class "elm-logo", src "/images/elm.png", alt "Elm boilerplate kit" ][] 9 | , h2 [ class "title" ] [ text "Hello world from Elm boilerplate kit!" ] 10 | ] 11 | 12 | -------------------------------------------------------------------------------- /elm-uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | echo "Warning: You are about to remove all Elm executables!" 6 | 7 | installdir=/usr/local/bin 8 | 9 | for bin in elm elm-compiler elm-get elm-reactor elm-repl elm-doc elm-server elm-package elm-make 10 | do 11 | if [ -f $installdir/$bin ]; then 12 | sudo rm -f $installdir/$bin 13 | fi 14 | if [ -f $installdir/$bin-unwrapped ]; then 15 | sudo rm -f $installdir/$bin-unwrapped 16 | fi 17 | 18 | done 19 | 20 | sharedir=/usr/local/share/elm 21 | sudo rm -rf $sharedir 22 | -------------------------------------------------------------------------------- /brunch-config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | config: { 3 | server: { 4 | port: 3000 5 | }, 6 | paths: { 7 | watched: ["src", "spec"] 8 | }, 9 | files: { 10 | javascripts: { joinTo: "javascripts/application.js" }, 11 | stylesheets: { joinTo: "stylesheets/application.css" } 12 | }, 13 | plugins: { 14 | sass: { 15 | mode: 'native' 16 | }, 17 | elmBrunch: { 18 | mainModules: ['src/elm/Application.elm'], 19 | outputFolder: "public/javascripts/", 20 | outputFile: "elm.js", 21 | makeParameters: ['--debug'] 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "summary": "Elm starter kit", 4 | "repository": "https://github.com/khusnetdinov/elmkit.git", 5 | "license": "MIT", 6 | "source-directories": [ 7 | ".", 8 | "src/elm/", 9 | "spec/" 10 | ], 11 | "exposed-modules": [], 12 | "dependencies": { 13 | "elm-community/elm-test": "4.2.0 <= v < 5.0.0", 14 | "elm-community/json-extra": "2.0.0 <= v < 3.0.0", 15 | "elm-lang/core": "5.0.0 <= v < 6.0.0", 16 | "elm-lang/html": "2.0.0 <= v < 3.0.0", 17 | "mgold/elm-random-pcg": "4.0.2 <= v < 5.0.0" 18 | }, 19 | "elm-version": "0.18.0 <= v < 0.19.0" 20 | } 21 | -------------------------------------------------------------------------------- /tests/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.0.1", 3 | "summary": "Elm starter kit", 4 | "repository": "https://github.com/khusnetdinov/elmkit.git", 5 | "license": "MIT", 6 | "source-directories": [ 7 | ".", 8 | "src/elm/", 9 | "spec/" 10 | ], 11 | "exposed-modules": [], 12 | "dependencies": { 13 | "elm-community/elm-test": "4.2.0 <= v < 5.0.0", 14 | "elm-community/json-extra": "2.0.0 <= v < 3.0.0", 15 | "elm-lang/core": "5.0.0 <= v < 6.0.0", 16 | "elm-lang/html": "2.0.0 <= v < 3.0.0", 17 | "mgold/elm-random-pcg": "4.0.2 <= v < 5.0.0" 18 | }, 19 | "elm-version": "0.18.0 <= v < 0.19.0" 20 | } 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elmkit", 3 | "version": "0.1.0", 4 | "description": "Elm starter kit", 5 | "keywords": [], 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/khusnetdinov/elmkit" 9 | }, 10 | "author": "Marat Khusnetdinov", 11 | "license": "MIT", 12 | "main": "brunch-config.js", 13 | "devDependencies": { 14 | "auto-reload-brunch": "^2.7.1", 15 | "brunch": "^4.0.2", 16 | "elm-brunch": "^0.7.0", 17 | "elm-test": "^0.19.1", 18 | "hmr-brunch": "^0.1.1", 19 | "sass-brunch": "^3.0.0" 20 | }, 21 | "scripts": { 22 | "development": "brunch watch --server", 23 | "build": "brunch build --production", 24 | "test": "rm tests/elm-package.json && cp elm-package.json tests && elm-test" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Marat Khusnetdinov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "6" 4 | - "node" 5 | 6 | env: 7 | - ELM_VERSION=0.19.1 8 | 9 | before_install: 10 | - if [ ${TRAVIS_OS_NAME} == "osx" ]; 11 | then brew update; brew install nvm; mkdir ~/.nvm; export NVM_DIR=~/.nvm; source $(brew --prefix nvm)/nvm.sh; 12 | fi 13 | - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config 14 | - | # epic build time improvement - see https://github.com/elm-lang/elm-compiler/issues/1473#issuecomment-245704142 15 | if [ ! -d sysconfcpus/bin ]; 16 | then 17 | git clone https://github.com/obmarg/libsysconfcpus.git; 18 | cd libsysconfcpus; 19 | ./configure --prefix=$TRAVIS_BUILD_DIR/sysconfcpus; 20 | make && make install; 21 | cd ..; 22 | fi 23 | 24 | install: 25 | - node --version 26 | - npm --version 27 | - npm install -g elm-use elm-test 28 | - elm-use $ELM_VERSION 29 | - mv $(npm config get prefix)/bin/elm-make $(npm config get prefix)/bin/elm-make-old 30 | - printf '%s\n\n' '#!/bin/bash' 'echo "Running elm-make with sysconfcpus -n 2"' '$TRAVIS_BUILD_DIR/sysconfcpus/bin/sysconfcpus -n 2 elm-make-old "$@"' > $(npm config get prefix)/bin/elm-make 31 | - chmod +x $(npm config get prefix)/bin/elm-make 32 | - travis_retry elm-package install --yes 33 | - cd tests 34 | - travis_retry elm-package install --yes 35 | - cd .. 36 | 37 | script: 38 | - npm test 39 | -------------------------------------------------------------------------------- /src/assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Elm kit 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /tests/Tests.elm: -------------------------------------------------------------------------------- 1 | module Tests exposing (..) 2 | 3 | import Test exposing (..) 4 | import Expect 5 | import Fuzz exposing (list, int, tuple, string) 6 | import String 7 | 8 | 9 | all : Test 10 | all = 11 | describe "Sample Test Suite" 12 | [ 13 | describe "Unit test examples" 14 | [ test "Addition" <| 15 | \() -> 16 | Expect.equal (3 + 7) 10 17 | , test "String.left" <| 18 | \() -> 19 | Expect.equal "a" (String.left 1 "abcdefg") 20 | ] 21 | , describe "Fuzz test examples, using randomly generated input" 22 | [ fuzz (list int) "Lists always have positive length" <| 23 | \aList -> 24 | List.length aList |> Expect.atLeast 0 25 | , fuzz (list int) "Sorting a list does not change its length" <| 26 | \aList -> 27 | List.sort aList |> List.length |> Expect.equal (List.length aList) 28 | , fuzzWith { runs = 1000 } int "List.member will find an integer in a list containing it" <| 29 | \i -> 30 | List.member i [ i ] |> Expect.true "If you see this, List.member returned False!" 31 | , fuzz2 string string "The length of a string equals the sum of its substrings' lengths" <| 32 | \s1 s2 -> 33 | s1 ++ s2 |> String.length |> Expect.equal (String.length s1 + String.length s2) 34 | ] 35 | ] 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/khusnetdinov/elmkit.svg?branch=master)](https://travis-ci.org/khusnetdinov/elmkit) [![Open Source Helpers](https://www.codetriage.com/khusnetdinov/elmkit/badges/users.svg)](https://www.codetriage.com/khusnetdinov/elmkit) 2 | 3 | ![img](https://avatars0.githubusercontent.com/u/4359353?v=3&s=150) 4 | # Elm kit - web application boilerplate | starter kit 5 | 6 | > [Elm kit](https://github.com/khusnetdinov/elmkit) is web application boilerplate kit for development. This kit build on [Brunch](http://brunch.io/), [Node](https://nodejs.org/en/), [Sass](http://sass-lang.com/), [Elm-lang](http://elm-lang.org/). It helps you to start development more productive following best practices. 7 | 8 | ## Features 9 | 10 | - Auto building project using [Brunch](https://brunch.io) 11 | - Auto re-building on changing files [auto-reload-brunch](https://github.com/brunch/auto-reload-brunch) 12 | - Hot Module Reloading [hrm-brunch](https://github.com/brunch/hmr-brunch) 13 | - Integration [Elm-lang](http://elm-lang.org/) 14 | - Auto preprocessing [Scss](http://sass-lang.com/) styles 15 | - Testing elm components with [elm-test](https://github.com/elm-community/elm-test) 16 | 17 | ## Getting started 18 | 19 | ### Files structure 20 | ``` 21 | ├── /src/ # The source code of the application 22 | │ ├── /assets/ # Files in this folder just copy to public 23 | │ │ ├── /images/ # Images folder 24 | │ │ ├── /fonts/ # Fonts folder 25 | │ │ ├── favicon.ico # Project Favicon 26 | │ │ └── index.html # Layout html file 27 | │ ├── /elm/ # Not compiled Elm files 28 | │ │ └── Application.elm # Entry point for elm files 29 | │ ├── /javascripts/ # Not compiled javascripts files 30 | │ │ └── appliction.js # Entry point for scss file 31 | │ └── /stylessheets/ # Not compiled stylessheets files 32 | │ ├── /global/ # Best place for global settings 33 | │ │ ├── fonts.scss # Fonts settings and loading 34 | │ │ ├── forms.scss # Global forms settings 35 | │ │ ├── mixins.scss # Custom mixins 36 | │ │ ├── overloads.scss # Styles overloads for 3rd party 37 | │ │ └── settings.scss # Main styles setting 38 | │ ├── /modules/ # Elm modules styles 39 | │ └── appliction.scss # Entry point for scss file 40 | │ 41 | ├── /public/ # Brunch builded and compiled project files 42 | │ ├── /images/ # Images copied folder 43 | │ ├── /.. other ../ # Other static folders 44 | │ ├── /javascripts/ # Project javascript files 45 | │ │ ├── main.js # Elm compiled javascript 46 | │ │ └── application.js # Main javascript file 47 | │ ├── /stylesheets/ # Project stylesheet files 48 | │ │ └── appliction.css # Main css file 49 | │ ├── favicon.ico # Project favicon 50 | │ └── index.html # Builded index page 51 | │ 52 | ├── /tests/ # Tests for elm components 53 | │ ├── Main.elm # Entry point for all tests 54 | │ ├── Tests.elm # Test suite 55 | │ └── elm-package.json # Copy of elm-package.json from root 56 | │ 57 | ├── /docs/ # Documentation files for the project 58 | ├── /elm-stuff/ # Elm compiler technical folder 59 | ├── /node_modules/ # Node (Brunch) 3rd-party libraries 60 | │ 61 | │── package.json # The list of Node (Brunch) 3rd party libraries 62 | │── elm-package.json # The list of Elm lang 3rd party libraries 63 | │── brunch-config.js # Brunch config for project 64 | │── README.md # Project description 65 | │── LICENSE # License 66 | │── .editorconfig # Global editor config 67 | └── .gitignore # Git ignored files 68 | ``` 69 | 70 | > Brunch compiled files with `*.js.map` are junk. 71 | 72 | ### Commands 73 | 74 | `npm run development` - Run development server 75 | 76 | `npm run build` - Create build for production 77 | 78 | `npm test` - Run tests (compile and run, wrapper for elm-test) 79 | 80 | ## Requirements 81 | 82 | You need to install [Node](https://nodejs.org/en/), [Elm-lang](http://elm-lang.org/); 83 | 84 | ## Installation 85 | 86 | `git clone https://github.com/khusnetdinov/elmkit` 87 | 88 | `cd elmkit` 89 | 90 | `npm install` 91 | 92 | `elm package install` 93 | 94 | `npm run development` 95 | 96 | # License 97 | 98 | ### This code is free to use under the terms of the MIT license. 99 | 100 | Permission is hereby granted, free of charge, to any person obtaining 101 | a copy of this software and associated documentation files (the 102 | "Software"), to deal in the Software without restriction, including 103 | without limitation the rights to use, copy, modify, merge, publish, 104 | distribute, sublicense, and/or sell copies of the Software, and to 105 | permit persons to whom the Software is furnished to do so, subject to 106 | the following conditions: 107 | 108 | The above copyright notice and this permission notice shall be included 109 | in all copies or substantial portions of the Software. 110 | 111 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 112 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 113 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 114 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 115 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 116 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 117 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 118 | --------------------------------------------------------------------------------