Skip to content

Commit 8b1a0d6

Browse files
committed
[Fixes #51] Include version in file's header
1 parent fde966f commit 8b1a0d6

File tree

6 files changed

+438
-17
lines changed

6 files changed

+438
-17
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
55
"description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.",
66
"main": [
7-
"jquery.validate.unobtrusive.js"
7+
"dist/jquery.validate.unobtrusive.js"
88
],
99
"ignore": [
1010
"**/.*",

jquery.validate.unobtrusive.js renamed to dist/jquery.validate.unobtrusive.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/*!
2-
** Unobtrusive validation support library for jQuery and jQuery Validate
3-
** Copyright (C) Microsoft Corporation. All rights reserved.
4-
*/
1+
// Unobtrusive validation support library for jQuery and jQuery Validate
2+
// Copyright (C) Microsoft Corporation. All rights reserved.
3+
// @version v3.2.6
54

65
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
76
/*global document: false, jQuery: false */

jquery.validate.unobtrusive.min.js renamed to dist/jquery.validate.unobtrusive.min.js

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
var gulp = require("gulp"),
22
uglify = require("gulp-uglify"),
3-
rename = require('gulp-rename');
3+
rename = require('gulp-rename'),
4+
replace = require('gulp-replace'),
5+
lec = require('gulp-line-ending-corrector'),
6+
pkg = require('./package.json');
47

5-
gulp.task("minifyJS", function () {
6-
gulp.src(["jquery.validate.unobtrusive.js"], { base: "." })
8+
gulp.task("minifyJS", function(){
9+
gulp.src(["src/jquery.validate.unobtrusive.js"])
10+
.pipe(replace(/@version.*/, '@version v' + pkg.version))
11+
.pipe(gulp.dest("dist"))
712
.pipe(uglify({
813
preserveComments: 'license'
914
}))
15+
.pipe(lec({eolc: 'CRLF'}))
1016
.pipe(rename({suffix: '.min'}))
11-
.pipe(gulp.dest("."));
17+
.pipe(gulp.dest("dist"));
1218
});
1319

14-
gulp.task("default", ["minifyJS"]);
20+
gulp.task("default", ["minifyJS"]);

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "3.2.6",
44
"homepage": "https://github.com/aspnet/jquery-validation-unobtrusive",
55
"description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.",
6-
"main": "jquery.validate.unobtrusive.js",
6+
"main": "dist/jquery.validate.unobtrusive.js",
77
"repository": {
88
"type": "git",
99
"url": "git://github.com/aspnet/jquery-validation-unobtrusive.git"
@@ -29,8 +29,10 @@
2929
"jquery-validation": ">=1.8"
3030
},
3131
"devDependencies": {
32-
"gulp": "3.8.11",
32+
"gulp": "3.9.1",
3333
"gulp-rename": "1.2.2",
34-
"gulp-uglify": "1.2.0"
34+
"gulp-uglify": "2.0.0",
35+
"gulp-replace": "0.5.4",
36+
"gulp-line-ending-corrector": "1.0.1"
3537
}
3638
}

0 commit comments

Comments
 (0)