From 1dbfd8a1641614248d3415dd319537d35f8cc9f0 Mon Sep 17 00:00:00 2001 From: tkQubo Date: Mon, 24 Aug 2015 19:50:57 +0900 Subject: [PATCH 1/3] Add gulp-coffeeify --- gulp-coffeeify/gulp-coffeeify-tests.ts | 53 ++++++++++++++++++++++++++ gulp-coffeeify/gulp-coffeeify.d.ts | 42 ++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 gulp-coffeeify/gulp-coffeeify-tests.ts create mode 100644 gulp-coffeeify/gulp-coffeeify.d.ts diff --git a/gulp-coffeeify/gulp-coffeeify-tests.ts b/gulp-coffeeify/gulp-coffeeify-tests.ts new file mode 100644 index 000000000..662428563 --- /dev/null +++ b/gulp-coffeeify/gulp-coffeeify-tests.ts @@ -0,0 +1,53 @@ +/// +/// + +import gulp = require('gulp'); +import coffeeify = require('gulp-coffeeify'); + +// Basic usage +gulp.task('scripts', function() { + gulp.src('src/coffee/**/*.coffee') + .pipe(coffeeify()) + .pipe(gulp.dest('./build/js')); +}); + +gulp.task('scripts', function() { + gulp.src('src/coffee/**/*.coffee') + .pipe(coffeeify({ + options: { + debug: true, // source map + paths: [__dirname + '/node_modules', __dirname + '/src/coffee'] + } + })) + .pipe(gulp.dest('./build/js')); +}); + +gulp.task('scripts', function() { + gulp.src('src/coffee/**/*.coffee') + .pipe(coffeeify({ + aliases: [ + { + cwd: 'src/coffee/app', + base: 'app' + } + ] + })) + .pipe(gulp.dest('./build/js')); +}); + +var xform = function(data: string){ + return 'module.exports = "' + data + '"'; +}; +gulp.task('scripts', function() { + gulp.src('src/coffee/**/*.coffee') + .pipe(coffeeify({ + transforms: [ + { + ext: '.extension', + transform: xform + } + ] + })) + .pipe(gulp.dest('./build/js')); +}); + diff --git a/gulp-coffeeify/gulp-coffeeify.d.ts b/gulp-coffeeify/gulp-coffeeify.d.ts new file mode 100644 index 000000000..e47f863ac --- /dev/null +++ b/gulp-coffeeify/gulp-coffeeify.d.ts @@ -0,0 +1,42 @@ +// Type definitions for gulp-coffeeify +// Project: gulp-coffeeify +// Definitions by: Qubo +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "gulp-coffeeify" { + namespace coffeeify { + interface Coffeeify { + (option?: Option): NodeJS.ReadWriteStream; + } + + interface Option { + options?: { + debug?: boolean; + paths?: string[]; + }, + /** + * [DEPRECATED]: You should use a 'paths' options of browserify. + */ + aliases?: Aliases; + /** + * [DEPRECATED] + */ + transforms?: Transforms; + } + + interface Aliases { + cwd?: string; + base?: string; + } + + interface Transforms { + ext?: string; + transform?(data: string): string; + } + } + + var coffeeify: coffeeify.Coffeeify; + + export = coffeeify; +} + From 1781feb65cdf1fdf505aef85a00beccbe32f119d Mon Sep 17 00:00:00 2001 From: tkQubo Date: Mon, 24 Aug 2015 19:56:16 +0900 Subject: [PATCH 2/3] Fix project url --- gulp-coffeeify/gulp-coffeeify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulp-coffeeify/gulp-coffeeify.d.ts b/gulp-coffeeify/gulp-coffeeify.d.ts index e47f863ac..6973b38cc 100644 --- a/gulp-coffeeify/gulp-coffeeify.d.ts +++ b/gulp-coffeeify/gulp-coffeeify.d.ts @@ -1,5 +1,5 @@ // Type definitions for gulp-coffeeify -// Project: gulp-coffeeify +// Project: https://github.com/nariyu/gulp-coffeeify // Definitions by: Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped From 9b8299ce8b34edaea16329b4e391a77c77f91071 Mon Sep 17 00:00:00 2001 From: tkQubo Date: Mon, 24 Aug 2015 22:20:09 +0900 Subject: [PATCH 3/3] Add reference to node --- gulp-coffeeify/gulp-coffeeify.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gulp-coffeeify/gulp-coffeeify.d.ts b/gulp-coffeeify/gulp-coffeeify.d.ts index 6973b38cc..b847b8c03 100644 --- a/gulp-coffeeify/gulp-coffeeify.d.ts +++ b/gulp-coffeeify/gulp-coffeeify.d.ts @@ -3,6 +3,8 @@ // Definitions by: Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + declare module "gulp-coffeeify" { namespace coffeeify { interface Coffeeify {