From 77ce4d0b160d7002364bd8c3d681dd94c8f523e4 Mon Sep 17 00:00:00 2001 From: efernandez Date: Mon, 11 Feb 2019 15:21:56 -0300 Subject: [PATCH] ulgify spec, quito inyecciones --- gulpfile.js | 23 ++++++++++++++++++----- package.json | 21 +++++++++++---------- src/js/app.js | 7 +------ 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index eca2c0a..842f64d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,10 +9,13 @@ const pump = require('pump'); const jshint = require('gulp-jshint'); const replace = require('gulp-replace'); const connect = require('gulp-connect'); +const header = require('gulp-header'); +const footer = require('gulp-footer'); var paths = { srcJS: 'src/js/*.js', srcViews: 'src/views/*.html', + specs: 'spec/*.js', tmp: 'tmp', dist: 'dist/' }; @@ -31,7 +34,7 @@ gulp.task('templates', function() { ); }); -gulp.task('uglify', ['templates'], function() { +gulp.task('uglify', ['templates', 'uglify-spec'], function() { return pump( [ gulp.src([ @@ -40,7 +43,6 @@ gulp.task('uglify', ['templates'], function() { ]), concat('foca-abm-precios-condiciones.js'), replace('src/views/', ''), - replace("['ngRoute', 'ui.bootstrap', 'focaModal']", '[]'), gulp.dest(paths.tmp), rename('foca-abm-precios-condiciones.min.js'), uglify(), @@ -49,15 +51,26 @@ gulp.task('uglify', ['templates'], function() { ); }); +gulp.task('uglify-spec', function() { + return pump([ + gulp.src(paths.specs), + concat('foca-abm-precios-condiciones.spec.js'), + replace("src/views/", ''), + header("describe('Módulo foca-abm-precios-condiciones', function() { \n"), + footer("});"), + gulp.dest(paths.dist) + ]); +}); + gulp.task('clean', function() { return gulp.src(['tmp', 'dist'], {read: false}) .pipe(clean()); }); gulp.task('pre-commit', function() { - pump( + return pump( [ - gulp.src(paths.srcJS), + gulp.src([paths.srcJS, paths.specs]), jshint('.jshintrc'), jshint.reporter('default'), jshint.reporter('fail') @@ -67,7 +80,7 @@ gulp.task('pre-commit', function() { gulp.task('clean-post-install', function() { return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', - 'index.html'], {read: false}) + 'index.html', 'spec'], {read: false}) .pipe(clean()); }); diff --git a/package.json b/package.json index 110096f..6a6b17c 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,11 @@ "description": "ABM de precios y condiciones", "main": "dist/foca-abm-precios-condiciones.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "test.html", "compile": "gulp uglify", "gulp-pre-commit": "gulp pre-commit", "postinstall": "npm run compile && gulp clean-post-install", - "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify gulp-replace jquery jshint pump git+http://git.focasoftware.com/npm/foca-modal.git" + "install-dev": "npm install -D jasmine-core pre-commit angular angular-route bootstrap ui-bootstrap4 font-awesome gulp gulp-angular-templatecache gulp-connect gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es gulp-uglify gulp-replace jquery jshint pump angular-mocks git+http://git.focasoftware.com/npm/foca-modal.git" }, "pre-commit": [ "gulp-pre-commit" @@ -34,15 +34,16 @@ "pump": "^3.0.x" }, "devDependencies": { - "angular": "^1.7.4", - "angular-route": "^1.7.5", - "bootstrap": "^4.1.3", + "angular": "^1.7.7", + "angular-mocks": "^1.7.7", + "angular-route": "^1.7.7", + "bootstrap": "^4.2.1", "foca-modal": "git+http://git.focasoftware.com/npm/foca-modal.git", "font-awesome": "^4.7.0", "gulp": "^3.9.1", - "gulp-angular-templatecache": "^2.2.1", + "gulp-angular-templatecache": "^2.2.6", "gulp-clean": "^0.4.0", - "gulp-connect": "^5.6.1", + "gulp-connect": "^5.7.0", "gulp-htmlmin": "^5.0.1", "gulp-jshint": "^2.1.0", "gulp-rename": "^1.4.0", @@ -50,11 +51,11 @@ "gulp-sequence": "^1.0.0", "gulp-uglify": "^3.0.1", "gulp-uglify-es": "^1.0.4", - "jasmine-core": "^3.2.1", + "jasmine-core": "^3.3.0", "jquery": "^3.3.1", - "jshint": "^2.9.6", + "jshint": "^2.10.1", "pre-commit": "^1.2.2", "pump": "^3.0.0", - "ui-bootstrap4": "^3.0.5" + "ui-bootstrap4": "^3.0.6" } } diff --git a/src/js/app.js b/src/js/app.js index b5425e0..34b8225 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,6 +1 @@ -angular.module('focaAbmPreciosCondiciones', [ - 'ngRoute', - 'ui.bootstrap', - 'focaModal', - 'focaBotoneraLateral' -]); +angular.module('focaAbmPreciosCondiciones', ['ngRoute']); -- 1.9.1