From 4837e53d25ed093aed6a5cf3120934f8ce0b9590 Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 03:56:11 +0000 Subject: [PATCH 01/10] Add definitions and tests for gulp-concat --- gulp-concat/gulp-concat-tests.ts | 23 +++++++++++++++++ gulp-concat/gulp-concat.d.ts | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 gulp-concat/gulp-concat-tests.ts create mode 100644 gulp-concat/gulp-concat.d.ts diff --git a/gulp-concat/gulp-concat-tests.ts b/gulp-concat/gulp-concat-tests.ts new file mode 100644 index 000000000..a2a475b97 --- /dev/null +++ b/gulp-concat/gulp-concat-tests.ts @@ -0,0 +1,23 @@ +/// +/// + +import gulp = require("gulp"); +import concat = require("gulp-concat"); + +gulp.task("concat:simple", () => { + gulp.src(["file*.txt"]) + .pipe(concat("file.txt")) + .pipe(gulp.dest("build")); +}); + +gulp.task("concat:newLine", () => { + gulp.src(["file*.txt"]) + .pipe(concat("file.txt", { newLine: ";" })) + .pipe(gulp.dest("build")); +}); + +gulp.task("concat:vinyl", () => { + gulp.src(["file*.txt"]) + .pipe(concat({ path: "file.txt", stat: { mode: 0666 } })) + .pipe(gulp.dest("build")); +}); diff --git a/gulp-concat/gulp-concat.d.ts b/gulp-concat/gulp-concat.d.ts new file mode 100644 index 000000000..cad21c303 --- /dev/null +++ b/gulp-concat/gulp-concat.d.ts @@ -0,0 +1,42 @@ +// Type definitions for gulp-concat +// Project: http://github.com/wearefractal/gulp-concat +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-concat" { + + interface IOptions { + newLine: string; + } + + interface IFsStats { + dev?: number; + ino?: number; + mode?: number; + nlink?: number; + uid?: number; + gid?: number; + rdev?: number; + size?: number; + blksize?: number; + blocks?: number; + atime?: Date; + mtime?: Date; + ctime?: Date; + } + + interface IVinylOptions { + cwd?: string; + base?: string; + path?: string; + stat?: IFsStats; + contents?: NodeJS.ReadableStream | Buffer; + } + + function concat(filename: string, options?: IOptions): NodeJS.ReadWriteStream; + function concat(options: IVinylOptions): NodeJS.ReadWriteStream; + + export = concat; +} From 8c5f9860a49defcaad100aed4c599e57b404f8aa Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 04:40:03 +0000 Subject: [PATCH 02/10] Add definitions and tests for gulp-flatten --- gulp-flatten/gulp-flatten-tests.ts | 17 +++++++++++++++++ gulp-flatten/gulp-flatten.d.ts | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 gulp-flatten/gulp-flatten-tests.ts create mode 100644 gulp-flatten/gulp-flatten.d.ts diff --git a/gulp-flatten/gulp-flatten-tests.ts b/gulp-flatten/gulp-flatten-tests.ts new file mode 100644 index 000000000..ee5622564 --- /dev/null +++ b/gulp-flatten/gulp-flatten-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +import gulp = require("gulp"); +import flatten = require("gulp-flatten"); + +gulp.task("flatten:simple", () => { + gulp.src(["files/**/*.txt"]) + .pipe(flatten()) + .pipe(gulp.dest("build")); +}); + +gulp.task("flatten:newPath", () => { + gulp.src(["files/**/*.txt"]) + .pipe(flatten({ newPath: "new/path" })) + .pipe(gulp.dest("build")); +}); diff --git a/gulp-flatten/gulp-flatten.d.ts b/gulp-flatten/gulp-flatten.d.ts new file mode 100644 index 000000000..ccd9cedf1 --- /dev/null +++ b/gulp-flatten/gulp-flatten.d.ts @@ -0,0 +1,17 @@ +// Type definitions for gulp-flatten +// Project: https://github.com/armed/gulp-flatten +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-flatten" { + + interface IOptions { + newPath: string; + } + + function flatten(options?: IOptions): NodeJS.ReadWriteStream; + + export = flatten; +} From 3613a5f06a168bb83b9a4f0b2c1df02c5a3ab038 Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 04:59:29 +0000 Subject: [PATCH 03/10] Add definitions and tests for gulp-inject --- gulp-inject/gulp-inject-tests.ts | 41 ++++++++++++++++++++++++++++++++ gulp-inject/gulp-inject.d.ts | 36 ++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 gulp-inject/gulp-inject-tests.ts create mode 100644 gulp-inject/gulp-inject.d.ts diff --git a/gulp-inject/gulp-inject-tests.ts b/gulp-inject/gulp-inject-tests.ts new file mode 100644 index 000000000..804e6f9b5 --- /dev/null +++ b/gulp-inject/gulp-inject-tests.ts @@ -0,0 +1,41 @@ +/// +/// + +import gulp = require("gulp"); +import inject = require("gulp-inject"); + +gulp.task("inject:simple", () => { + gulp.src("src/index.html") + .pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }))) + .pipe(gulp.dest("build")); +}); + +gulp.task("inject:relative", () => { + gulp.src(["src/index.html"]) + .pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }), { relative: true })) + .pipe(gulp.dest("build")); +}); + +gulp.task("inject:starttag", () => { + gulp.src(["src/index.html"]) + .pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }), { starttag: "" })) + .pipe(gulp.dest("build")); +}); + +gulp.task("inject:name", () => { + gulp.src(["src/index.html"]) + .pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css"], { read: false }), { name: "head" })) + .pipe(gulp.dest("build")); +}); + +gulp.task("inject:transform", () => { + gulp.src(["files.json"]) + .pipe(inject(gulp.src(["src/**/*.js", "src/**/*.css", "src/**/*.html"], { read: false }), { + starttag: "\"{{ext}}\": [", + endtag: "]", + transform: (filepath, file, i, length) => { + return " \"" + filepath + "\"" + (i + 1 < length ? "," : ""); + } + })) + .pipe(gulp.dest("build")); +}); diff --git a/gulp-inject/gulp-inject.d.ts b/gulp-inject/gulp-inject.d.ts new file mode 100644 index 000000000..42f5fb348 --- /dev/null +++ b/gulp-inject/gulp-inject.d.ts @@ -0,0 +1,36 @@ +// Type definitions for gulp-inject +// Project: https://github.com/klei/gulp-inject +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "gulp-inject" { + + import File = require("vinyl"); + + interface ITagFunction { + (targetExt: string, sourceExt: string): string; + } + + interface ITransformFunction { + (filepath: string, file?: File, index?: number, length?: number, targetFile?: File): string; + } + + interface IOptions { + ignorePath?: string | string[]; + relative?: boolean; + addPrefix?: string; + addRootSlash?: boolean; + name?: string; + starttag?: string | ITagFunction; + endtag?: string | ITagFunction; + transform?: ITransformFunction; + selfClosingTag?: boolean; + } + + function inject(sources: NodeJS.ReadableStream, options?: IOptions): NodeJS.ReadWriteStream; + + export = inject; +} From 4c11c0079c1c28c6dee540914b8b220172b98ef7 Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 05:28:53 +0000 Subject: [PATCH 04/10] Add definitions and tests for gulp-less --- gulp-less/gulp-less-tests.ts | 13 +++++++++++++ gulp-less/gulp-less.d.ts | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 gulp-less/gulp-less-tests.ts create mode 100644 gulp-less/gulp-less.d.ts diff --git a/gulp-less/gulp-less-tests.ts b/gulp-less/gulp-less-tests.ts new file mode 100644 index 000000000..76e0a697c --- /dev/null +++ b/gulp-less/gulp-less-tests.ts @@ -0,0 +1,13 @@ +/// +/// + +import gulp = require("gulp"); +import less = require("gulp-less"); + +gulp.task("less", () => { + gulp.src("less/**/*.less") + .pipe(less({ + paths: ["less/includes"] + })) + .pipe(gulp.dest("public/css")); +}); diff --git a/gulp-less/gulp-less.d.ts b/gulp-less/gulp-less.d.ts new file mode 100644 index 000000000..9ca5e35b7 --- /dev/null +++ b/gulp-less/gulp-less.d.ts @@ -0,0 +1,18 @@ +// Type definitions for gulp-less +// Project: https://github.com/plus3network/gulp-less +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-less" { + + interface IOptions { + paths: string[]; + plugins?: any[]; + } + + function less(options?: IOptions): NodeJS.ReadWriteStream; + + export = less; +} From ab697a6bbdedefc89af863b16e35c51eb57dbafa Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 06:15:45 +0000 Subject: [PATCH 05/10] Add definitions and tests for gulp-minify-css --- gulp-minify-css/gulp-minify-css-tests.ts | 11 +++++++++ gulp-minify-css/gulp-minify-css.d.ts | 31 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 gulp-minify-css/gulp-minify-css-tests.ts create mode 100644 gulp-minify-css/gulp-minify-css.d.ts diff --git a/gulp-minify-css/gulp-minify-css-tests.ts b/gulp-minify-css/gulp-minify-css-tests.ts new file mode 100644 index 000000000..1375042dd --- /dev/null +++ b/gulp-minify-css/gulp-minify-css-tests.ts @@ -0,0 +1,11 @@ +/// +/// + +import gulp = require("gulp"); +import minifyCSS = require("gulp-minify-css"); + +gulp.task("minify-css", () => { + gulp.src("css/**/*.css") + .pipe(minifyCSS({ keepBreaks: true })) + .pipe(gulp.dest("dist")); +}); diff --git a/gulp-minify-css/gulp-minify-css.d.ts b/gulp-minify-css/gulp-minify-css.d.ts new file mode 100644 index 000000000..be6d45b8b --- /dev/null +++ b/gulp-minify-css/gulp-minify-css.d.ts @@ -0,0 +1,31 @@ +// Type definitions for gulp-minify-css +// Project: https://github.com/jonathanepollack/gulp-minify-css +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "gulp-minify-css" { + + interface IOptions { + cache?: boolean; + advanced?: boolean; + aggressiveMerging?: boolean; + benchmark?: boolean; + compatibility?: string; + debug?: boolean; + inliner?: Object; + keepBreaks?: boolean; + keepSpecialComments?: string | number; + processImport?: boolean; + rebase?: boolean; + relativeTo?: string; + root?: string; + roundingPrecision?: number; + shorthandCompacting?: boolean; + } + + function minifyCSS(options?: IOptions): NodeJS.ReadWriteStream; + + export = minifyCSS; +} From 3492e30a639f3e079dc31bdd4077e4033b67065f Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 06:25:34 +0000 Subject: [PATCH 06/10] Add definitions and tests for gulp-tsd --- gulp-tsd/gulp-tsd-tests.ts | 17 +++++++++++++++++ gulp-tsd/gulp-tsd.d.ts | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 gulp-tsd/gulp-tsd-tests.ts create mode 100644 gulp-tsd/gulp-tsd.d.ts diff --git a/gulp-tsd/gulp-tsd-tests.ts b/gulp-tsd/gulp-tsd-tests.ts new file mode 100644 index 000000000..9475ace65 --- /dev/null +++ b/gulp-tsd/gulp-tsd-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +import gulp = require("gulp"); +import tsd = require("gulp-tsd"); + +gulp.task("tsd", () => { + gulp.src("gulp_tsd.json") + .pipe(tsd()); +}); + +gulp.task("tsd:options", callback => { + tsd({ + command: "reinstall", + config: "tsd.json" + }, callback); +}); diff --git a/gulp-tsd/gulp-tsd.d.ts b/gulp-tsd/gulp-tsd.d.ts new file mode 100644 index 000000000..68a4c6728 --- /dev/null +++ b/gulp-tsd/gulp-tsd.d.ts @@ -0,0 +1,21 @@ +// Type definitions for gulp-tsd +// Project: https://github.com/moznion/gulp-tsd +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "gulp-tsd" { + + interface IOptions { + command?: string; + latest?: boolean; + config?: string; + opts?: Object; + } + + function tsd(opts?: IOptions, callback?: gulp.ITaskCallback): NodeJS.ReadWriteStream; + + export = tsd; +} From 5bff44a0592dc2de161477d22ff9c2f31105ca81 Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 06:46:32 +0000 Subject: [PATCH 07/10] Add definitions and tests for main-bower-files --- main-bower-files/main-bower-files-tests.ts | 31 ++++++++++++++++++++ main-bower-files/main-bower-files.d.ts | 34 ++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 main-bower-files/main-bower-files-tests.ts create mode 100644 main-bower-files/main-bower-files.d.ts diff --git a/main-bower-files/main-bower-files-tests.ts b/main-bower-files/main-bower-files-tests.ts new file mode 100644 index 000000000..1658b3800 --- /dev/null +++ b/main-bower-files/main-bower-files-tests.ts @@ -0,0 +1,31 @@ +/// +/// + +import gulp = require("gulp"); +import mainBowerFiles = require("main-bower-files"); + +gulp.task("main-bower-files:simple", () => { + gulp.src(mainBowerFiles()) + .pipe(gulp.dest("dist/bower")); +}); + +gulp.task("main-bower-files:options", () => { + var files = mainBowerFiles({ + debugging: false, + env: process.env.NODE_ENV, + paths: { + bowerDirectory: "path/for/bower_components", + bowerrc: "path/for/.bowerrc", + bowerJson: "path/for/bower.json" + }, + checkExistence: false, + includeDev: false, + includeSelf: false, + filter: (filepath) => { + return filepath.indexOf("search") >= 0; + } + }); + + gulp.src(files, { base: "path/to/bower_components" }) + .pipe(gulp.dest("dist/bower")); +}); diff --git a/main-bower-files/main-bower-files.d.ts b/main-bower-files/main-bower-files.d.ts new file mode 100644 index 000000000..80a4996db --- /dev/null +++ b/main-bower-files/main-bower-files.d.ts @@ -0,0 +1,34 @@ +// Type definitions for main-bower-files +// Project: https://github.com/ck86/main-bower-files +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "main-bower-files" { + + interface IPaths { + bowerDirectory?: string; + bowerrc?: string; + bowerJson?: string; + } + + interface IFilterFunction { + (filepath: string): boolean; + } + + interface IOptions { + debugging?: boolean; + main?: string | string[] | Object; + env?: string; + paths?: IPaths | string; + checkExistence?: boolean; + includeDev?: boolean | string; + includeSelf?: boolean; + filter?: RegExp | IFilterFunction | string | string[]; + } + + function mainBowerFiles(options?: IOptions): string[]; + + export = mainBowerFiles; +} From dc2c61c4b295d88befeba7fa542582d0e8ec85dc Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 07:21:08 +0000 Subject: [PATCH 08/10] Add definitions and tests for merge-stream --- merge-stream/merge-stream-tests.ts | 13 +++++++++++++ merge-stream/merge-stream.d.ts | 16 ++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 merge-stream/merge-stream-tests.ts create mode 100644 merge-stream/merge-stream.d.ts diff --git a/merge-stream/merge-stream-tests.ts b/merge-stream/merge-stream-tests.ts new file mode 100644 index 000000000..e0c744953 --- /dev/null +++ b/merge-stream/merge-stream-tests.ts @@ -0,0 +1,13 @@ +/// + +import stream = require("stream"); +import Stream = stream.Readable; +import merge = require("merge-stream"); + +var stream1 = new Stream(); +var stream2 = new Stream(); + +var merged = merge(stream1, stream2); + +var stream3 = new Stream(); +merged.add(stream3); diff --git a/merge-stream/merge-stream.d.ts b/merge-stream/merge-stream.d.ts new file mode 100644 index 000000000..6dfffdb95 --- /dev/null +++ b/merge-stream/merge-stream.d.ts @@ -0,0 +1,16 @@ +// Type definitions for merge-stream +// Project: https://github.com/grncdr/merge-stream +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "merge-stream" { + + interface IMergedStream extends NodeJS.ReadWriteStream { + add: (source: NodeJS.ReadableStream) => IMergedStream; + } + + function merge(...streams: T[]): IMergedStream; + export = merge; +} From 0e40e8a1a4b150bd08cac4c0587e4fde709b6092 Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 07:43:52 +0000 Subject: [PATCH 09/10] Add definitions and tests for run-sequence --- run-sequence/run-sequence-tests.ts | 33 ++++++++++++++++++++++++++++++ run-sequence/run-sequence.d.ts | 19 +++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 run-sequence/run-sequence-tests.ts create mode 100644 run-sequence/run-sequence.d.ts diff --git a/run-sequence/run-sequence-tests.ts b/run-sequence/run-sequence-tests.ts new file mode 100644 index 000000000..98e57d9f3 --- /dev/null +++ b/run-sequence/run-sequence-tests.ts @@ -0,0 +1,33 @@ +/// +/// + +import gulp = require("gulp"); +import tmp = require("run-sequence"); +var runSequence = tmp.use(gulp); + +gulp.task("run-sequence", callback => { + runSequence("task1", + ["task2", "task3"], + "taks4", + callback); +}); + +gulp.task("task1", () => { + gulp.src("file1.txt") + .pipe(gulp.dest("build")); +}); + +gulp.task("task2", () => { + gulp.src("file2.txt") + .pipe(gulp.dest("build")); +}); + +gulp.task("task3", () => { + gulp.src("file3.txt") + .pipe(gulp.dest("build")); +}); + +gulp.task("task4", () => { + gulp.src("file4.txt") + .pipe(gulp.dest("build")); +}); diff --git a/run-sequence/run-sequence.d.ts b/run-sequence/run-sequence.d.ts new file mode 100644 index 000000000..3a2cb449c --- /dev/null +++ b/run-sequence/run-sequence.d.ts @@ -0,0 +1,19 @@ +// Type definitions for run-sequence +// Project: https://github.com/OverZealous/run-sequence +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "run-sequence" { + + interface IRunSequence { + (...streams: (string | string[] | gulp.ITaskCallback)[]): NodeJS.ReadWriteStream; + + use(gulp: gulp.Gulp): IRunSequence; + } + + var _tmp: IRunSequence; + export = _tmp; +} From 729356c657f45bef570286595a22ee4ea4e02fd9 Mon Sep 17 00:00:00 2001 From: Keita Kagurazaka Date: Wed, 4 Mar 2015 07:56:14 +0000 Subject: [PATCH 10/10] Add definitions and tests for stream-series --- stream-series/stream-series-tests.ts | 12 ++++++++++++ stream-series/stream-series.d.ts | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 stream-series/stream-series-tests.ts create mode 100644 stream-series/stream-series.d.ts diff --git a/stream-series/stream-series-tests.ts b/stream-series/stream-series-tests.ts new file mode 100644 index 000000000..2ed31ffb1 --- /dev/null +++ b/stream-series/stream-series-tests.ts @@ -0,0 +1,12 @@ +/// + +import stream = require("stream"); +import Stream = stream.Duplex; +import series = require("stream-series"); + +var stream1 = new Stream(); +var stream2 = new Stream(); +var stream3 = new Stream(); + +var orderedStream = series(stream1, stream3, stream2); +console.log(orderedStream.toString()); diff --git a/stream-series/stream-series.d.ts b/stream-series/stream-series.d.ts new file mode 100644 index 000000000..6c2d07d78 --- /dev/null +++ b/stream-series/stream-series.d.ts @@ -0,0 +1,11 @@ +// Type definitions for stream-series +// Project: https://github.com/rschmukler/stream-series +// Definitions by: Keita Kagurazaka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "stream-series" { + function series(...streams: T[]): NodeJS.ReadWriteStream; + export = series; +}