feat(gulp-diff): initial commit

This commit is contained in:
ikatyang
2017-07-14 20:08:45 +08:00
parent 01eff32a07
commit 8bee26922c
4 changed files with 61 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import * as gulp from 'gulp';
import * as diff from 'gulp-diff';
gulp.task('task', () => {
return gulp.src('src')
.pipe(diff('dest'))
.pipe(diff.reporter({fail: true}));
});
+32
View File
@@ -0,0 +1,32 @@
// Type definitions for gulp-diff 1.0
// Project: https://github.com/creativelive/gulp-diff
// Definitions by: Ika <https://github.com/ikatyang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import stream = require('stream');
/**
* Gulp task to diff files in the stream against a destination.
* @param dest target directory to diff against, defaults to diff against original source file
*/
declare function gulp_diff(dest?: string): stream.Transform;
declare namespace gulp_diff {
const diff: typeof gulp_diff;
function reporter(opts?: ReporterOptions): stream.Transform;
interface ReporterOptions {
/**
* do not show diff information, defaults to `false`
*/
quiet?: boolean;
/**
* emit an error on finding diffs, defaults to `false`
*/
fail?: boolean;
}
}
export = gulp_diff;
+18
View File
@@ -0,0 +1,18 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"gulp-diff-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}