Commit 79388fea638c9a22a309c9a920da5d97f9210795
Exists in
master
Merge branch 'master' of https://192.168.0.11/modulos-npm/foca-abm-plazo-pago
# Conflicts: # gulpfile.js # index.html # package.json
Showing
7 changed files
Show diff stats
.gitignore
| 1 | /node_modules | 1 | /node_modules |
| 2 | /dist | 2 | /dist |
| 3 | /tmp | 3 | /tmp |
| 4 | package-lock\.json | 4 | package-lock\.json |
| 5 | /src/etc/develop.js | ||
| 5 | /src/etc/develop.js | 6 |
gulpfile.js
| 1 | const clean = require('gulp-clean'); | 1 | const clean = require('gulp-clean'); |
| 2 | const concat = require('gulp-concat'); | 2 | const concat = require('gulp-concat'); |
| 3 | const connect = require('gulp-connect'); | 3 | const connect = require('gulp-connect'); |
| 4 | const gulp = require('gulp'); | 4 | const gulp = require('gulp'); |
| 5 | const htmlmin = require('gulp-htmlmin'); | 5 | const htmlmin = require('gulp-htmlmin'); |
| 6 | const jshint = require('gulp-jshint'); | 6 | const jshint = require('gulp-jshint'); |
| 7 | const pump = require('pump'); | 7 | const pump = require('pump'); |
| 8 | const rename = require('gulp-rename'); | 8 | const rename = require('gulp-rename'); |
| 9 | const templateCache = require('gulp-angular-templatecache'); | 9 | const replace = require('gulp-replace'); |
| 10 | const templateCache = require('gulp-angular-templatecache'); | ||
| 10 | const uglify = require('gulp-uglify-es').default; | 11 | const uglify = require('gulp-uglify-es').default; |
| 11 | 12 | ||
| 12 | var paths = { | 13 | var paths = { |
| 13 | dist: 'dist/', | 14 | dist: 'dist/', |
| 14 | srcJS: 'src/js/*.js', | 15 | srcJS: 'src/js/*.js', |
| 15 | srcViews: 'src/views/*.html', | 16 | srcViews: 'src/views/*.html', |
| 16 | tmp: 'tmp' | 17 | tmp: 'tmp' |
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | gulp.task('templates', ['clean'], function() { | 20 | gulp.task('templates', ['clean'], function() { |
| 20 | return pump( | 21 | return pump( |
| 21 | [ | 22 | [ |
| 22 | gulp.src(paths.srcViews), | 23 | gulp.src(paths.srcViews), |
| 23 | htmlmin(), | 24 | htmlmin(), |
| 24 | templateCache('views.js', { | 25 | templateCache('views.js', { |
| 25 | module: 'focaAbmPlazoPago', | 26 | module: 'focaAbmPlazoPago', |
| 26 | root: '' | 27 | root: '' |
| 27 | }), | 28 | }), |
| 28 | gulp.dest(paths.tmp) | 29 | gulp.dest(paths.tmp) |
| 29 | ] | 30 | ] |
| 30 | ); | 31 | ); |
| 31 | }); | 32 | }); |
| 32 | 33 | ||
| 33 | gulp.task('uglify', ['templates'], function() { | 34 | gulp.task('uglify', ['templates'], function() { |
| 34 | return pump( | 35 | return pump( |
| 35 | [ | 36 | [ |
| 36 | gulp.src([ | 37 | gulp.src([ |
| 37 | paths.srcJS, | 38 | paths.srcJS, |
| 38 | 'tmp/views.js' | 39 | 'tmp/views.js' |
| 39 | ]), | 40 | ]), |
| 41 | concat('foca-abm-plazo-pago.js'), | ||
| 42 | replace('src/views/', ''), | ||
| 40 | concat('foca-abm-plazo-pago.js'), | 43 | replace("['ngRoute', 'ui.bootstrap']", '[]'), |
| 41 | replace('src/views/', ''), | 44 | gulp.dest(paths.tmp), |
| 42 | replace("['ngRoute', 'ui.bootstrap']", '[]'), | 45 | rename('foca-abm-plazo-pago.min.js'), |
| 43 | gulp.dest(paths.tmp), | 46 | uglify(), |
| 44 | rename('foca-abm-plazo-pago.min.js'), | 47 | gulp.dest(paths.dist) |
| 45 | uglify(), | 48 | ] |
| 46 | gulp.dest(paths.dist) | 49 | ); |
| 47 | ] | 50 | }); |
| 48 | ); | 51 | |
| 49 | }); | 52 | gulp.task('clean', function(){ |
| 50 | 53 | return gulp.src(['tmp', 'dist'], {read: false}) | |
| 51 | gulp.task('clean', function(){ | 54 | .pipe(clean()); |
| 52 | return gulp.src(['tmp', 'dist'], {read: false}) | 55 | }); |
| 53 | .pipe(clean()); | 56 | |
| 54 | }); | 57 | gulp.task('pre-commit', function() { |
| 55 | 58 | pump( | |
| 56 | gulp.task('pre-commit', function() { | 59 | [ |
| 57 | pump( | 60 | gulp.src(paths.srcJS), |
| 58 | [ | 61 | jshint('.jshintrc'), |
| 59 | gulp.src(paths.srcJS), | 62 | jshint.reporter('default'), |
| 60 | jshint('.jshintrc'), | 63 | jshint.reporter('fail') |
| 61 | jshint.reporter('default'), | 64 | ] |
| 62 | jshint.reporter('fail') | 65 | ); |
| 66 | }); | ||
| 67 | |||
| 68 | gulp.task('clean-post-install', function() { | ||
| 69 | return gulp.src([ | ||
| 70 | 'src', 'tmp', '.jshintrc', 'readme.md', '.gitignore', 'gulpfile.js', 'index.html' | ||
| 71 | ], {read: false}) | ||
| 72 | .pipe(clean()); | ||
| 73 | }); | ||
| 74 | |||
| 75 | gulp.task('webserver', function() { | ||
| 76 | pump [ | ||
| 77 | connect.server({port: 3000}) | ||
| 78 | ] | ||
| 79 | }); | ||
| 63 | ] | 80 | |
| 64 | ); | 81 | gulp.task('default', ['webserver']); |
| 65 | }); | 82 |
index.html
| 1 | <html ng-app="focaAbmPlazoPago"> | ||
| 2 | <head> | ||
| 3 | <meta charset="UTF-8" /> | ||
| 4 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
| 5 | |||
| 6 | <!--CSS--> | ||
| 7 | <link href="node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" /> | ||
| 8 | <link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet" /> | ||
| 9 | |||
| 10 | <!--VENDOR JS--> | ||
| 11 | <script src="node_modules/jquery/dist/jquery.min.js"></script> | ||
| 12 | <script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script> | ||
| 13 | <script src="node_modules/angular/angular.min.js"></script> | ||
| 14 | <script src="node_modules/angular-route/angular-route.min.js"></script> | ||
| 15 | <script src="node_modules/ui-bootstrap4/dist/ui-bootstrap-tpls.js"></script> | ||
| 16 | |||
| 17 | <!-- BUILD --> | ||
| 18 | <script src="src/js/app.js"></script> | ||
| 19 | <script src="src/js/route.js"></script> | ||
| 20 | <script src="src/js/controller.js"></script> | ||
| 21 | <script src="src/js/service.js"></script> | ||
| 22 | <script src="src/etc/develop.js"></script> | ||
| 23 | <!-- /BUILD --> | ||
| 24 | </head> | ||
| 25 | <body> | ||
| 26 | <div ng-view></div> | ||
| 1 | <html ng-app="focaAbmPlazoPago"> | 27 | </body> |
| 2 | <head> | 28 | </html> |
| 3 | <meta charset="UTF-8" /> | 29 |
package.json
| 1 | { | 1 | { |
| 2 | "name": "foca-abm-plazo-pago", | 2 | "name": "foca-abm-plazo-pago", |
| 3 | "version": "1.0.0", | 3 | "version": "1.0.0", |
| 4 | "description": "ABM de Plazos de Pago", | 4 | "description": "ABM de Plazos de Pago", |
| 5 | "main": "dist/foca-abm-plazo-pago.js", | 5 | "main": "dist/foca-abm-plazo-pago.js", |
| 6 | "scripts": { | 6 | "scripts": { |
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
| 8 | "compile": "gulp uglify", | 8 | "compile": "gulp uglify", |
| 9 | "gulp-pre-commit": "gulp pre-commit", | 9 | "gulp-pre-commit": "gulp pre-commit", |
| 10 | "postinstall": "npm run compile && gulp clean-post-install", | 10 | "postinstall": "npm run compile && gulp clean-post-install", |
| 11 | "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 jquery jshint pump" | 11 | "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 jquery jshint pump" |
| 12 | }, | ||
| 13 | "pre-commit": [ | 12 | }, |
| 13 | "pre-commit": [ | ||
| 14 | "gulp-pre-commit" | ||
| 15 | ], | ||
| 14 | "gulp-pre-commit" | 16 | "repository": { |
| 15 | ], | 17 | "type": "git", |
| 16 | "repository": { | 18 | "url": "https://192.168.0.11/modulos-npm/foca-abm-plazo-pago.git" |
| 17 | "type": "git", | 19 | }, |
| 18 | "url": "https://192.168.0.11/modulos-npm/foca-abm-plazo-pago.git" | 20 | "author": "Foca Software", |
| 19 | }, | 21 | "license": "ISC", |
| 20 | "author": "Foca Software", | 22 | "peerDependencies": { |
| 21 | "license": "ISC", | 23 | "angular": "^1.7.x", |
| 22 | "peerDependencies": { | 24 | "bootstrap": "^4.1.x", |
| 23 | "angular": "^1.7.x", | 25 | "jquery": "^3.3.x", |
| 24 | "bootstrap": "^4.1.x", | 26 | "font-awesome": "^4.7.x", |
| 25 | "jquery": "^3.3.x", | 27 | "gulp": "^3.9.x", |
| 26 | "font-awesome": "^4.7.x", | 28 | "gulp-concat": "2.6.x", |
| 27 | "gulp": "^3.9.x", | 29 | "gulp-jshint": "^2.1.x", |
| 28 | "gulp-concat": "2.6.x", | 30 | "gulp-rename": "^1.4.x", |
| 29 | "gulp-jshint": "^2.1.x", | 31 | "gulp-replace": "^1.0.x", |
| 30 | "gulp-rename": "^1.4.x", | 32 | "gulp-uglify-es": "^1.0.x", |
| 31 | "gulp-replace": "^1.0.x", | 33 | "jshint": "^2.9.x", |
| 32 | "gulp-uglify-es": "^1.0.x", | 34 | "pump": "^3.0.x" |
| 33 | "jshint": "^2.9.x", | 35 | }, |
| 34 | "pump": "^3.0.x" | 36 | "devDependencies": { |
| 37 | "angular": "^1.7.5", | ||
| 38 | "angular-route": "^1.7.5", | ||
| 39 | "bootstrap": "^4.1.3", | ||
| 40 | "font-awesome": "^4.7.0", | ||
| 41 | "gulp": "^3.9.1", | ||
| 42 | "gulp-angular-templatecache": "^2.2.2", | ||
| 43 | "gulp-clean": "^0.4.0", | ||
| 35 | }, | 44 | "gulp-connect": "^5.6.1", |
| 36 | "devDependencies": { | 45 | "gulp-htmlmin": "^5.0.1", |
| 37 | "angular": "^1.7.5", | 46 | "gulp-jshint": "^2.1.0", |
| 38 | "angular-route": "^1.7.5", | 47 | "gulp-rename": "^1.4.0", |
| 39 | "bootstrap": "^4.1.3", | 48 | "gulp-replace": "^1.0.0", |
| 40 | "font-awesome": "^4.7.0", | 49 | "gulp-sequence": "^1.0.0", |
| 41 | "gulp": "^3.9.1", | 50 | "gulp-uglify-es": "^1.0.4", |
| 42 | "gulp-angular-templatecache": "^2.2.2", | 51 | "jasmine-core": "^3.2.1", |
| 43 | "gulp-clean": "^0.4.0", | 52 | "jquery": "^3.3.1", |
| 44 | "gulp-connect": "^5.6.1", | 53 | "jshint": "^2.9.6", |
| 45 | "gulp-htmlmin": "^5.0.1", | 54 | "pre-commit": "^1.2.2", |
| 46 | "gulp-jshint": "^2.1.0", | 55 | "pump": "^3.0.0", |
| 47 | "gulp-rename": "^1.4.0", | 56 | "ui-bootstrap4": "^3.0.5" |
| 48 | "gulp-replace": "^1.0.0", | ||
| 49 | "gulp-sequence": "^1.0.0", |
src/etc/develop.js.ejemplo
| File was created | 1 | angular.module('focaAbmPlazoPago') | |
| 2 | .constant("API_ENDPOINT", { | ||
| 3 | 'URL': 'http://192.168.0.23:9900' | ||
| 4 | }); | ||
| 5 |
src/js/app.js
| 1 | angular.module('focaAbmPlazoPago', ['ngRoute', 'ui.bootstrap']); | 1 | angular.module('focaAbmPlazoPago', ['ngRoute', 'ui.bootstrap']); |
| 2 | 2 |
src/js/route.js
| 1 | angular.module('focaAbmPlazoPago') | 1 | angular.module('focaAbmPlazoPago') |
| 2 | .config([ | 2 | .config([ |
| 3 | '$routeProvider', | 3 | '$routeProvider', |
| 4 | function($routeProvider) { | 4 | function($routeProvider) { |
| 5 | $routeProvider.when('/plazo-pago', { | 5 | $routeProvider.when('/plazo-pago', { |
| 6 | controller: 'focaAbmPlazosPagoController', | 6 | controller: 'focaAbmPlazosPagoController', |
| 7 | templateUrl: 'src/views/foca-abm-plazos-pago-listado.html' | 7 | templateUrl: 'src/views/foca-abm-plazos-pago-listado.html' |
| 8 | }); | 8 | }); |
| 9 | } | 9 | } |
| 10 | ]) | 10 | ]) |
| 11 | .config([ | 11 | .config([ |
| 12 | '$routeProvider', | 12 | '$routeProvider', |
| 13 | function($routeProvider) { | 13 | function($routeProvider) { |
| 14 | $routeProvider.when('/precio-condicion/:idPreciosCondiciones/plazo-pago/:id', { | 14 | $routeProvider.when('/precio-condicion/:idPreciosCondiciones/plazo-pago/:id', { |
| 15 | controller: 'focaAbmPlazoPagoController', | 15 | controller: 'focaAbmPlazoPagoController', |
| 16 | templateUrl: 'src/views/foca-abm-plazos-pago-item.html' | 16 | templateUrl: 'src/views/foca-abm-plazos-pago-item.html' |
| 17 | }); | 17 | }); |
| 18 | } | 18 | } |
| 19 | ]); | 19 | ]); |
| 20 | 20 |