Commit 0fa3808740a307440d8308e232ae8f80bbbedbc4
1 parent
8330867cf3
Exists in
master
Update package.json, gulpfile.js, .jshintrc files
Showing
3 changed files
with
134 additions
and
1 deletions
Show diff stats
.jshintrc
File was created | 1 | { | |
2 | /* | ||
3 | * ENVIRONMENTS | ||
4 | * ================= | ||
5 | */ | ||
6 | |||
7 | // Define globals exposed by modern browsers. | ||
8 | "browser": true, | ||
9 | |||
10 | // Define globals exposed by jQuery. | ||
11 | "jquery": true, | ||
12 | |||
13 | // Define globals exposed by Node.js. | ||
14 | "node": true, | ||
15 | |||
16 | // Allow ES6. | ||
17 | "esversion": 6, | ||
18 | |||
19 | /* | ||
20 | * ENFORCING OPTIONS | ||
21 | * ================= | ||
22 | */ | ||
23 | |||
24 | // Force all variable names to use either camelCase style or UPPER_CASE | ||
25 | // with underscores. | ||
26 | "camelcase": true, | ||
27 | |||
28 | // Prohibit use of == and != in favor of === and !==. | ||
29 | "eqeqeq": true, | ||
30 | |||
31 | // Enforce tab width of 2 spaces. | ||
32 | "indent": 4, | ||
33 | |||
34 | // Prohibit use of a variable before it is defined. | ||
35 | "latedef": false, | ||
36 | |||
37 | // Enforce line length to 100 characters | ||
38 | "maxlen": 100, | ||
39 | |||
40 | // Require capitalized names for constructor functions. | ||
41 | "newcap": true, | ||
42 | |||
43 | // Enforce use of single quotation marks for strings. | ||
44 | "quotmark": "single", | ||
45 | |||
46 | // Enforce placing 'use strict' at the top function scope | ||
47 | "strict": false, | ||
48 | |||
49 | // Prohibit use of explicitly undeclared variables. | ||
50 | "undef": true, | ||
51 | |||
52 | // Warn when variables are defined but never used. | ||
53 | "unused": true, | ||
54 | |||
55 | // Para que funcione en angular | ||
56 | "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], | ||
57 | /* | ||
58 | * RELAXING OPTIONS | ||
59 | * ================= | ||
60 | */ | ||
61 | |||
62 | // Suppress warnings about == null comparisons. | ||
63 | "eqnull": true | ||
64 | } | ||
65 |
gulpfile.js
File was created | 1 | const templateCache = require('gulp-angular-templatecache'); | |
2 | const concat = require('gulp-concat'); | ||
3 | const htmlmin = require('gulp-htmlmin'); | ||
4 | const rename = require('gulp-rename'); | ||
5 | const uglify = require('gulp-uglify'); | ||
6 | const gulp = require('gulp'); | ||
7 | const pump = require('pump'); | ||
8 | const jshint = require('gulp-jshint'); | ||
9 | const replace = require('gulp-replace'); | ||
10 | const connect = require('gulp-connect'); | ||
11 | |||
12 | var paths = { | ||
13 | srcJS: 'src/js/*.js', | ||
14 | srcViews: 'src/views/*.html', | ||
15 | tmp: 'tmp', | ||
16 | dist: 'dist/' | ||
17 | }; | ||
18 | |||
19 | gulp.task('templates', function() { | ||
20 | return pump( | ||
21 | [ | ||
22 | gulp.src(paths.srcViews), | ||
23 | replace('views/', ''), | ||
24 | htmlmin(), | ||
25 | templateCache('views.js', { | ||
26 | module: 'focaBusquedaProductos', | ||
27 | root: '' | ||
28 | }), | ||
29 | gulp.dest(paths.tmp) | ||
30 | ] | ||
31 | ); | ||
32 | }); | ||
33 | |||
34 | gulp.task('uglify', ['templates'], function() { | ||
35 | return pump( | ||
36 | [ | ||
37 | gulp.src([ | ||
38 | paths.srcJS, | ||
39 | 'tmp/views.js' | ||
40 | ]), | ||
41 | concat('foca-busqueda-productos.js'), | ||
42 | gulp.dest(paths.tmp), | ||
43 | rename('foca-busqueda-productos.min.js'), | ||
44 | uglify(), | ||
45 | gulp.dest(paths.dist) | ||
46 | ] | ||
47 | ); | ||
48 | }); | ||
49 | |||
50 | gulp.task('pre-commit', function() { | ||
51 | return pump( | ||
52 | [ | ||
53 | gulp.src(paths.srcJS), | ||
54 | jshint('.jshintrc'), | ||
55 | jshint.reporter('default'), | ||
56 | jshint.reporter('fail') | ||
57 | ] | ||
58 | ); | ||
59 | |||
60 | gulp.start('uglify'); | ||
61 | }); | ||
62 | |||
63 | gulp.task('webserver', function() { | ||
64 | pump [ | ||
65 | connect.server({port: 3000}) | ||
66 | ] | ||
67 | }); | ||
68 | |||
69 | gulp.task('default', ['webserver']); |
package.json
1 | { | 1 | { |
2 | "name": "foca-crear-nota-pedido", | 2 | "name": "foca-crear-nota-pedido", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | "description": "Listado y ABM nota de pedidos", | 4 | "description": "Listado y ABM nota de pedidos", |
5 | "main": "index.js", | 5 | "main": "index.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 && gulp html", | 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 && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js" |
10 | }, | 10 | }, |
11 | "repository": { | 11 | "repository": { |
12 | "type": "git", | 12 | "type": "git", |
13 | "url": "https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git" | 13 | "url": "https://192.168.0.11/modulos-npm/foca-crear-nota-pedido.git" |
14 | }, | 14 | }, |
15 | "author": "Foca Software", | 15 | "author": "Foca Software", |
16 | "license": "ISC", | 16 | "license": "ISC", |
17 | "dependencies": { | 17 | "dependencies": { |
18 | "angular": "^1.7.x", | 18 | "angular": "^1.7.x", |
19 | "angular-route": "^1.7.4", | 19 | "angular-route": "^1.7.4", |
20 | "bootstrap": "^4.1.x", | 20 | "bootstrap": "^4.1.x", |
21 | "font-awesome": "^4.7.x", | 21 | "font-awesome": "^4.7.x", |
22 | "gulp": "^3.9.x", | 22 | "gulp": "^3.9.x", |
23 | "gulp-concat": "2.6.x", | 23 | "gulp-concat": "2.6.x", |
24 | "gulp-jshint": "^2.1.x", | 24 | "gulp-jshint": "^2.1.x", |
25 | "gulp-rename": "^1.4.x", | 25 | "gulp-rename": "^1.4.x", |
26 | "gulp-replace": "^1.0.x", | 26 | "gulp-replace": "^1.0.x", |
27 | "gulp-uglify-es": "^1.0.x", | 27 | "gulp-uglify-es": "^1.0.x", |
28 | "jquery": "^3.3.x", | 28 | "jquery": "^3.3.x", |
29 | "jshint": "^2.9.x", | 29 | "jshint": "^2.9.x", |
30 | "pump": "^3.0.x", | 30 | "pump": "^3.0.x", |
31 | "ui-bootstrap4": "^3.0.5" | 31 | "ui-bootstrap4": "^3.0.5" |
32 | }, | 32 | }, |
33 | "devDependencies": { | 33 | "devDependencies": { |
34 | "gulp-connect": "^5.6.1", | 34 | "gulp-connect": "^5.6.1", |
35 | "jasmine-core": "3.2.1", | 35 | "jasmine-core": "3.2.1", |
36 | "pre-commit": "^1.2.2" | 36 | "pre-commit": "^1.2.2" |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 |