diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfa8b8a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ + +package-lock\.json diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..dd429f7 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,64 @@ +{ + /* + * ENVIRONMENTS + * ================= + */ + + // Define globals exposed by modern browsers. + "browser": true, + + // Define globals exposed by jQuery. + "jquery": true, + + // Define globals exposed by Node.js. + "node": true, + + // Allow ES6. + "esversion": 6, + + /* + * ENFORCING OPTIONS + * ================= + */ + + // Force all variable names to use either camelCase style or UPPER_CASE + // with underscores. + "camelcase": true, + + // Prohibit use of == and != in favor of === and !==. + "eqeqeq": true, + + // Enforce tab width of 2 spaces. + "indent": 4, + + // Prohibit use of a variable before it is defined. + "latedef": true, + + // Enforce line length to 100 characters + "maxlen": 100, + + // Require capitalized names for constructor functions. + "newcap": true, + + // Enforce use of single quotation marks for strings. + "quotmark": "single", + + // Enforce placing 'use strict' at the top function scope + "strict": false, + + // Prohibit use of explicitly undeclared variables. + "undef": true, + + // Warn when variables are defined but never used. + "unused": true, + + // Para que funcione en angular + "predef": ["angular", "alert", "spyOn", "expect", "it", "inject", "beforeEach", "describe"], + /* + * RELAXING OPTIONS + * ================= + */ + + // Suppress warnings about == null comparisons. + "eqnull": true +} diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..ae9a8a0 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,90 @@ +const gulp = require('gulp'); +const sass = require('gulp-sass'); +const concat = require('gulp-concat'); +const rename = require('gulp-rename'); +const uglify = require('gulp-uglify-es').default; +const pump = require('pump'); +const jshint = require('gulp-jshint'); +const replace = require('gulp-replace'); +const connect = require('gulp-connect'); +const watch = require('gulp-watch'); + +var paths = { + srcHTML : 'src/views/*.html', + srcJS : 'src/**/*.js', + dist : 'dist/', + distHTML : 'dist/views/' +}; + +gulp.task('uglify', function() { + pump( + [ + gulp.src(paths.srcJS), + concat('wrapper-demo.js'), + replace('/src/', '/dist/'), + gulp.dest(paths.dist), + rename('wrapper-demo.min.js'), + uglify(), + gulp.dest(paths.dist) + ] + ); +}); + +gulp.task('html', function() { + pump([ + gulp.src('index.html'), + replace(/\.*\/sgm, ''), + gulp.dest(paths.dist) + ]); + pump([ + gulp.src(paths.srcHTML), + gulp.dest(paths.distHTML) + ]); +}) + +gulp.task('sass', function() { + return gulp.src('src/style/scss/**/*.scss') + .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) + .pipe(gulp.dest('css')); +}); + +gulp.task('pre-commit', function() { + pump( + [ + gulp.src(paths.srcJS), + jshint('.jshintrc'), + jshint.reporter('default'), + jshint.reporter('fail') + ] + ); + gulp.start('uglify'); + gulp.start('sass'); +}); + +gulp.task('webserver', function() { + pump [ + connect.server( + { + port: 3000, + livereload: true + } + ) + ] +}); + +gulp.task('watch', function() { + gulp.watch(archivosJS, ['uglify']); + gulp.watch('css/scss/*.scss', ['sass']); +}) + +gulp.task('reload'), function() { + connect.reload(); +} + +gulp.task('livereload', function() { + gulp.watch('css/*.css', ['reload']); + gulp.watch('js/dist/*.js', ['reload']); + gulp.watch('vistas/**/*.html', ['reload']); +}); + +gulp.task('default', ['webserver']); diff --git a/index.html b/index.html new file mode 100644 index 0000000..269401e --- /dev/null +++ b/index.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/package.json b/package.json new file mode 100644 index 0000000..4437e80 --- /dev/null +++ b/package.json @@ -0,0 +1,46 @@ +{ + "name": "wrapper-demo", + "version": "0.0.1", + "description": "", + "main": "main.js", + "scripts": { + "initdev": "npm install gulp --global && npm install && npm install -g jshint", + "gulp-pre-commit": "gulp pre-commit", + "compile": "gulp uglify && gulp sass", + "electron": "electron .", + "electron-build": "gulp uglify && gulp html && gulp sass && electron ." + }, + "pre-commit": [ + "gulp-pre-commit" + ], + "repository": { + "type": "git", + "url": "https://192.168.0.11/Wrappers/wrapper-demo.git" + }, + "author": "Nicolas Guarnieri", + "license": "ISC", + "dependencies": { + "angular": "^1.7.4", + "angular-route": "1.7.3", + "bootstrap": "4.1.3", + "foca-botonera-horizontal": "git+https://192.168.0.11/modulos-npm/foca-botonera-horizontal.git", + "foca-turno-apertura": "git+https://192.168.0.11/modulos-npm/foca-turno-apertura.git", + "font-awesome": "4.7.0", + "jquery": "3.3.1" + }, + "devDependencies": { + "gulp": "3.9.1", + "gulp-concat": "2.6.1", + "gulp-connect": "^5.6.1", + "gulp-jshint": "^2.1.0", + "gulp-rename": "1.4.0", + "gulp-replace": "^1.0.0", + "gulp-sass": "4.0.1", + "gulp-uglify-es": "^1.0.4", + "gulp-watch": "^5.0.1", + "jasmine-core": "3.2.1", + "jshint": "^2.9.6", + "pre-commit": "^1.2.2", + "pump": "^3.0.0" + } +} diff --git a/src/js/app.js b/src/js/app.js new file mode 100644 index 0000000..6ef8fc3 --- /dev/null +++ b/src/js/app.js @@ -0,0 +1 @@ +angular.module('appWrapperDemo', ['ngRoute', 'focaBotoneraHorizontal', 'focaTurnoApertura']); diff --git a/src/js/placeholder.js b/src/js/placeholder.js new file mode 100644 index 0000000..e69de29 diff --git a/src/sass/general.scss b/src/sass/general.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/views/placeholder.html b/src/views/placeholder.html new file mode 100644 index 0000000..e69de29