Skip to content

Commit 19923ab

Browse files
committed
Update tools
Fix #34, update devDeps, add linter, modified build.
1 parent ed023df commit 19923ab

File tree

11 files changed

+89
-46
lines changed

11 files changed

+89
-46
lines changed

.jshintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/**
2+
bower_components/**

.jshintrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"bitwise": true,
3+
"immed": true,
4+
"newcap": true,
5+
"noarg": true,
6+
"noempty": true,
7+
"nonew": true,
8+
"trailing": true,
9+
"maxlen": 160,
10+
"boss": true,
11+
"eqnull": true,
12+
"expr": true,
13+
"laxbreak": true,
14+
"loopfunc": true,
15+
"sub": true,
16+
"undef": true,
17+
"indent": 2,
18+
"esnext": true,
19+
"node": true,
20+
"browser": true,
21+
"mocha": true,
22+
"globals": {
23+
"protractor": true,
24+
"browser": true,
25+
"by": true,
26+
"element": true,
27+
"it": true,
28+
"describe": true,
29+
"beforeEach": true,
30+
"afterEach": true,
31+
"expect": true,
32+
"sinon": true,
33+
"inject": true,
34+
"module": true,
35+
"angular": true
36+
}
37+
}

bower.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-validation-match",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"homepage": "https://github.com/TheSharpieOne/angular-validation-match",
55
"authors": [
66
"TheSharpieOne <[email protected]>"
@@ -33,9 +33,6 @@
3333
"tests"
3434
],
3535
"dependencies": {
36-
"angular": ">=1.2.0 <2.0.0"
37-
},
38-
"devDependencies": {
39-
"angular-mocks": ">=1.2.0 <2.0.0"
36+
"angular": ">=1.3.0 <2.0.0"
4037
}
4138
}

dist/angular-validation-match.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* angular-validation-match
33
* Checks if one input matches another
4-
* @version v1.6.0
4+
* @version v1.7.0
55
* @link https://github.com/TheSharpieOne/angular-validation-match
66
* @license MIT License, http://www.opensource.org/licenses/MIT
77
*/
@@ -17,9 +17,6 @@ function match ($parse) {
1717
restrict: 'A',
1818
link: function(scope, elem, attrs, ctrl) {
1919
if(!ctrl) {
20-
if(console && console.warn){
21-
console.warn('Match validation requires ngModel to be on the element');
22-
}
2320
return;
2421
}
2522

@@ -41,7 +38,9 @@ function match ($parse) {
4138
}else{
4239
value = ctrl.$viewValue === match;
4340
}
41+
/*jslint bitwise: true */
4442
value ^= notMatch;
43+
/*jslint bitwise: false */
4544
return !!value;
4645
};
4746

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*!
22
* angular-validation-match
33
* Checks if one input matches another
4-
* @version v1.6.0
4+
* @version v1.7.0
55
* @link https://github.com/TheSharpieOne/angular-validation-match
66
* @license MIT License, http://www.opensource.org/licenses/MIT
77
*/
8-
!function(a,b,c){"use strict";function d(a){return{require:"?ngModel",restrict:"A",link:function(c,d,e,f){function g(){var a=h(c);return b.isObject(a)&&a.hasOwnProperty("$viewValue")&&(a=a.$viewValue),a}if(!f)return void(console&&console.warn&&console.warn("Match validation requires ngModel to be on the element"));var h=a(e.match),i=a(e.matchCaseless),j=a(e.notMatch);c.$watch(g,function(){f.$$parseAndValidate()}),f.$validators.match=function(){var a,d=g(),e=j(c);return a=i(c)?b.lowercase(f.$viewValue)===b.lowercase(d):f.$viewValue===d,a^=e,!!a}}}}b.module("validation.match",[]),b.module("validation.match").directive("match",d),d.$inject=["$parse"]}(window,window.angular);
8+
!function(e,a,t){"use strict";function i(e){return{require:"?ngModel",restrict:"A",link:function(t,i,n,r){function c(){var e=o(t);return a.isObject(e)&&e.hasOwnProperty("$viewValue")&&(e=e.$viewValue),e}if(r){var o=e(n.match),u=e(n.matchCaseless),l=e(n.notMatch);t.$watch(c,function(){r.$$parseAndValidate()}),r.$validators.match=function(){var e,i=c(),n=l(t);return e=u(t)?a.lowercase(r.$viewValue)===a.lowercase(i):r.$viewValue===i,e^=n,!!e}}}}}a.module("validation.match",[]),a.module("validation.match").directive("match",i),i.$inject=["$parse"]}(window,window.angular);

files.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ var pkg = require('./package.json');
22

33
var pkgFiles = {
44
angular: [
5-
'bower_components/angular/angular.js'
5+
'node_modules/angular/angular.js'
66
],
77
karma: [
8-
'bower_components/angular/angular.js',
9-
'bower_components/angular-mocks/angular-mocks.js'
8+
'node_modules/chai/chai.js',
9+
'node_modules/sinon/pkg/sinon.js',
10+
'node_modules/dirty-chai/lib/dirty-chai.js',
11+
'node_modules/sinon-chai/lib/sinon-chai.js',
12+
'node_modules/chai/chai.js',
13+
'node_modules/angular/angular.js',
14+
'node_modules/angular-mocks/angular-mocks.js'
1015
],
1116
'karma-build': [
1217
'@karma',

gulpfile.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
var gulp = require('gulp');
44
var ngAnnotate = require('gulp-ng-annotate');
5-
var uglify = require('gulp-uglifyjs');
5+
var uglify = require('gulp-uglify');
66
var wrap = require('gulp-wrap');
77
var bump = require('gulp-bump');
88
var gulpKarma = require('gulp-karma');
9+
var rename = require('gulp-rename');
910
var gulpSequence = require('gulp-sequence').use(gulp);
1011
var pkg = require('./package.json');
1112
var files = require('./files');
@@ -17,7 +18,7 @@ var banner = '/*!\n' +
1718
' * <%= pkg.description %>\n' +
1819
' * @version v<%= pkg.version %>\n' +
1920
' * @link <%= pkg.homepage %>\n' +
20-
' * @license MIT License, http://www.opensource.org/licenses/MIT\n' +
21+
' * @license <%= pkg.license %> License, http://www.opensource.org/licenses/<%= pkg.license %>\n' +
2122
' */\n';
2223

2324
gulp.task('bump', function(){
@@ -35,12 +36,12 @@ gulp.task('buildDev', function () {
3536

3637
gulp.task('minBuild', function () {
3738
return gulp.src('./build/'+pkg.name+'.js')
38-
.pipe(uglify(pkg.name+'.min.js', {
39+
.pipe(uglify({
3940
outSourceMap: false,
4041
mangle: true,
41-
preserveComments: 'some'
42+
preserveComments: 'license'
4243
}))
43-
.pipe(wrap(banner+'<%= contents %>', {pkg: pkg}))
44+
.pipe(rename(pkg.name+'.min.js'))
4445
.pipe(gulp.dest('./build/'));
4546
});
4647

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = function (config) {
55
config.set({
66
basePath: './',
77

8-
frameworks: ['mocha', 'chai-sinon'],
8+
frameworks: ['mocha'],
99

1010
exclude: [],
1111

package.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*global Package*/
12
// package metadata file for Meteor.js
23
var packageName = 'silintzir:angular-validation-match';
34
var where = 'client';
@@ -21,4 +22,4 @@ Package.onUse(function(api) {
2122
api.use('angular:[email protected]', where); // Dependencies
2223

2324
api.addFiles('dist/angular-validation-match.js', where); // Files in use
24-
});
25+
});

package.json

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "angular-validation-match",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"homepage": "https://github.com/TheSharpieOne/angular-validation-match",
55
"description": "Checks if one input matches another",
66
"main": "./index.js",
77
"scripts": {
8-
"test": "gulp test"
8+
"test": "gulp test",
9+
"build": "gulp build"
910
},
1011
"repository": {
1112
"type": "git",
@@ -28,28 +29,29 @@
2829
"web": "https://github.com/TheSharpieOne"
2930
}
3031
],
31-
"license": [
32-
{
33-
"type": "MIT",
34-
"url": "http://www.opensource.org/licenses/MIT"
35-
}
36-
],
32+
"license": "MIT",
33+
"dependencies":{
34+
"angular": ">=1.3.0 <2.0.0"
35+
},
3736
"devDependencies": {
38-
"chai": "^1.10.0",
37+
"angular-mocks": ">=1.3.0 <2.0.0",
38+
"chai": "^3.4.1",
39+
"dirty-chai": "1.2.2",
3940
"gulp": "^3.9.0",
40-
"gulp-bump": "^0.1.13",
41-
"gulp-karma": "0.0.4",
42-
"gulp-ng-annotate": "^0.3.6",
43-
"gulp-sequence": "^0.3.1",
44-
"gulp-uglifyjs": "^0.4.4",
45-
"gulp-wrap": "^0.3.0",
46-
"karma": "^0.12.37",
47-
"karma-chai-sinon": "^0.1.5",
48-
"karma-chrome-launcher": "^0.1.12",
49-
"karma-firefox-launcher": "~0.1.0",
50-
"karma-mocha": "~0.1",
51-
"karma-phantomjs-launcher": "^0.1.4",
52-
"karma-script-launcher": "~0.1.0",
41+
"gulp-bump": "^1.0.0",
42+
"gulp-karma": "0.0.5",
43+
"gulp-ng-annotate": "^1.1.0",
44+
"gulp-rename": "^1.2.2",
45+
"gulp-sequence": "^0.4.1",
46+
"gulp-uglify": "^1.5.1",
47+
"gulp-wrap": "^0.11.0",
48+
"karma": "^0.13.15",
49+
"karma-chrome-launcher": "^0.2.2",
50+
"karma-firefox-launcher": "^0.1.0",
51+
"karma-mocha": "^0.2.1",
52+
"karma-phantomjs-launcher": "^0.2.1",
53+
"mocha": "^2.3.4",
54+
"phantomjs": "^1.9.19",
5355
"sinon": "^1.16.1",
5456
"sinon-chai": "^2.8.0"
5557
}

0 commit comments

Comments
 (0)