This commit is contained in:
Philipp Kunz 2016-02-01 02:28:43 +01:00
parent 3e46c8c927
commit 6a884cda78
14 changed files with 169401 additions and 4288 deletions

1
.gitignore vendored
View File

@ -5,5 +5,6 @@ npm-debug.log
ts/*.js ts/*.js
ts/*.js.map ts/*.js.map
ts/typings/
test/result/ test/result/

View File

@ -33,6 +33,6 @@
"devDependencies": { "devDependencies": {
"gulp": "3.9.0", "gulp": "3.9.0",
"gulp-callfunction": "0.0.10", "gulp-callfunction": "0.0.10",
"npmts": "^2.0.0" "npmts": "^2.0.2"
} }
} }

View File

@ -1,8 +1,9 @@
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var plugins = { var plugins = {
beautylog: require("beautylog"), beautylog: require("beautylog"),
gulp: require("gulp"), gulp: require("gulp"),
gulpBrowser: require("./index.js"), gulpBrowser: require("../index.js"),
gulpCallFunction: require("gulp-callfunction") gulpCallFunction: require("gulp-callfunction")
}; };
var pipeWorked = function () { var pipeWorked = function () {
@ -10,16 +11,17 @@ var pipeWorked = function () {
}; };
plugins.beautylog.log('Now trying to browserify a testfile...'); plugins.beautylog.log('Now trying to browserify a testfile...');
plugins.gulp.task('gulpBrowserTest', function (cb) { plugins.gulp.task('gulpBrowserTest', function (cb) {
var stream = plugins.gulp.src('./test/browserifyGulpTest.js') var stream = plugins.gulp.src('./testassets/browserifyGulpTest.js')
.pipe(plugins.gulpBrowser.browserify()) .pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/")) .pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked)); .pipe(plugins.gulpCallFunction(pipeWorked));
return stream; return stream;
}); });
plugins.gulp.task('gulpBrowserTestError', function (cb) { plugins.gulp.task('gulpBrowserTestError', function (cb) {
var stream = plugins.gulp.src('./test/browserifyGulpTestError.js') plugins.beautylog.info("Expecting an error:");
var stream = plugins.gulp.src('./testassets/browserifyGulpTestError.js')
.pipe(plugins.gulpBrowser.browserify()) .pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/")) .pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked)); .pipe(plugins.gulpCallFunction(pipeWorked));
return stream; return stream;
}); });

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
var myError = require("my-error");

View File

@ -1,9 +1,9 @@
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
console.log("**** starting test ****");
var plugins = { var plugins = {
beautylog: require("beautylog"), beautylog: require("beautylog"),
gulp: require("gulp"), gulp: require("gulp"),
gulpBrowser: require("./index.js"), gulpBrowser: require("../index.js"),
gulpCallFunction: require("gulp-callfunction") gulpCallFunction: require("gulp-callfunction")
}; };
@ -14,16 +14,17 @@ var pipeWorked = function() {
plugins.beautylog.log('Now trying to browserify a testfile...'); plugins.beautylog.log('Now trying to browserify a testfile...');
plugins.gulp.task('gulpBrowserTest',function(cb) { plugins.gulp.task('gulpBrowserTest',function(cb) {
var stream = plugins.gulp.src('./test/browserifyGulpTest.js') var stream = plugins.gulp.src('./testassets/browserifyGulpTest.js')
.pipe(plugins.gulpBrowser.browserify()) .pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/")) .pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked)); .pipe(plugins.gulpCallFunction(pipeWorked));
return stream; return stream;
}); });
plugins.gulp.task('gulpBrowserTestError',function(cb) { plugins.gulp.task('gulpBrowserTestError',function(cb) {
var stream = plugins.gulp.src('./test/browserifyGulpTestError.js') plugins.beautylog.info("Expecting an error:");
var stream = plugins.gulp.src('./testassets/browserifyGulpTestError.js')
.pipe(plugins.gulpBrowser.browserify()) .pipe(plugins.gulpBrowser.browserify())
.pipe(plugins.gulp.dest("./test/result/")) .pipe(plugins.gulp.dest("./testassets/result/"))
.pipe(plugins.gulpCallFunction(pipeWorked)); .pipe(plugins.gulpCallFunction(pipeWorked));
return stream; return stream;
}); });

View File

@ -1,2 +0,0 @@
/// <reference path="browser/ambient/browserify/browserify.d.ts" />
/// <reference path="browser/ambient/node/node.d.ts" />

View File

@ -1,42 +0,0 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9/browserify/browserify.d.ts
// Type definitions for Browserify
// Project: http://browserify.org/
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface BrowserifyObject extends NodeJS.EventEmitter {
add(file:string, opts?:any): BrowserifyObject;
require(file:string, opts?:{
expose: string;
}): BrowserifyObject;
bundle(opts?:{
insertGlobals?: boolean;
detectGlobals?: boolean;
debug?: boolean;
standalone?: string;
insertGlobalVars?: any;
}, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
external(file:string, opts?:any): BrowserifyObject;
ignore(file:string, opts?:any): BrowserifyObject;
transform(tr:string, opts?:any): BrowserifyObject;
transform(tr:Function, opts?:any): BrowserifyObject;
plugin(plugin:string, opts?:any): BrowserifyObject;
plugin(plugin:Function, opts?:any): BrowserifyObject;
}
interface Browserify {
(): BrowserifyObject;
(files:string[]): BrowserifyObject;
(opts:{
entries?: string[];
noParse?: string[];
}): BrowserifyObject;
}
declare module "browserify" {
var browserify: Browserify;
export = browserify;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
/// <reference path="main/ambient/browserify/browserify.d.ts" />
/// <reference path="main/ambient/node/node.d.ts" />

View File

@ -1,42 +0,0 @@
// Compiled using typings@0.6.3
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9/browserify/browserify.d.ts
// Type definitions for Browserify
// Project: http://browserify.org/
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface BrowserifyObject extends NodeJS.EventEmitter {
add(file:string, opts?:any): BrowserifyObject;
require(file:string, opts?:{
expose: string;
}): BrowserifyObject;
bundle(opts?:{
insertGlobals?: boolean;
detectGlobals?: boolean;
debug?: boolean;
standalone?: string;
insertGlobalVars?: any;
}, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
external(file:string, opts?:any): BrowserifyObject;
ignore(file:string, opts?:any): BrowserifyObject;
transform(tr:string, opts?:any): BrowserifyObject;
transform(tr:Function, opts?:any): BrowserifyObject;
plugin(plugin:string, opts?:any): BrowserifyObject;
plugin(plugin:Function, opts?:any): BrowserifyObject;
}
interface Browserify {
(): BrowserifyObject;
(files:string[]): BrowserifyObject;
(opts:{
entries?: string[];
noParse?: string[];
}): BrowserifyObject;
}
declare module "browserify" {
var browserify: Browserify;
export = browserify;
}

File diff suppressed because it is too large Load Diff