Commit 6442c1fc116fe82ecefed79ec722ecadff450231
0 parents
Exists in
master
Primera versión estable.
Showing
6 changed files
with
186 additions
and
0 deletions
Show diff stats
.gitignore
| File was created | 1 | /node_modules | |
| 2 | /dist | ||
| 3 | /tmp | ||
| 4 | package-lock\.json | ||
| 5 | /src/etc/develop.js | ||
| 6 |
.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": true, | ||
| 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", "confirm"], | ||
| 57 | /* | ||
| 58 | * RELAXING OPTIONS | ||
| 59 | * ================= | ||
| 60 | */ | ||
| 61 | |||
| 62 | // Suppress warnings about == null comparisons. | ||
| 63 | "eqnull": true | ||
| 64 | } | ||
| 65 |
README.md
| File was created | 1 | Foca filtros | |
| 2 | ============ | ||
| 3 |
gulpfile.js
| File was created | 1 | const templateCache = require('gulp-angular-templatecache'); | |
| 2 | const concat = require('gulp-concat'); | ||
| 3 | const clean = require('gulp-clean'); | ||
| 4 | const htmlmin = require('gulp-htmlmin'); | ||
| 5 | const rename = require('gulp-rename'); | ||
| 6 | const uglify = require('gulp-uglify'); | ||
| 7 | const gulp = require('gulp'); | ||
| 8 | const pump = require('pump'); | ||
| 9 | const jshint = require('gulp-jshint'); | ||
| 10 | const replace = require('gulp-replace'); | ||
| 11 | |||
| 12 | var paths = { | ||
| 13 | srcJS: 'src/js/*.js', | ||
| 14 | tmp: 'tmp', | ||
| 15 | dist: 'dist/' | ||
| 16 | }; | ||
| 17 | |||
| 18 | gulp.task('uglify', ['clean'], function() { | ||
| 19 | return pump( | ||
| 20 | [ | ||
| 21 | gulp.src(paths.srcJS), | ||
| 22 | concat('foca-filtros.js'), | ||
| 23 | gulp.dest(paths.tmp), | ||
| 24 | rename('foca-filtros.min.js'), | ||
| 25 | uglify(), | ||
| 26 | gulp.dest(paths.dist) | ||
| 27 | ] | ||
| 28 | ); | ||
| 29 | }); | ||
| 30 | |||
| 31 | gulp.task('clean', function() { | ||
| 32 | return gulp.src(['tmp', 'dist'], {read: false}) | ||
| 33 | .pipe(clean()); | ||
| 34 | }); | ||
| 35 | |||
| 36 | gulp.task('pre-commit', function() { | ||
| 37 | pump( | ||
| 38 | [ | ||
| 39 | gulp.src(paths.srcJS), | ||
| 40 | jshint('.jshintrc'), | ||
| 41 | jshint.reporter('default'), | ||
| 42 | jshint.reporter('fail') | ||
| 43 | ] | ||
| 44 | ); | ||
| 45 | }); | ||
| 46 | |||
| 47 | gulp.task('clean-post-install', function() { | ||
| 48 | return gulp.src(['src', 'tmp', '.jshintrc','readme.md', '.gitignore', 'gulpfile.js', | ||
| 49 | 'index.html'], {read: false}) | ||
| 50 | .pipe(clean()); | ||
| 51 | }); | ||
| 52 | |||
| 53 | gulp.task('webserver', function() { | ||
| 54 | pump [ | ||
| 55 | connect.server({port: 3000}) | ||
| 56 | ] | ||
| 57 | }); | ||
| 58 | |||
| 59 | gulp.task('default', ['webserver']); | ||
| 60 | |||
| 61 | gulp.task('watch', function() { | ||
| 62 | return gulp.watch([paths.srcJS], ['uglify']); | ||
| 63 | }); | ||
| 64 | |||
| 65 | gulp.task('copy', ['uglify'], function() { | ||
| 66 | return gulp.src('dist/*.js') | ||
| 67 | .pipe(gulp.dest('../../wrapper-demo/node_modules/foca-filtros/dist')); | ||
| 68 | }); | ||
| 69 | |||
| 70 | gulp.task('watchAndCopy', function() { | ||
| 71 | return gulp.watch([paths.srcJS], ['copy']); | ||
| 72 | }); | ||
| 73 |
package.json
| File was created | 1 | { | |
| 2 | "name": "foca-modal", | ||
| 3 | "version": "0.0.1", | ||
| 4 | "description": "Filtros de foca", | ||
| 5 | "main": "index.js", | ||
| 6 | "scripts": { | ||
| 7 | "test": "echo \"Error: no test specified\" && exit 1", | ||
| 8 | "gulp-pre-commit": "gulp pre-commit", | ||
| 9 | "compile": "gulp uglify", | ||
| 10 | "postinstall": "npm run compile && gulp clean-post-install", | ||
| 11 | "install-dev": "npm install -D angular gulp gulp-angular-templatecache gulp-clean gulp-connect gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify jshint pump" | ||
| 12 | }, | ||
| 13 | "pre-commit": [ | ||
| 14 | "gulp-pre-commit" | ||
| 15 | ], | ||
| 16 | "repository": { | ||
| 17 | "type": "git", | ||
| 18 | "url": "https://debo.suite.repo/modulos-npm/foca-filtros.git" | ||
| 19 | }, | ||
| 20 | "author": "Foca Software", | ||
| 21 | "license": "ISC", | ||
| 22 | "devDependencies": { | ||
| 23 | "angular": "^1.7.5", | ||
| 24 | "gulp": "^3.9.1", | ||
| 25 | "gulp-angular-templatecache": "^2.2.3", | ||
| 26 | "gulp-clean": "^0.4.0", | ||
| 27 | "gulp-connect": "^5.6.1", | ||
| 28 | "gulp-htmlmin": "^5.0.1", | ||
| 29 | "gulp-jshint": "^2.1.0", | ||
| 30 | "gulp-rename": "^1.4.0", | ||
| 31 | "gulp-replace": "^1.0.0", | ||
| 32 | "gulp-uglify": "^3.0.1", | ||
| 33 | "jshint": "^2.9.6", | ||
| 34 | "pump": "^3.0.0" | ||
| 35 | } | ||
| 36 | } | ||
| 37 |
src/js/app.js
| File was created | 1 | angular.module('focaFiltros', []) | |
| 2 | .filter('comprobante', function() { | ||
| 3 | return function(valores) { | ||
| 4 | return (Array(5).join('0') + valores[0]).slice(-5) + '-' + | ||
| 5 | (Array(8).join('0') + valores[1]).slice(-8); | ||
| 6 | }; | ||
| 7 | }); | ||
| 8 |