From 177d7ba69be866c2861088a4eb236a66df77fc96 Mon Sep 17 00:00:00 2001 From: Denys Vitali Date: Sat, 12 Mar 2016 19:13:38 +0100 Subject: [PATCH 1/4] Removed dirtyness which led to the following error when installed from NPM: `Error: Cannot find module 'es6-module-transpiler/node_modules/recast'` --- lib/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index cc8768b..45b0400 100644 --- a/lib/index.js +++ b/lib/index.js @@ -7,10 +7,7 @@ var sourceMap = require('vinyl-sourcemaps-apply'); var transpiler = require('es6-module-transpiler'); var path = require('path'); -// this is dirty, I know - however, installing an own version -// of reacast can lead to errors because of gulp-es6mt and -// es6-module-transpiler using different instances of recast -var recast = require('es6-module-transpiler/node_modules/recast'); +var recast = require('recast'); var FileResolver = transpiler.FileResolver; From 798ef67de5b8f1c2502aede574476e9acbeaf812 Mon Sep 17 00:00:00 2001 From: Denys Vitali Date: Sat, 12 Mar 2016 20:02:23 +0100 Subject: [PATCH 2/4] Corrected error in test (function called before it was defined) --- test/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/index.js b/test/index.js index fb93595..d0902e5 100644 --- a/test/index.js +++ b/test/index.js @@ -60,7 +60,7 @@ describe('gulp-es6-module-transpiler', function() { callback(error); }); - stream.on('data', function (file) { + stream.on('data', function(file) { expect(file).to.be.ok(); callback(null, file); @@ -73,6 +73,10 @@ describe('gulp-es6-module-transpiler', function() { stream.end(); } + function toString(file) { + return file.contents.toString('utf8'); + } + function verify(transpileOptions, makeOptions, callback) { transpile(transpileOptions, function(error, output) { expect(error).to.be(null); @@ -82,10 +86,6 @@ describe('gulp-es6-module-transpiler', function() { }); } - function toString(file) { - return file.contents.toString('utf8'); - } - var inputs = load(inputDir); describe('options', function() { @@ -238,12 +238,12 @@ describe('gulp-es6-module-transpiler', function() { expect(error).to.be(null); expect(output.sourceMap).to.eql({ version: 3, - sources: [ 'default.js' ], + sources: ['default.js'], names: [], mappings: ';;IAAA,CAAC,CAAC,kBAAS,EAAE,CAAC,CAAC,CAAC' + ',CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC', file: 'default', - sourcesContent: [ inputs.default.contents.toString('utf8') ] + sourcesContent: [inputs.default.contents.toString('utf8')] }); done(); @@ -321,4 +321,4 @@ describe('gulp-es6-module-transpiler', function() { }); }); }); -}); +}); \ No newline at end of file From bed8e13be8fbb0fbb1cbefdcfc3c26a99b1c800d Mon Sep 17 00:00:00 2001 From: Denys Vitali Date: Sat, 12 Mar 2016 20:07:13 +0100 Subject: [PATCH 3/4] Added recast to package.json --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 32b795c..37947f7 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "es6-module-transpiler": "^0.10.0", "gulp-util": "^3.0.1", "through2": "^0.6.1", - "vinyl-sourcemaps-apply": "^0.1.1" + "vinyl-sourcemaps-apply": "^0.1.1", + "recast" "^0.11.3" }, "devDependencies": { "del": "^1.1.1", From 9282374bed4132dba82e3d9be8ea73a1f802b06b Mon Sep 17 00:00:00 2001 From: Denys Vitali Date: Sat, 12 Mar 2016 20:09:40 +0100 Subject: [PATCH 4/4] Fixed missing colon --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 37947f7..be1a8b4 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "gulp-util": "^3.0.1", "through2": "^0.6.1", "vinyl-sourcemaps-apply": "^0.1.1", - "recast" "^0.11.3" + "recast": "^0.11.3" }, "devDependencies": { "del": "^1.1.1",