diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..027fb5d --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components/" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a22a458..410e2dd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules dist .tmp .sass-cache -bower_components +app/bower_components +build diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index ac20a46..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,457 +0,0 @@ -// Generated on 2014-09-27 using generator-angular 0.9.8 -'use strict'; - -// # Globbing -// for performance reasons we're only matching one level down: -// 'test/spec/{,*/}*.js' -// use this if you want to recursively match all subfolders: -// 'test/spec/**/*.js' - -module.exports = function (grunt) { - - // Load grunt tasks automatically - require('load-grunt-tasks')(grunt); - - // Time how long tasks take. Can help when optimizing build times - require('time-grunt')(grunt); - - // Configurable paths for the application - var appConfig = { - app: require('./bower.json').appPath || 'app', - dist: 'dist' - }; - - // Define the configuration for all the tasks - grunt.initConfig({ - - // Project settings - yeoman: appConfig, - - // Watches files for changes and runs tasks based on the changed files - watch: { - js: { - files: ['<%= yeoman.app %>/{,**/}*.js'], - tasks: ['newer:jshint:all'], - options: { - livereload: '<%= connect.options.livereload %>' - } - }, - jsTest: { - files: ['<%= yeoman.app %>/{,*/}*.spec.js'], - tasks: ['newer:jshint:test', 'karma'] - }, - compass: { - files: ['<%= yeoman.app %>/{,**/}*.{scss,sass}'], - tasks: ['compass:server', 'autoprefixer'] - }, - gruntfile: { - files: ['Gruntfile.js'] - }, - livereload: { - options: { - livereload: '<%= connect.options.livereload %>' - }, - files: [ - '<%= yeoman.app %>/{,**/}*.{html,lang.json}', - '.tmp/assets/styles/{,*/}*.css', - '<%= yeoman.app %>/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' - ] - } - }, - - // The actual grunt server settings - connect: { - options: { - port: 9000, - // Change this to '0.0.0.0' to access the server from outside. - hostname: '0.0.0.0', - livereload: 35729 - }, - livereload: { - options: { - open: false, - middleware: function (connect) { - return [ - connect.static('.tmp'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), - connect().use( - '/node_modules', - connect.static('./node_modules') - ), - connect.static(appConfig.app) - ]; - } - } - }, - test: { - options: { - port: 9001, - middleware: function (connect) { - return [ - connect.static('.tmp'), - connect.static('test'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), - connect.static(appConfig.app) - ]; - } - } - }, - dist: { - options: { - open: true, - base: '<%= yeoman.dist %>' - } - } - }, - - // Make sure code styles are up to par and there are no obvious mistakes - jshint: { - options: { - jshintrc: '.jshintrc', - reporter: require('jshint-stylish') - }, - all: { - src: [ - 'Gruntfile.js', - '<%= yeoman.app %>/{,*/}*.js' - ] - }, - test: { - options: { - jshintrc: '.jshintrc' - }, - src: ['<%= yeoman.app %>/{,*/}*.spec.js'] - } - }, - - // Empties folders to start fresh - clean: { - dist: { - files: [{ - dot: true, - src: [ - '.tmp', - '<%= yeoman.dist %>/{,*/}*', - '!<%= yeoman.dist %>/.git*' - ] - }] - }, - server: '.tmp' - }, - - // Add vendor prefixed styles - autoprefixer: { - options: { - browsers: ['last 1 version'] - }, - dist: { - files: [{ - expand: true, - cwd: '.tmp/assets/styles/', - src: '{,*/}*.css', - dest: '.tmp/assets/styles/' - }] - } - }, - - // Compiles Sass to CSS and generates necessary files if requested - compass: { - options: { - sassDir: '<%= yeoman.app %>/assets/styles', - cssDir: '.tmp/assets/styles', - generatedImagesDir: '.tmp/assets/images/generated', - imagesDir: '<%= yeoman.app %>/assets/images', - javascriptsDir: '<%= yeoman.app %>', - fontsDir: '<%= yeoman.app %>/assets/styles/fonts', - importPath: ['./bower_components', '<%= yeoman.app %>'], - httpImagesPath: '/assets/images', - httpGeneratedImagesPath: '/assets/images/generated', - httpFontsPath: '/assets/styles/fonts', - relativeAssets: false, - assetCacheBuster: false, - raw: 'Sass::Script::Number.precision = 10\n', - sourcemap: true - }, - dist: { - options: { - generatedImagesDir: '<%= yeoman.dist %>/assets/images/generated' - } - }, - server: { - options: { - debugInfo: false - } - } - }, - - // Renames files for browser caching purposes - filerev: { - dist: { - src: [ - '<%= yeoman.dist %>/{,*/}*.js', - '<%= yeoman.dist %>/assets/styles/{,*/}*.css', - '<%= yeoman.dist %>/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', - '<%= yeoman.dist %>/assets/styles/fonts/*' - ] - } - }, - - // Reads HTML for usemin blocks to enable smart builds that automatically - // concat, minify and revision files. Creates configurations in memory so - // additional tasks can operate on them - useminPrepare: { - html: '<%= yeoman.dist %>/index.html', - options: { - dest: '<%= yeoman.dist %>', - flow: { - html: { - steps: { - js: ['concat', 'uglifyjs'], - css: ['cssmin'] - }, - post: {} - } - } - } - }, - - // Performs rewrites based on filerev and the useminPrepare configuration - usemin: { - html: ['<%= yeoman.dist %>/{,*/}*.html'], - css: ['<%= yeoman.dist %>/assets/styles/{,*/}*.css'], - options: { - assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'] - } - }, - - // The following *-min tasks will produce minified files in the dist folder - // By default, your `index.html`'s will take care of - // minification. These next options are pre-configured if you do not wish - // to use the Usemin blocks. - // cssmin: { - // dist: { - // files: { - // '<%= yeoman.dist %>/styles/main.css': [ - // '.tmp/styles/{,*/}*.css' - // ] - // } - // } - // }, - // uglify: { - // dist: { - // files: { - // '<%= yeoman.dist %>/scripts/scripts.js': [ - // '<%= yeoman.dist %>/scripts/scripts.js' - // ] - // } - // } - // }, - // concat: { - // dist: {} - // }, - - imagemin: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/assets/images', - src: '{,*/}*.{png,jpg,jpeg,gif}', - dest: '<%= yeoman.dist %>/assets/images' - }] - } - }, - - svgmin: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/assets/images', - src: '{,*/}*.svg', - dest: '<%= yeoman.dist %>/assets/images' - }] - } - }, - - htmlmin: { - dist: { - options: { - collapseWhitespace: true, - conservativeCollapse: true, - collapseBooleanAttributes: true, - removeCommentsFromCDATA: true, - removeOptionalTags: true - }, - files: [{ - expand: true, - cwd: '<%= yeoman.dist %>', - src: ['*.html', 'components/{,*/}*.html', 'routes/{,*/}*.html'], - dest: '<%= yeoman.dist %>' - }] - } - }, - - // ng-annotate tries to make the code safe for minification automatically - // by using the Angular long form for dependency injection. - ngAnnotate: { - dist: { - files: [{ - expand: true, - cwd: '.tmp/concat/scripts', - src: ['*.js', '!oldieshim.js'], - dest: '.tmp/concat/scripts' - }] - } - }, - - // Replace Google CDN references - cdnify: { - dist: { - html: ['<%= yeoman.dist %>/*.html'] - } - }, - - // Copies remaining files to places other tasks can use - copy: { - dist: { - files: [{ - expand: true, - dot: true, - cwd: '<%= yeoman.app %>', - dest: '<%= yeoman.dist %>', - src: [ - '*.{ico,png,txt}', - '.htaccess', - 'components/{,*/}*.html', - 'routes/{,*/}*.html', - 'assets/images/{,*/}*.{webp}', - 'assets/fonts/*' - ] - }, { - expand: true, - cwd: '.tmp/assets/images', - dest: '<%= yeoman.dist %>/assets/images', - src: ['generated/*'] - }] - }, - styles: { - expand: true, - cwd: '<%= yeoman.app %>/assets/styles', - dest: '.tmp/assets/styles/', - src: '{,*/}*.css' - } - }, - - // Run some tasks in parallel to speed up the build process - concurrent: { - server: [ - 'compass:server' - ], - test: [ - 'compass' - ], - dist: [ - 'compass:dist', - 'imagemin', - 'svgmin' - ] - }, - - // Test settings - karma: { - unit: { - configFile: 'karma.conf.js', - singleRun: true - } - }, - - // Environment and preprocess - env: { - options: { - }, - dev: { - ENV: 'DEVELOPMENT' - }, - staging: { - ENV : 'STAGING' - }, - prod: { - ENV : 'PRODUCTION' - } - }, - preprocess: { - index: { - src: '<%= yeoman.app %>/index.html', - dest: '<%= yeoman.dist %>/index.html' - } - } - }); - - - grunt.registerTask('serve', 'Compile then start a connect web server', function (target) { - if (target === 'dist') { - return grunt.task.run(['build', 'connect:dist:keepalive']); - } - - grunt.task.run([ - 'env:dev', - 'clean:server', - 'concurrent:server', - 'autoprefixer', - 'connect:livereload', - 'watch' - ]); - }); - - grunt.registerTask('test', [ - 'env:dev', - 'clean:server', - 'concurrent:test', - 'autoprefixer', - 'connect:test', - 'karma' - ]); - - grunt.registerTask('build', [ - 'clean:dist', - 'preprocess', - 'useminPrepare', - 'concurrent:dist', - 'autoprefixer', - 'concat', - 'ngAnnotate', - 'copy:dist', - 'cdnify', - 'cssmin', - 'uglify', - 'filerev', - 'usemin', - 'htmlmin' - ]); - - grunt.registerTask('build:dev', [ - 'env:dev', - 'build' - ]); - - grunt.registerTask('build:staging', [ - 'env:staging', - 'build' - ]); - - grunt.registerTask('build:production', [ - 'env:prod', - 'build' - ]); - - grunt.registerTask('default', [ - 'newer:jshint', - 'test', - 'build' - ]); -}; diff --git a/app/app.js b/app/app.js index f504d58..c73e565 100644 --- a/app/app.js +++ b/app/app.js @@ -1,3 +1,4 @@ +(function () { 'use strict'; angular.module('webApp', [ @@ -7,5 +8,7 @@ angular.module('webApp', [ 'webApp.Config.Route', 'webApp.Config.Localization', // Routes - 'webApp.Route.Welcome', + 'webApp.Route.Welcome' ]); + +})(); \ No newline at end of file diff --git a/app/assets/images/.gitkeep b/app/assets/images/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/test.png b/app/assets/images/test.png new file mode 100644 index 0000000..4c55c9d Binary files /dev/null and b/app/assets/images/test.png differ diff --git a/app/assets/styles/main.min.css b/app/assets/styles/main.min.css new file mode 100644 index 0000000..4a71cc4 --- /dev/null +++ b/app/assets/styles/main.min.css @@ -0,0 +1 @@ +.welcome-title{color:#666} \ No newline at end of file diff --git a/app/assets/styles/main.scss b/app/assets/styles/main.scss index ae9d9e0..4d6ed1d 100644 --- a/app/assets/styles/main.scss +++ b/app/assets/styles/main.scss @@ -1,6 +1,3 @@ @charset "UTF-8"; -// bower:scss -// endbower - -@import "routes/welcome/welcome.style"; +@import "../../routes/welcome/welcome.style"; \ No newline at end of file diff --git a/app/config/localization.config.js b/app/config/localization.config.js index cf7c78c..d2d6175 100644 --- a/app/config/localization.config.js +++ b/app/config/localization.config.js @@ -1,3 +1,4 @@ +(function () { 'use strict'; // ## Localization configuration @@ -6,7 +7,7 @@ angular.module('webApp.Config.Localization', [ 'ngCookies', 'ngLocalize.Config', 'ngLocalize.InstalledLanguages', - 'ngLocalize.Events', + 'ngLocalize.Events' ]) .value('localeConf', { @@ -27,3 +28,5 @@ angular.module('webApp.Config.Localization', [ 'en': 'en-US', 'it': 'it-IT', }); + +})(); \ No newline at end of file diff --git a/app/config/route.config.js b/app/config/route.config.js index f0330ec..9438317 100644 --- a/app/config/route.config.js +++ b/app/config/route.config.js @@ -1,14 +1,19 @@ +(function () { 'use strict'; angular.module('webApp.Config.Route', [ - 'ui.router', + 'ui.router' ]) +.config(config); -.config(function ($locationProvider, $urlRouterProvider) { +config.$inject = ['$locationProvider', '$urlRouterProvider']; +function config($locationProvider, $urlRouterProvider) { $locationProvider.html5Mode({ enabled: true, requireBase: true }).hashPrefix('!'); $urlRouterProvider.otherwise('/'); -}); +} + +})(); \ No newline at end of file diff --git a/app/constants/api.dev.const.js b/app/constants/api.dev.const.js index 24cd9fe..632e01c 100644 --- a/app/constants/api.dev.const.js +++ b/app/constants/api.dev.const.js @@ -1,6 +1,9 @@ +(function () { 'use strict'; angular.module('webApp.Const.Api', []) .constant('apiConst', { }); + +})(); \ No newline at end of file diff --git a/app/constants/api.prod.const.js b/app/constants/api.prod.const.js index 24cd9fe..632e01c 100644 --- a/app/constants/api.prod.const.js +++ b/app/constants/api.prod.const.js @@ -1,6 +1,9 @@ +(function () { 'use strict'; angular.module('webApp.Const.Api', []) .constant('apiConst', { }); + +})(); \ No newline at end of file diff --git a/app/constants/api.staging.const.js b/app/constants/api.staging.const.js index 24cd9fe..632e01c 100644 --- a/app/constants/api.staging.const.js +++ b/app/constants/api.staging.const.js @@ -1,6 +1,9 @@ +(function () { 'use strict'; angular.module('webApp.Const.Api', []) .constant('apiConst', { }); + +})(); \ No newline at end of file diff --git a/app/index.html b/app/index.html index f181f84..89c24b1 100644 --- a/app/index.html +++ b/app/index.html @@ -1,66 +1,65 @@ - - - - - - - - - - - - - - - - + + + + + + -
+ + + + + - - - + + + + + + - - - - - - - - - - - - - +
- - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/routes/welcome/welcome.controller.js b/app/routes/welcome/welcome.controller.js index f398f90..b0de0b5 100644 --- a/app/routes/welcome/welcome.controller.js +++ b/app/routes/welcome/welcome.controller.js @@ -1,8 +1,14 @@ +(function () { 'use strict'; angular.module('webApp.Route.Welcome.Controller', []) -.controller('WelcomeController', function () { +.controller('WelcomeController', WelcomeController); + +WelcomeController.$inject = []; +function WelcomeController() { var ctrl = this; ctrl.list = ['one', 'two', 'three']; -}); +} + +})(); \ No newline at end of file diff --git a/app/routes/welcome/welcome.route.js b/app/routes/welcome/welcome.route.js index 0de5617..8d39646 100644 --- a/app/routes/welcome/welcome.route.js +++ b/app/routes/welcome/welcome.route.js @@ -1,13 +1,16 @@ +(function () { 'use strict'; angular.module('webApp.Route.Welcome', [ 'ui.router', 'ngLocalize', - - 'webApp.Route.Welcome.Controller', + 'webApp.Route.Welcome.Controller' ]) -.config(function ($stateProvider) { +.config(config); + +config.$inject = ['$stateProvider']; +function config($stateProvider) { $stateProvider.state('welcome', { url: '/', templateUrl: 'routes/welcome/welcome.template.html', @@ -22,4 +25,6 @@ angular.module('webApp.Route.Welcome', [ }], }, }); -}); \ No newline at end of file +} + +})(); \ No newline at end of file diff --git a/bower.json b/bower.json index 24fc289..6a29751 100644 --- a/bower.json +++ b/bower.json @@ -11,7 +11,8 @@ "angular-messages": "~1.3", "angular-cookies": "~1.3", "angular-localization": "~1.1.3", - "angular-ui-router": "~0.2.13" + "angular-ui-router": "~0.2.13", + "normalize.css": "~3.0.2" }, "devDependencies": { "angular-mocks": "~1.3", diff --git a/config.json b/config.json new file mode 100644 index 0000000..4526c49 --- /dev/null +++ b/config.json @@ -0,0 +1,5 @@ +{ + "server": { + "port": 3120 + } +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..963eb48 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,292 @@ +var gulp = require('gulp'), + rename = require("gulp-rename"), + csso = require('gulp-csso'), + sass = require('gulp-sass'), + rev = require('gulp-rev'), + minifyHTML = require('gulp-minify-html'), + wiredep = require('wiredep').stream, + connect = require('gulp-connect'), + uglify = require('gulp-uglify'), + concat = require('gulp-concat'), + stripDebug = require('gulp-strip-debug'), + size = require('gulp-size'), + jshint = require('gulp-jshint'), + browserSync = require('browser-sync'), + reload = browserSync.reload, + bower_files = require('bower-files')({dir: './app/bower_components'}) + htmlreplace = require('gulp-html-replace'), + karma = require('karma').server, + clean = require('gulp-clean'); + +var CFG = require("./config.json"); + +var SRC = { + js: [ + './app/**/*.js', + '!./app/bower_components/**/*', + '!*.spec.js', + '!*.e2e.js' + ], + scss: './app/assets/styles/main.scss', + html: './app/**/*.html' +}; + +var BUILD_DEST = "./build"; + +/******************************************* + * error handling + *******************************************/ +var plumber = require('gulp-plumber'); +var onError = function (err) { + console.log(err); +}; + +/******************************************* + * default + *******************************************/ +gulp.task('default', function() { + console.log(""); + console.log("========================================"); + console.log("usage:"); + console.log("----------------------------------------"); + console.log("gulp serve: start local development server"); + console.log("gulp build: prepare production pack in buil directory"); + console.log("gulp serve:build: start local production server"); + console.log("gulp test: run test once and exit"); + console.log("gulp tdd: watch for file changes and re-run tests on each change"); + console.log("========================================"); + console.log(""); +}); + +/******************************************* + * build + *******************************************/ + +gulp.task('build:clean', function () { + gulp.src(BUILD_DEST + '/**/*.*', { read: false }) + .pipe(clean()); +}); + +gulp.task('build:strings', function() { + gulp.src('./app/assets/strings/**/*.json') + .pipe(plumber({ errorHandler: onError })) + .pipe(gulp.dest(BUILD_DEST + '/assets/strings')); +}); + +gulp.task('build', [ + 'build:clean', + 'bower', + 'build:scripts', + 'build:strings', + 'build:styles', + 'build:images', + 'build:html' + ], function() { + console.log('built on ' + BUILD_DEST); +}); + +gulp.task('serve:build', ['build'], function(){ + browserSync({ + server: { + baseDir: BUILD_DEST + }, + port: browserSyncConfig.port + }); +}); + +/******************************************* + * development + *******************************************/ + +gulp.task('dev:clean', function () { + gulp.src('./tmp/**/*.*', { read: false }) + .pipe(clean()); +}); + +gulp.task('watch', function() { + gulp.watch([SRC.scss, SRC.js, SRC.html], function(event){ + return gulp.src(event.path) + .pipe(reload({ stream: true })); + }); + gulp.watch(SRC.scss, ['dev:styles']); + gulp.watch(SRC.js, ['jshint']); + gulp.watch('bower.json', ['bower']); +}); + +var browserSyncConfig = { + server: { + baseDir: "./app", + }, + port: CFG.server.port + }; + +gulp.task('browser-sync', function() { + browserSync(browserSyncConfig); +}); + +gulp.task('serve', [ + 'dev:clean', + 'bower', + 'dev:styles', + 'jshint', + 'watch', + 'browser-sync' +]); + +/******************************************* + * bower components + *******************************************/ + +gulp.task('bower:html', function () { + return gulp.src('./app/index.html') + .pipe(plumber({ errorHandler: onError })) + .pipe(wiredep({ + directory: './app/bower_components', + exclude: [ + 'bower_components/es5-shim/es5-shim.js', + 'bower_components/json3/lib/json3.js' + ] + })) + .pipe(gulp.dest('./app')); +}); + +gulp.task('bower:css', function () { + return gulp.src(SRC.scss) + .pipe(plumber({ errorHandler: onError })) + .pipe(wiredep({ + directory: './app/bower_components' + })) + .pipe(gulp.dest('./app/assets/styles')); +}); + +gulp.task('bower', ['bower:html', 'bower:css']); + +/******************************************* + * scripts + *******************************************/ + +gulp.task('build:scripts', ['build:scripts:application', 'build:scripts:vendor']); + +gulp.task('build:scripts:application', function() { + gulp.src(SRC.js) + .pipe(plumber({ errorHandler: onError })) + .pipe(jshint()) + .pipe(jshint.reporter('jshint-stylish')) + .pipe(stripDebug()) + .pipe(concat('main.js')) + .pipe(uglify()) + .pipe(rename({suffix: '.min'})) + .pipe(size()) + .pipe(gulp.dest(BUILD_DEST + '/assets')); +}); + +gulp.task('build:scripts:vendor', function() { + gulp.src(bower_files.js) + .pipe(plumber({ errorHandler: onError })) + .pipe(concat('vendor.js')) + .pipe(uglify()) + .pipe(rename({suffix: '.min'})) + .pipe(size()) + .pipe(gulp.dest(BUILD_DEST + '/assets')); +}); + +gulp.task('jshint', function() { + gulp.src(SRC.js) + .pipe(plumber({ errorHandler: onError })) + .pipe(jshint()) + .pipe(jshint.reporter('jshint-stylish')) +}); + +/******************************************* + * styles + *******************************************/ + +gulp.task('build:styles', ['build:styles:application', 'build:styles:vendor']); + +gulp.task('build:styles:application', function() { + gulp.src(SRC.scss) + .pipe(plumber({ errorHandler: onError })) + .pipe(sass()) + .pipe(concat('main.css')) + .pipe(csso()) + .pipe(rename({suffix: '.min'})) + .pipe(size()) + .pipe(gulp.dest(BUILD_DEST + '/assets')); +}); + +gulp.task('build:styles:vendor', function() { + gulp.src(bower_files.css) + .pipe(plumber({ errorHandler: onError })) + .pipe(sass()) + .pipe(concat('vendor.css')) + .pipe(csso()) + .pipe(rename({suffix: '.min'})) + .pipe(size()) + .pipe(gulp.dest(BUILD_DEST + '/assets')); +}); + +gulp.task('dev:styles', function() { + gulp.src(SRC.scss) + .pipe(plumber({ errorHandler: onError })) + .pipe(sass()) + .pipe(concat('main.css')) + .pipe(csso()) + .pipe(rename({suffix: '.min'})) + .pipe(size()) + .pipe(gulp.dest('./app/assets/styles')); +}); + +gulp.task('sass', function () { + gulp.src(SRC.scss) + .pipe(plumber({ errorHandler: onError })) + .pipe(sass()) + .pipe(gulp.dest('./.tmp/app/assets/styles')); +}); + +/******************************************* + * html + *******************************************/ + +gulp.task('build:html', function () { + return gulp.src(SRC.html) + .pipe(plumber({ errorHandler: onError })) + .pipe(htmlreplace({ + 'css': '/assets/main.min.css', + 'vendorcss': '/assets/vendor.min.css', + 'js': '/assets/main.min.js', + 'vendorjs': '/assets/vendor.min.js', + 'oldieshimjs': '/assets/oldieshim.min.js' + })) + .pipe(minifyHTML()) + .pipe(size()) + .pipe(gulp.dest(BUILD_DEST)); +}); + +/******************************************* + * images + *******************************************/ + +gulp.task('build:images', function () { + return gulp.src('./app/assets/images/**/*') + .pipe(plumber({ errorHandler: onError })) + .pipe(gulp.dest(BUILD_DEST + "/assets")); +}); + +/******************************************* + * test + *******************************************/ + +//Run test once and exit +gulp.task('test', function (done) { + karma.start({ + configFile: __dirname + '/karma.conf.js', + singleRun: true + }, done); +}); + +//Watch for file changes and re-run tests on each change +gulp.task('tdd', function (done) { + karma.start({ + configFile: __dirname + '/karma.conf.js' + }, done); +}); \ No newline at end of file diff --git a/package.json b/package.json index bc6cf3b..3b3f29b 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,45 @@ { "name": "webapp", "version": "0.0.0", - "dependencies": {}, + "dependencies": { + "gulp": "^3.8.10" + }, "devDependencies": { "angular-hint": "0.0.0", - "grunt": "^0.4.1", - "grunt-autoprefixer": "^0.7.3", - "grunt-concurrent": "^0.5.0", - "grunt-contrib-clean": "^0.5.0", - "grunt-contrib-compass": "^1.0.1", - "grunt-contrib-concat": "^0.4.0", - "grunt-contrib-connect": "^0.7.1", - "grunt-contrib-copy": "^0.5.0", - "grunt-contrib-cssmin": "^0.9.0", - "grunt-contrib-htmlmin": "^0.3.0", - "grunt-contrib-imagemin": "^0.8.1", - "grunt-contrib-jshint": "^0.10.0", - "grunt-contrib-uglify": "^0.4.0", - "grunt-contrib-watch": "^0.6.1", - "grunt-env": "^0.4.2", - "grunt-filerev": "^0.2.1", - "grunt-google-cdn": "^0.4.0", - "grunt-karma": "^0.9.0", - "grunt-newer": "^0.7.0", - "grunt-ng-annotate": "^0.3.0", - "grunt-preprocess": "^4.0.0", - "grunt-react": "^0.9.0", - "grunt-svgmin": "^0.4.0", - "grunt-usemin": "^2.1.1", - "grunt-wiredep": "^1.7.0", - "jshint-stylish": "^0.2.0", + "bower-files": "^2.2.1", + "browser-sync": "^1.8.3", + "del": "^1.1.1", + "gulp": "^3.8.10", + "gulp-add-src": "^0.2.0", + "gulp-clean": "^0.3.1", + "gulp-concat": "^2.4.3", + "gulp-connect": "^2.2.0", + "gulp-csso": "^0.2.9", + "gulp-html-replace": "^1.4.1", + "gulp-jshint": "^1.9.0", + "gulp-minify-html": "^0.1.8", + "gulp-plumber": "^0.6.6", + "gulp-rename": "^1.2.0", + "gulp-rev": "^2.0.1", + "gulp-sass": "^1.2.4", + "gulp-size": "^1.1.0", + "gulp-strip-debug": "^1.0.2", + "gulp-uglify": "^1.0.2", + "gulp-usemin": "^0.3.8", + "jshint-stylish": "^1.0.0", "karma": "^0.12.24", "karma-chai": "^0.1.0", "karma-mocha": "^0.1.9", "karma-phantomjs-launcher": "^0.1.4", "karma-sinon": "^1.0.3", - "load-grunt-tasks": "^0.4.0", "sinon": "^1.10.3", - "time-grunt": "^0.3.1" + "wiredep": "^2.2.2" }, "engines": { "node": ">=0.10.0" }, "scripts": { - "test": "grunt test" + "test": "gulp test", + "start": "gulp serve" } }