Skip to content

Commit

Permalink
Merge pull request #45 from enb-make/issue-44
Browse files Browse the repository at this point in the history
Support ENB 1.x
  • Loading branch information
blond committed Oct 7, 2015
2 parents 9c99a54 + 8c9bfc7 commit 6fb2a1a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"node": ">= 0.8.0"
},
"peerDependencies": {
"enb": ">= 0.8.22"
"enb": ">= 0.15.0 <2.0.0"
},
"dependencies": {
"browserify": "11.1.0",
Expand All @@ -40,12 +40,12 @@
"chai": "3.2.0",
"chai-as-promised": "5.1.0",
"chai-string": "1.1.2",
"enb": ">= 0.8.22",
"enb": ">= 0.15.0 <2.0.0",
"istanbul": "0.3.20",
"jscs": "1.13.1",
"jshint": "2.8.0",
"mocha": "2.3.2",
"mock-enb": "0.2.0",
"mock-enb": "0.3.0",
"mock-fs": "3.2.0",
"rimraf": "2.4.3"
},
Expand Down
6 changes: 4 additions & 2 deletions techs/browser-js.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var vow = require('vow'),
vfs = require('enb/lib/fs/async-fs'),
enb = require('enb'),
vfs = enb.asyncFS || require('enb/lib/fs/async-fs'),
buildFlow = enb.buildFlow || require('enb/lib/build-flow'),
utils = require('enb-source-map/lib/utils'),
File = require('enb-source-map/lib/file'),
minify = require('uglify-js').minify;
Expand Down Expand Up @@ -58,7 +60,7 @@ var vow = require('vow'),
* });
* };
*/
module.exports = require('enb/lib/build-flow').create()
module.exports = buildFlow.create()
.name('browser-js')
.target('target', '?.browser.js')
.useFileList(['vanilla.js', 'js', 'browser.js'])
Expand Down
6 changes: 4 additions & 2 deletions techs/node-js.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var EOL = require('os').EOL,
vow = require('vow'),
vfs = require('enb/lib/fs/async-fs'),
enb = require('enb'),
vfs = enb.asyncFS || require('enb/lib/fs/async-fs'),
buildFlow = enb.buildFlow || require('enb/lib/build-flow'),
browserify = require('browserify'),
promisify = require('vow-node').promisify;

Expand Down Expand Up @@ -56,7 +58,7 @@ var EOL = require('os').EOL,
* });
* };
*/
module.exports = require('enb/lib/build-flow').create()
module.exports = buildFlow.create()
.name('node-js')
.target('target', '?.node.js')
.useFileList(['vanilla.js', 'node.js'])
Expand Down
3 changes: 2 additions & 1 deletion test/techs/browser-js.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var EOL = require('os').EOL,
mock = require('mock-fs'),
FileList = require('enb/lib/file-list'),
MockNode = require('mock-enb/lib/mock-node'),
loadDirSync = require('mock-enb/utils/dir-utils').loadDirSync,
browserJsTech = require('../../techs/browser-js');

describe('browser-js', function () {
Expand Down Expand Up @@ -135,7 +136,7 @@ function build(blocks, options, isNeedRequire) {
fileList = new FileList(),
testFunc;

fileList.loadFromDirSync('blocks');
fileList.addFiles(loadDirSync('blocks'));

bundle.provideTechData('?.files', fileList);

Expand Down
3 changes: 2 additions & 1 deletion test/techs/node-js.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var fs = require('fs'),
dropRequireCache = require('enb/lib/fs/drop-require-cache'),
MockNode = require('mock-enb/lib/mock-node'),
NodeJsTech = require('../../techs/node-js'),
loadDirSync = require('mock-enb/utils/dir-utils').loadDirSync,
rimraf = require('rimraf'),
EOL = require('os').EOL;

Expand Down Expand Up @@ -257,7 +258,7 @@ function build(scheme, options) {
var bundle = new MockNode('bundle'),
fileList = new FileList();

fileList.loadFromDirSync('blocks');
fileList.addFiles(loadDirSync('blocks'));

bundle.provideTechData('?.files', fileList);

Expand Down

0 comments on commit 6fb2a1a

Please sign in to comment.