Commit d4f98249d56e5a7ea7f5b0932263fd04cc551370

Authored by Pablo Marco del Pont
Exists in master

Merge branch 'master' into 'master'

Master(efernandez)

See merge request modulos-npm/foca-login!1
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 clean = require('gulp-clean'); 3 const clean = require('gulp-clean');
4 const htmlmin = require('gulp-htmlmin'); 4 const htmlmin = require('gulp-htmlmin');
5 const rename = require('gulp-rename'); 5 const rename = require('gulp-rename');
6 const uglify = require('gulp-uglify-es').default; 6 const uglify = require('gulp-uglify-es').default;
7 const gulp = require('gulp'); 7 const gulp = require('gulp');
8 const pump = require('pump'); 8 const pump = require('pump');
9 const jshint = require('gulp-jshint'); 9 const jshint = require('gulp-jshint');
10 10
11 var paths = { 11 var paths = {
12 srcJS: 'src/js/*.js', 12 srcJS: 'src/js/*.js',
13 srcViews: 'src/views/*.html', 13 srcViews: 'src/views/*.html',
14 tmp: 'tmp', 14 tmp: 'tmp',
15 dist: 'dist/' 15 dist: 'dist/'
16 }; 16 };
17 17
18 gulp.task('templates', function() { 18 gulp.task('templates', function() {
19 return pump( 19 return pump(
20 [ 20 [
21 gulp.src(paths.srcViews), 21 gulp.src(paths.srcViews),
22 htmlmin(), 22 htmlmin(),
23 templateCache('views.js', { 23 templateCache('views.js', {
24 module: 'focaLogin', 24 module: 'focaLogin',
25 root: '' 25 root: ''
26 }), 26 }),
27 gulp.dest(paths.tmp) 27 gulp.dest(paths.tmp)
28 ] 28 ]
29 ); 29 );
30 }); 30 });
31 31
32 gulp.task('uglify', ['templates'], function() { 32 gulp.task('uglify', ['templates'], function() {
33 return pump( 33 return pump(
34 [ 34 [
35 gulp.src([ 35 gulp.src([
36 paths.srcJS, 36 paths.srcJS,
37 'tmp/views.js' 37 'tmp/views.js'
38 ]), 38 ]),
39 concat('foca-login.js'), 39 concat('foca-login.js'),
40 gulp.dest(paths.tmp), 40 gulp.dest(paths.tmp),
41 rename('foca-login.min.js'), 41 rename('foca-login.min.js'),
42 uglify(), 42 uglify(),
43 gulp.dest(paths.dist) 43 gulp.dest(paths.dist)
44 ] 44 ]
45 ); 45 );
46 }); 46 });
47 47
48 gulp.task('clean', function(){ 48 gulp.task('clean', function() {
49 return gulp.src(['tmp', 'dist'], {read: false}) 49 return gulp.src(['tmp', 'dist'], {read: false})
50 .pipe(clean()); 50 .pipe(clean());
51 }); 51 });
52 52
53 gulp.task('pre-commit', function() { 53 gulp.task('pre-commit', function() {
54 pump( 54 pump(
55 [ 55 [
56 gulp.src(paths.srcJS), 56 gulp.src(paths.srcJS),
57 jshint('.jshintrc'), 57 jshint('.jshintrc'),
58 jshint.reporter('default'), 58 jshint.reporter('default'),
59 jshint.reporter('fail') 59 jshint.reporter('fail')
60 ] 60 ]
61 ); 61 );
62 }); 62 });
63
64 gulp.task('clean-post-install', function() {
65 return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js',
66 'index.html'], {read: false})
67 .pipe(clean());
68 });
69
70 gulp.task('compile', ['templates', 'uglify']);
71
72 gulp.task('webserver', function() {
73 pump [
74 connect.server({port: 3000})
75 ]
76 });
77
78 gulp.task('default', ['webserver']);
63 79
1 { 1 {
2 "name": "foca-login", 2 "name": "foca-login",
3 "version": "1.0.0", 3 "version": "0.0.1",
4 "description": "Login", 4 "description": "Login",
5 "main": "dist/foca-login.js", 5 "main": "dist/foca-login.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 compile",
9 "pre-commit": [ 9 "gulp-pre-commit": "gulp pre-commit",
10 "gulp-pre-commit" 10 "postinstall": "npm run compile && gulp clean-post-install",
11 ], 11 "install-dev": "npm install -D gulp gulp-connect jasmine-core pre-commit angular bootstrap font-awesome gulp-angular-templatecache gulp-clean gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-sequence gulp-uglify-es jquery jshint pump"
12 "postinstall": "npm run compile && rm -R src && rm index.html && rm .jshintrc && rm gulpfile.js"
13 }, 12 },
13 "pre-commit": [
14 "gulp-pre-commit"
15 ],
14 "repository": { 16 "repository": {
15 "type": "git", 17 "type": "git",
16 "url": "https://192.168.0.11/modulos-npm/foca-login.git" 18 "url": "https://192.168.0.11/modulos-npm/foca-login.git"
17 }, 19 },
18 "author": "Foca Software", 20 "author": "Foca Software",
19 "license": "ISC", 21 "license": "ISC",
20 "peerDependencies": { 22 "peerDependencies": {
21 "angular": "^1.7.x", 23 "angular": "^1.7.x",
22 "bootstrap": "^4.1.x", 24 "bootstrap": "^4.1.x",
23 "jquery": "^3.3.x", 25 "jquery": "^3.3.x",
24 "font-awesome": "^4.7.x", 26 "font-awesome": "^4.7.x",
25 "gulp": "^3.9.x", 27 "gulp": "^3.9.x",
26 "gulp-concat": "2.6.x", 28 "gulp-concat": "2.6.x",
27 "gulp-jshint": "^2.1.x", 29 "gulp-jshint": "^2.1.x",
28 "gulp-rename": "^1.4.x", 30 "gulp-rename": "^1.4.x",
29 "gulp-replace": "^1.0.x", 31 "gulp-replace": "^1.0.x",
30 "gulp-uglify-es": "^1.0.x", 32 "gulp-uglify-es": "^1.0.x",
31 "jshint": "^2.9.x", 33 "jshint": "^2.9.x",
32 "pump": "^3.0.x" 34 "pump": "^3.0.x"
33 }, 35 },
34 "devDependencies": { 36 "devDependencies": {
37 "angular": "^1.7.4",
38 "bootstrap": "^4.1.3",
39 "font-awesome": "^4.7.0",
40 "gulp": "^3.9.1",
41 "gulp-angular-templatecache": "^2.2.1",
42 "gulp-clean": "^0.4.0",
35 "gulp-connect": "^5.6.1", 43 "gulp-connect": "^5.6.1",
36 "jasmine-core": "3.2.1", 44 "gulp-htmlmin": "^5.0.1",
37 "pre-commit": "^1.2.2" 45 "gulp-jshint": "^2.1.0",
38 }, 46 "gulp-rename": "^1.4.0",
39 "dependencies": { 47 "gulp-replace": "^1.0.0",
40 "angular": "1.7.4", 48 "gulp-sequence": "^1.0.0",
41 "bootstrap": "4.1.3", 49 "gulp-uglify-es": "^1.0.4",
42 "font-awesome": "4.7.0", 50 "jasmine-core": "^3.2.1",
43 "gulp-angular-templatecache": "2.2.1", 51 "jquery": "^3.3.1",
44 "gulp-clean": "0.4.0", 52 "jshint": "^2.9.6",
45 "gulp-htmlmin": "5.0.1", 53 "pre-commit": "^1.2.2",
46 "gulp-jshint": "2.1.0", 54 "pump": "^3.0.0"
47 "gulp-rename": "1.4.0",
48 "gulp-replace": "1.0.0",