Commit eb9f4bce716d29880902fb82750521b82f1a94b8
Exists in
master
Merge branch 'master' into 'master'
Master(efernandez) See merge request modulos-npm/foca-modal-petroleras!3
Showing
2 changed files
Show diff stats
gulpfile.js
| 1 | const templateCache = require('gulp-angular-templatecache'); | 1 | const templateCache = require('gulp-angular-templatecache'); |
| 2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
| 3 | const htmlmin = require('gulp-htmlmin'); | 3 | const htmlmin = require('gulp-htmlmin'); |
| 4 | const rename = require('gulp-rename'); | 4 | const rename = require('gulp-rename'); |
| 5 | const uglify = require('gulp-uglify'); | 5 | const uglify = require('gulp-uglify'); |
| 6 | const gulp = require('gulp'); | 6 | const gulp = require('gulp'); |
| 7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
| 8 | const jshint = require('gulp-jshint'); | 8 | const jshint = require('gulp-jshint'); |
| 9 | const replace = require('gulp-replace'); | 9 | const replace = require('gulp-replace'); |
| 10 | const connect = require('gulp-connect'); | 10 | const connect = require('gulp-connect'); |
| 11 | const clean = require('gulp-clean'); | ||
| 11 | 12 | ||
| 12 | var paths = { | 13 | var paths = { |
| 13 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', |
| 14 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', |
| 15 | tmp: 'tmp', | 16 | tmp: 'tmp', |
| 16 | dist: 'dist/' | 17 | dist: 'dist/' |
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | gulp.task('templates', function() { | 20 | gulp.task('templates', function() { |
| 20 | return pump( | 21 | return pump( |
| 21 | [ | 22 | [ |
| 22 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
| 23 | replace('views/', ''), | 24 | replace('views/', ''), |
| 24 | htmlmin(), | 25 | htmlmin(), |
| 25 | templateCache('views.js', { | 26 | templateCache('views.js', { |
| 26 | module: 'focaModalPetroleras', | 27 | module: 'focaModalPetroleras', |
| 27 | root: '' | 28 | root: '' |
| 28 | }), | 29 | }), |
| 29 | gulp.dest(paths.tmp) | 30 | gulp.dest(paths.tmp) |
| 30 | ] | 31 | ] |
| 31 | ); | 32 | ); |
| 32 | }); | 33 | }); |
| 33 | 34 | ||
| 34 | gulp.task('uglify', ['templates'], function() { | 35 | gulp.task('uglify', ['templates'], function() { |
| 35 | return pump( | 36 | return pump( |
| 36 | [ | 37 | [ |
| 37 | gulp.src([ | 38 | gulp.src([ |
| 38 | paths.srcJS, | 39 | paths.srcJS, |
| 39 | 'tmp/views.js' | 40 | 'tmp/views.js' |
| 40 | ]), | 41 | ]), |
| 41 | concat('foca-modal-petroleras.js'), | 42 | concat('foca-modal-petroleras.js'), |
| 42 | gulp.dest(paths.tmp), | 43 | gulp.dest(paths.tmp), |
| 43 | rename('foca-modal-petroleras.min.js'), | 44 | rename('foca-modal-petroleras.min.js'), |
| 44 | uglify(), | 45 | uglify(), |
| 45 | gulp.dest(paths.dist) | 46 | gulp.dest(paths.dist) |
| 46 | ] | 47 | ] |
| 47 | ); | 48 | ); |
| 48 | }); | 49 | }); |
| 49 | 50 | ||
| 50 | gulp.task('pre-commit', function() { | 51 | gulp.task('pre-commit', function() { |
| 51 | return pump( | 52 | return pump( |
| 52 | [ | 53 | [ |
| 53 | gulp.src(paths.srcJS), | 54 | gulp.src(paths.srcJS), |
| 54 | jshint('.jshintrc'), | 55 | jshint('.jshintrc'), |
| 55 | jshint.reporter('default'), | 56 | jshint.reporter('default'), |
| 56 | jshint.reporter('fail') | 57 | jshint.reporter('fail') |
| 57 | ] | 58 | ] |
| 58 | ); | 59 | ); |
| 59 | 60 | ||
| 60 | gulp.start('uglify'); | 61 | gulp.start('uglify'); |
| 61 | }); | 62 | }); |
| 62 | 63 | ||
| 63 | gulp.task('webserver', function() { | 64 | gulp.task('webserver', function() { |
| 64 | pump [ | 65 | pump [ |
| 65 | connect.server({port: 3000}) | 66 | connect.server({port: 3000}) |
| 66 | ] | 67 | ] |
| 67 | }); | 68 | }); |
| 68 | 69 | ||
| 70 | gulp.task('clean-post-install', function() { | ||
| 71 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | ||
| 72 | 'index.html'], {read: false}) | ||
| 73 | .pipe(clean()); | ||
| 74 | }); | ||
| 75 | |||
| 69 | gulp.task('default', ['webserver']); | 76 | gulp.task('default', ['webserver']); |
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-modal-petroleras", | 2 | "name": "foca-modal-petroleras", |
| 3 | "version": "0.0.2", | 3 | "version": "0.0.2", |
| 4 | "description": "Modal para seleccionar petroleras", | 4 | "description": "Modal para seleccionar petroleras", |
| 5 | "scripts": { | 5 | "scripts": { |
| 6 | "test": "echo \"Error: no test specified\" && exit 1", | 6 | "test": "echo \"Error: no test specified\" && exit 1", |
| 7 | "gulp-pre-commit": "gulp pre-commit", | 7 | "gulp-pre-commit": "gulp pre-commit", |
| 8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
| 9 | "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js", | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
| 10 | "install-dev": "npm install angular bootstrap jquery font-awesome gulp gulp-concat gulp-jshint gulp-rename gulp-replace gulp-uglify-es jshint pump gulp-connect gulp-uglify jasmine-core pre-commit gulp-angular-templatecache ui-bootstrap4 git+https://192.168.0.11/modulos-npm/foca-directivas" | 10 | "install-dev": "npm install angular bootstrap jquery font-awesome gulp gulp-concat gulp-jshint gulp-rename gulp-replace gulp-uglify-es gulp-clean jshint pump gulp-connect gulp-uglify jasmine-core pre-commit gulp-angular-templatecache ui-bootstrap4 git+https://192.168.0.11/modulos-npm/foca-directivas" |
| 11 | }, | 11 | }, |
| 12 | "pre-commit": [ | 12 | "pre-commit": [ |
| 13 | "gulp-pre-commit" | 13 | "gulp-pre-commit" |
| 14 | ], | 14 | ], |
| 15 | "repository": { | 15 | "repository": { |
| 16 | "type": "git", | 16 | "type": "git", |
| 17 | "url": "https://192.168.0.11/modulos-npm/foca-modal-petroleras" | 17 | "url": "https://192.168.0.11/modulos-npm/foca-modal-petroleras" |
| 18 | }, | 18 | }, |
| 19 | "author": "Nicolás Guarnieri", | 19 | "author": "Nicolás Guarnieri", |
| 20 | "license": "ISC", | 20 | "license": "ISC", |
| 21 | "peerDependencies": { | 21 | "peerDependencies": { |
| 22 | "angular": "^1.7.4", | 22 | "angular": "^1.7.4", |
| 23 | "bootstrap": "^4.1.3", | 23 | "bootstrap": "^4.1.3", |
| 24 | "font-awesome": "^4.7.0", | 24 | "font-awesome": "^4.7.0", |
| 25 | "ui-bootstrap4": "^3.0.4", | 25 | "ui-bootstrap4": "^3.0.4", |
| 26 | "gulp": "^3.9.1", | 26 | "gulp": "^3.9.1", |
| 27 | "gulp-angular-templatecache": "^2.2.1", | 27 | "gulp-angular-templatecache": "^2.2.1", |
| 28 | "gulp-clean": "^0.4.0", | ||
| 28 | "gulp-concat": "^2.6.1", | 29 | "gulp-concat": "^2.6.1", |
| 29 | "gulp-connect": "^5.6.1", | 30 | "gulp-connect": "^5.6.1", |
| 30 | "gulp-htmlmin": "^5.0.1", | 31 | "gulp-htmlmin": "^5.0.1", |
| 31 | "gulp-rename": "^1.4.0", | 32 | "gulp-rename": "^1.4.0", |
| 32 | "gulp-replace": "^1.0.0", | 33 | "gulp-replace": "^1.0.0", |
| 33 | "gulp-uglify": "^3.0.1", | 34 | "gulp-uglify": "^3.0.1", |
| 34 | "jquery": "^3.3.1", | 35 | "jquery": "^3.3.1", |
| 35 | "pump": "^3.0.0", | 36 | "pump": "^3.0.0", |
| 36 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" | 37 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas" |
| 37 | }, | 38 | }, |
| 38 | "devDependencies": { | 39 | "devDependencies": { |
| 39 | "angular": "^1.7.5", | 40 | "angular": "^1.7.5", |
| 40 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", |
| 41 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", | 42 | "foca-directivas": "git+https://192.168.0.11/modulos-npm/foca-directivas", |
| 42 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", |
| 43 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", |
| 44 | "gulp-angular-templatecache": "^2.2.1", | 45 | "gulp-angular-templatecache": "^2.2.1", |
| 46 | "gulp-clean": "^0.4.0", | ||
| 45 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", |
| 46 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", |
| 47 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", |
| 48 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", |
| 49 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", |
| 50 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", |
| 51 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", |
| 52 | "jasmine-core": "^3.2.1", | 54 | "jasmine-core": "^3.2.1", |
| 53 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", |
| 54 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", |
| 55 | "pre-commit": "^1.2.2", | 57 | "pre-commit": "^1.2.2", |
| 56 | "pump": "^3.0.0", | 58 | "pump": "^3.0.0", |
| 57 | "ui-bootstrap4": "^3.0.5" | 59 | "ui-bootstrap4": "^3.0.5" |
| 58 | } | 60 | } |
| 59 | } | 61 | } |
| 60 | 62 |