Skip to content

Commit 6fd7efa

Browse files
committed
update build info
1 parent 7849de6 commit 6fd7efa

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

dist/diff.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
/*
2-
* head part of browser-dist file
3-
4-
*/
1+
/*! diff-merge v1.0.1 | nighca([email protected]) | Apache License(2.0) */
52

63
(function(global, undefined){
74

8-
/*
9-
* Compare using myers' LCS/SES algorithm
10-
* ( https://neil.fraser.name/software/diff_match_patch/myers.pdf )
11-
12-
*/
135

146
var compare = function(cnt1, cnt2, splitter){
157
var SPLITTER = typeof splitter === 'string' ? splitter : '',
@@ -148,10 +140,6 @@ var compare = function(cnt1, cnt2, splitter){
148140
if(typeof module === "object" && typeof module.exports === "object"){
149141
module.exports = compare;
150142
}
151-
/*
152-
* Merge diff results to origin scequence
153-
154-
*/
155143

156144
var merge = function(cnt, compareResult){
157145
var splitter = compareResult.splitter,
@@ -169,10 +157,6 @@ var merge = function(cnt, compareResult){
169157
if(typeof module === "object" && typeof module.exports === "object"){
170158
module.exports = merge;
171159
}
172-
/*
173-
* tail part of browser-dist file
174-
175-
*/
176160

177161
global.diff = {
178162
compare: compare,

dist/diff.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
var gulp = require('gulp');
22
var concat = require('gulp-concat');
33
var uglify = require('gulp-uglify');
4+
var replace = require('gulp-replace');
45
var del = require('del');
56

7+
var info = require('./package.json');
8+
9+
var head = '/*! diff-merge v' + info.version + ' | ' + info.author.name + '(' + info.author.email + ') | Apache License(2.0) */\n';
10+
611
var paths = {
712
dist: 'dist',
813
scripts: ['lib/head.js', 'lib/myers-compare.js', 'lib/merge.js', 'lib/tail.js']
@@ -15,13 +20,16 @@ gulp.task('clean', function(cb) {
1520
gulp.task('build-dev', ['clean'], function() {
1621
return gulp.src(paths.scripts)
1722
.pipe(concat('diff.js'))
23+
.pipe(replace(/\/\*[\s\S]*?\*\/\n/g, ''))
24+
.pipe(replace(/^/g, head))
1825
.pipe(gulp.dest(paths.dist));
1926
});
2027

2128
gulp.task('build', ['clean'], function() {
2229
return gulp.src(paths.scripts)
2330
.pipe(concat('diff.min.js'))
2431
.pipe(uglify())
32+
.pipe(replace(/^/g, head))
2533
.pipe(gulp.dest(paths.dist));
2634
});
2735

lib/myers-compare.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
22
* Compare using myers' LCS/SES algorithm
3-
* ( https://neil.fraser.name/software/diff_match_patch/myers.pdf )
43
54
*/
65

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"del": "^0.1.1",
1212
"gulp": "^3.8.7",
1313
"gulp-concat": "^2.3.4",
14+
"gulp-replace": "^0.4.0",
1415
"gulp-uglify": "^0.3.1"
1516
},
1617
"scripts": {
@@ -24,7 +25,10 @@
2425
"diff",
2526
"merge"
2627
],
27-
"author": "nighca",
28+
"author": {
29+
"name": "nighca",
30+
"email": "[email protected]"
31+
},
2832
"license": "Apache",
2933
"bugs": {
3034
"url": "https://github.com/nighca/diff-merge/issues"

0 commit comments

Comments
 (0)