├── .gitignore ├── img └── images.png ├── js ├── app │ └── components │ │ ├── app.js │ │ ├── index │ │ ├── index.controller.js │ │ ├── index.html │ │ ├── index.scss │ │ └── spec │ │ │ └── index.controller.spec.js │ │ └── routes.js └── libs.js ├── karma.conf.js ├── package.json ├── readme.md ├── scss └── index.scss └── www ├── css └── application.min.css ├── img └── images.png ├── index.html └── js ├── application.min.js ├── libs.min.js └── templates.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /img/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grillorafael/angular-boilerplate/b64ee2d39a386fa596e4a68be250d56fc040dca5/img/images.png -------------------------------------------------------------------------------- /js/app/components/app.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('boilerplate', ['boilerplate-templates', 'ui.router']); 5 | })(); 6 | -------------------------------------------------------------------------------- /js/app/components/index/index.controller.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | angular.module('boilerplate').controller('IndexCtrl', IndexCtrl); 4 | 5 | function IndexCtrl($scope) { 6 | $scope.title = 'Hello World'; 7 | } 8 | })(); 9 | -------------------------------------------------------------------------------- /js/app/components/index/index.html: -------------------------------------------------------------------------------- 1 |
2 |

{{title}}

3 |
4 | -------------------------------------------------------------------------------- /js/app/components/index/index.scss: -------------------------------------------------------------------------------- 1 | section.login { 2 | height: 200px; 3 | width: 200px; 4 | margin: auto; 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /js/app/components/index/spec/index.controller.spec.js: -------------------------------------------------------------------------------- 1 | describe('SidePanel', function() { 2 | var $compile, $rootScope; 3 | 4 | beforeEach(module('boilerplate')); 5 | 6 | beforeEach(inject(function(_$compile_, _$rootScope_) { 7 | $compile = _$compile_; 8 | $rootScope = _$rootScope_; 9 | })); 10 | 11 | it('pass', function() { 12 | expect(false).toBeFalsy(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /js/app/components/routes.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | angular.module('boilerplate').config(function($stateProvider, $urlRouterProvider) { 5 | $urlRouterProvider.otherwise('/'); 6 | 7 | $stateProvider 8 | .state('index', { 9 | url: '/', 10 | controller: 'IndexCtrl', 11 | templateUrl: 'app/components/index/index.html' 12 | }); 13 | }); 14 | })(); 15 | -------------------------------------------------------------------------------- /js/libs.js: -------------------------------------------------------------------------------- 1 | window.$ = window.jQuery = require('jquery'); 2 | 3 | window.angular = require('angular'); 4 | window.moment = require('moment'); 5 | 6 | require('angular-ui-router'); 7 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function(config) { 2 | config.set({ 3 | basePath: '', 4 | frameworks: ['jasmine'], 5 | files: [ 6 | 'www/js/libs.min.js', 7 | 'www/js/templates.min.js', 8 | 'node_modules/angular-mocks/angular-mocks.js', 9 | 'www/js/application.min.js', 10 | 'js/app/**/*.spec.js' 11 | ], 12 | exclude: [], 13 | preprocessors: {}, 14 | reporters: ['mocha'], 15 | plugins: ['karma-chrome-launcher', 'karma-jasmine', 'karma-mocha-reporter'], 16 | port: 9876, 17 | colors: true, 18 | logLevel: config.LOG_INFO, 19 | autoWatch: true, 20 | browsers: ['Chrome'], 21 | singleRun: false 22 | }); 23 | }; 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-boilerplate", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "start": "parallelshell 'npm run watch' 'npm test'", 7 | "test": "karma start karma.conf.js", 8 | "css:build": "node-sass --output-style compressed scss/index.scss | postcss --use autoprefixer > www/css/application.min.css", 9 | "css:watch": "gacher -p 'scss/*.scss js/app/components/**/*.scss' -c 'npm run css:build'", 10 | "js:build:app": "uglifyjs `find js/app/ -name '*.js' ! -path '**/spec/*' | sort` -o www/js/application.min.js", 11 | "js:lint:app": "eslint --format 'node_modules/eslint-friendly-formatter' js/app; if [[ $? -eq 0 ]]; then npm run js:build:app; fi", 12 | "js:build:libs": "browserify js/libs.js | uglifyjs -o www/js/libs.min.js", 13 | "js:watch:app": "gacher -p 'js/app/**/*.js' -c 'npm run js:lint:app'", 14 | "js:watch:libs": "gacher -p 'js/libs.js' -c 'npm run js:build:libs'", 15 | "js:watch": "parallelshell 'npm run js:watch:app' 'npm run js:watch:libs'", 16 | "angular:watch": "gacher -p 'js/**/*.html' -c 'npm run angular:template'", 17 | "angular:template": "n-embed -m 'boilerplate-templates' -s js app/**/*.html | uglifyjs -o www/js/templates.min.js", 18 | "browser:sync": "browser-sync start --server www/ --files 'www/**/*'", 19 | "img:watch": "gacher -p 'img/**/*' -c 'npm run img:build'", 20 | "img:build": "imagemin img/**/* www/img", 21 | "watch": "parallelshell 'npm run css:watch' 'npm run js:watch' 'npm run angular:watch' 'npm run img:watch' 'npm run browser:sync'" 22 | }, 23 | "devDependencies": { 24 | "angular-mocks": "^1.4.5", 25 | "autoprefixer": "^6.0.2", 26 | "browser-sync": "^2.9.3", 27 | "browserify": "^11.1.0", 28 | "eslint": "^1.3.1", 29 | "eslint-friendly-formatter": "^1.2.2", 30 | "gacher": "^1.1.1", 31 | "jasmine-core": "^2.3.4", 32 | "karma": "^0.13.9", 33 | "karma-chrome-launcher": "^0.2.0", 34 | "karma-jasmine": "^0.3.6", 35 | "karma-mocha-reporter": "^1.1.1", 36 | "node-sass": "^3.3.2", 37 | "npm-build-tools": "^2.2.1", 38 | "parallelshell": "^2.0.0", 39 | "postcss-cli": "^2.1.0", 40 | "uglifyjs": "^2.4.10" 41 | }, 42 | "dependencies": { 43 | "angular": "^1.4.5", 44 | "angular-ui-router": "^0.2.15", 45 | "jquery": "^2.1.4", 46 | "moment": "^2.10.6" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Angular Independent Boilerplate 2 | 3 | This is a angular boilerplate independent from bower, gulp, grunt, etc. 4 | 5 | It only uses npm to handle package management and build tasks. 6 | 7 | ## Features 8 | 9 | 1. ESLINT 10 | 1. Karma Unit Testing 11 | 1. Uglify and concat libs and application 12 | 1. Template cache 13 | 1. SASS Preprocessor 14 | 1. Imagemin 15 | 1. Browserify 16 | 1. Browsersync 17 | 18 | ## tasks 19 | 20 | 21 | 1. `start` Start watchers and test 22 | 1. `test` Start karma testing units 23 | 1. `css:watch` Watches css for changes 24 | 1. `css:build` Builds your SASS files 25 | 1. `js:build:app` Builds your application files 26 | 1. `js:lint:app` Lints your application files 27 | 1. `js:build:libs` Builds your libs.js file using browserify 28 | 1. `js:watch:app` Watches your application files 29 | 1. `js:watch:libs` Watches your libs.js file 30 | 1. `js:watch Watches` both libs and app files 31 | 1. `angular:watch` Watches your angular template files 32 | 1. `angular:build` Builds your angular template files 33 | 1. `browser:sync` It opens a server with browsersync 34 | 1. `img:watch` It watches your image files 35 | 1. `img:build` It minifies your image files 36 | 1. `watch Run` all watch tasks 37 | -------------------------------------------------------------------------------- /scss/index.scss: -------------------------------------------------------------------------------- 1 | @import "../js/app/components/index/index"; 2 | -------------------------------------------------------------------------------- /www/css/application.min.css: -------------------------------------------------------------------------------- 1 | section.login{height:200px;width:200px;margin:auto;text-align:center} 2 | 3 | -------------------------------------------------------------------------------- /www/img/images.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grillorafael/angular-boilerplate/b64ee2d39a386fa596e4a68be250d56fc040dca5/www/img/images.png -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Angular - Boilerplate 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /www/js/application.min.js: -------------------------------------------------------------------------------- 1 | (function(){"use strict";angular.module("boilerplate",["boilerplate-templates","ui.router"])})();(function(){"use strict";angular.module("boilerplate").controller("IndexCtrl",IndexCtrl);function IndexCtrl($scope){$scope.title="Hello World"}})();(function(){"use strict";angular.module("boilerplate").config(function($stateProvider,$urlRouterProvider){$urlRouterProvider.otherwise("/");$stateProvider.state("index",{url:"/",controller:"IndexCtrl",templateUrl:"app/components/index/index.html"})})})(); -------------------------------------------------------------------------------- /www/js/templates.min.js: -------------------------------------------------------------------------------- 1 | angular.module("boilerplate-templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("app/components/index/index.html",'
\n

{{title}}

\n
')}]); --------------------------------------------------------------------------------