Commit 6f9ee97e73f188a20bcb984bf07189b83c7a07b9
1 parent
9c908cb50c
Exists in
master
descripcion package.json, ok gulpfile
Showing
3 changed files
with
5 additions
and
5 deletions
 
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 | const clean = require('gulp-clean'); | 
| 12 | 12 | ||
| 13 | var paths = { | 13 | var paths = { | 
| 14 | srcJS: 'src/js/*.js', | 14 | srcJS: 'src/js/*.js', | 
| 15 | srcViews: 'src/views/*.html', | 15 | srcViews: 'src/views/*.html', | 
| 16 | tmp: 'tmp', | 16 | tmp: 'tmp', | 
| 17 | dist: 'dist/' | 17 | dist: 'dist/' | 
| 18 | }; | 18 | }; | 
| 19 | 19 | ||
| 20 | gulp.task('clean', function() { | 20 | gulp.task('clean', function() { | 
| 21 | return gulp.src(['tmp', 'dist'], {read: false}) | 21 | return gulp.src(['tmp', 'dist'], {read: false}) | 
| 22 | .pipe(clean()); | 22 | .pipe(clean()); | 
| 23 | }); | 23 | }); | 
| 24 | 24 | ||
| 25 | gulp.task('templates', ['clean'], function() { | 25 | gulp.task('templates', ['clean'], function() { | 
| 26 | return pump( | 26 | return pump( | 
| 27 | [ | 27 | [ | 
| 28 | gulp.src(paths.srcViews), | 28 | gulp.src(paths.srcViews), | 
| 29 | htmlmin(), | 29 | htmlmin(), | 
| 30 | templateCache('views.js', { | 30 | templateCache('views.js', { | 
| 31 | module: 'focaModalInformeHojaRuta', | 31 | module: 'focaModalInformeHojaRuta', | 
| 32 | root: '' | 32 | root: '' | 
| 33 | }), | 33 | }), | 
| 34 | gulp.dest(paths.tmp) | 34 | gulp.dest(paths.tmp) | 
| 35 | ] | 35 | ] | 
| 36 | ); | 36 | ); | 
| 37 | }); | 37 | }); | 
| 38 | 38 | ||
| 39 | gulp.task('uglify', ['templates'], function() { | 39 | gulp.task('uglify', ['templates'], function() { | 
| 40 | return pump( | 40 | return pump( | 
| 41 | [ | 41 | [ | 
| 42 | gulp.src([ | 42 | gulp.src([ | 
| 43 | paths.srcJS, | 43 | paths.srcJS, | 
| 44 | 'tmp/views.js' | 44 | 'tmp/views.js' | 
| 45 | ]), | 45 | ]), | 
| 46 | concat('foca-modal-informe-hoja-ruta.js'), | 46 | concat('foca-modal-informe-hoja-ruta.js'), | 
| 47 | replace('src/views/', ''), | 47 | replace('src/views/', ''), | 
| 48 | replace("['ui.bootstrap', 'focaDirectivas', 'angular-ladda', 'focaModal']", '[]'), | 48 | replace("['ui.bootstrap']", '[]'), | 
| 49 | gulp.dest(paths.tmp), | 49 | gulp.dest(paths.tmp), | 
| 50 | rename('foca-modal-informe-hoja-ruta.min.js'), | 50 | rename('foca-modal-informe-hoja-ruta.min.js'), | 
| 51 | uglify(), | 51 | uglify(), | 
| 52 | gulp.dest(paths.dist) | 52 | gulp.dest(paths.dist) | 
| 53 | ] | 53 | ] | 
| 54 | ); | 54 | ); | 
| 55 | }); | 55 | }); | 
| 56 | 56 | ||
| 57 | gulp.task('pre-commit', function() { | 57 | gulp.task('pre-commit', function() { | 
| 58 | return pump( | 58 | return pump( | 
| 59 | [ | 59 | [ | 
| 60 | gulp.src(paths.srcJS), | 60 | gulp.src(paths.srcJS), | 
| 61 | jshint('.jshintrc'), | 61 | jshint('.jshintrc'), | 
| 62 | jshint.reporter('default'), | 62 | jshint.reporter('default'), | 
| 63 | jshint.reporter('fail') | 63 | jshint.reporter('fail') | 
| 64 | ] | 64 | ] | 
| 65 | ); | 65 | ); | 
| 66 | 66 | ||
| 67 | gulp.start('uglify'); | 67 | gulp.start('uglify'); | 
| 68 | }); | 68 | }); | 
| 69 | 69 | ||
| 70 | gulp.task('webserver', function() { | 70 | gulp.task('webserver', function() { | 
| 71 | pump [ | 71 | pump [ | 
| 72 | connect.server({port: 3000}) | 72 | connect.server({port: 3000}) | 
| 73 | ] | 73 | ] | 
| 74 | }); | 74 | }); | 
| 75 | 75 | ||
| 76 | gulp.task('clean-post-install', function() { | 76 | gulp.task('clean-post-install', function() { | 
| 77 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 77 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | 
| 78 | 'index.html'], {read: false}) | 78 | 'index.html'], {read: false}) | 
| 79 | .pipe(clean()); | 79 | .pipe(clean()); | 
| 80 | }); | 80 | }); | 
| 81 | 81 | ||
| 82 | gulp.task('default', ['webserver']); | 82 | gulp.task('default', ['webserver']); | 
| 83 | 83 | ||
| 84 | gulp.task('watch', function() { | 84 | gulp.task('watch', function() { | 
| 85 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']) | 85 | gulp.watch([paths.srcJS, paths.srcViews], ['uglify']) | 
| 86 | }); | 86 | }); | 
| 87 | 87 | ||
| 88 | gulp.task('copy', ['uglify'], function() { | 88 | gulp.task('copy', ['uglify'], function() { | 
| 89 | gulp.src('dist/*.js') | 89 | gulp.src('dist/*.js') | 
| 90 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-modal-nota-pedido/dist')); | 90 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-modal-nota-pedido/dist')); | 
| 91 | }); | 91 | }); | 
| 92 | 92 | ||
| 93 | gulp.task('watchAndCopy', function() { | 93 | gulp.task('watchAndCopy', function() { | 
| 94 | return gulp.watch([paths.srcJS, paths.srcViews], ['copy']); | 94 | return gulp.watch([paths.srcJS, paths.srcViews], ['copy']); | 
| 95 | }); | 95 | }); | 
| 96 | 96 | 
package.json
| 1 | { | 1 | { | 
| 2 | "name": "foca-modal-nota-pedido", | 2 | "name": "foca-modal-infrorme-hoja-ruta", | 
| 3 | "version": "0.0.1", | 3 | "version": "0.0.1", | 
| 4 | "description": "Modal para seleccion de notasPedido", | 4 | "description": "Modal para generar informes de correlatividad de hojas de ruta", | 
| 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 && gulp clean-post-install", | 9 | "postinstall": "npm run compile && gulp clean-post-install", | 
| 10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+http://git.focasoftware.com/npm/foca-directivas.git" | 10 | "install-dev": "npm install -D angular angular-ladda ladda@1.0.6 bootstrap font-awesome gulp gulp-angular-templatecache gulp-concat gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify gulp-clean jasmine-core jquery jshint pre-commit pump ui-bootstrap4 && npm i -D git+http://git.focasoftware.com/npm/foca-directivas.git" | 
| 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://debo.suite.repo/modulos-npm/foca-modal-nota-pedido" | 17 | "url": "https://debo.suite.repo/modulos-npm/foca-modal-infrorme-hoja-ruta" | 
| 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-concat": "^2.6.1", | 28 | "gulp-concat": "^2.6.1", | 
| 29 | "gulp-connect": "^5.6.1", | 29 | "gulp-connect": "^5.6.1", | 
| 30 | "gulp-htmlmin": "^5.0.1", | 30 | "gulp-htmlmin": "^5.0.1", | 
| 31 | "gulp-rename": "^1.4.0", | 31 | "gulp-rename": "^1.4.0", | 
| 32 | "gulp-replace": "^1.0.0", | 32 | "gulp-replace": "^1.0.0", | 
| 33 | "gulp-uglify": "^3.0.1", | 33 | "gulp-uglify": "^3.0.1", | 
| 34 | "jquery": "^3.3.1", | 34 | "jquery": "^3.3.1", | 
| 35 | "pump": "^3.0.0", | 35 | "pump": "^3.0.0", | 
| 36 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" | 36 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git" | 
| 37 | }, | 37 | }, | 
| 38 | "devDependencies": { | 38 | "devDependencies": { | 
| 39 | "angular": "^1.7.5", | 39 | "angular": "^1.7.5", | 
| 40 | "angular-ladda": "^0.4.3", | 40 | "angular-ladda": "^0.4.3", | 
| 41 | "bootstrap": "^4.1.3", | 41 | "bootstrap": "^4.1.3", | 
| 42 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | 42 | "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | 
| 43 | "font-awesome": "^4.7.0", | 43 | "font-awesome": "^4.7.0", | 
| 44 | "gulp": "^3.9.1", | 44 | "gulp": "^3.9.1", | 
| 45 | "gulp-angular-templatecache": "^2.2.3", | 45 | "gulp-angular-templatecache": "^2.2.3", | 
| 46 | "gulp-clean": "^0.4.0", | 46 | "gulp-clean": "^0.4.0", | 
| 47 | "gulp-concat": "^2.6.1", | 47 | "gulp-concat": "^2.6.1", | 
| 48 | "gulp-connect": "^5.6.1", | 48 | "gulp-connect": "^5.6.1", | 
| 49 | "gulp-htmlmin": "^5.0.1", | 49 | "gulp-htmlmin": "^5.0.1", | 
| 50 | "gulp-jshint": "^2.1.0", | 50 | "gulp-jshint": "^2.1.0", | 
| 51 | "gulp-rename": "^1.4.0", | 51 | "gulp-rename": "^1.4.0", | 
| 52 | "gulp-replace": "^1.0.0", | 52 | "gulp-replace": "^1.0.0", | 
| 53 | "gulp-uglify": "^3.0.1", | 53 | "gulp-uglify": "^3.0.1", | 
| 54 | "jasmine-core": "^3.3.0", | 54 | "jasmine-core": "^3.3.0", | 
| 55 | "jquery": "^3.3.1", | 55 | "jquery": "^3.3.1", | 
| 56 | "jshint": "^2.9.6", | 56 | "jshint": "^2.9.6", | 
| 57 | "ladda": "1.0.6", | 57 | "ladda": "1.0.6", | 
| 58 | "pre-commit": "^1.2.2", | 58 | "pre-commit": "^1.2.2", | 
| 59 | "pump": "^3.0.0", | 59 | "pump": "^3.0.0", | 
| 60 | "ui-bootstrap4": "^3.0.5" | 60 | "ui-bootstrap4": "^3.0.5" | 
| 61 | } | 61 | } | 
| 62 | } | 62 | } | 
| 63 | 63 | 
src/etc/develop.js.ejemplo
| 1 | angular.module('focaModalNotaPedido') | 1 | angular.module('focaModalInformeHojaRuta') | 
| 2 | .constant("API_ENDPOINT", { | 2 | .constant("API_ENDPOINT", { | 
| 3 | 'URL': '//127.0.0.1:9000' | 3 | 'URL': '//127.0.0.1:9000' | 
| 4 | }); | 4 | }); | 
| 5 | 5 |