Skip to content

Commit

Permalink
⬆️ bump all dependencies to the latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
ngryman committed Nov 3, 2019
1 parent 4b9deb5 commit dde78ec
Show file tree
Hide file tree
Showing 4 changed files with 2,859 additions and 2,789 deletions.
28 changes: 17 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,34 @@
"task",
"watchify"
],
"ava": {
"files": [
"test/*.js"
]
},
"eslintConfig": {
"extends": "ngryman"
},
"dependencies": {
"ansi-colors": "^1.0.1",
"browserify": "^15.1.0",
"ansi-colors": "^4.1.1",
"browserify": "^16.5.0",
"browserify-incremental": "^3.1.1",
"concat-stream": "^1.5.2",
"fancy-log": "^1.3.2",
"through2": "^2.0.1"
"concat-stream": "^2.0.0",
"fancy-log": "^1.3.3",
"through2": "^3.0.1"
},
"devDependencies": {
"ava": "^0.24.0",
"babel-preset-es2015": "^6.18.0",
"babelify": "^8.0.0",
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"ava": "^2.4.0",
"babelify": "^10.0.0",
"catch-stdout": "0.0.1",
"chokidar": "^2.0.0",
"chokidar": "^3.2.3",
"codecov.io": "^0.1.6",
"contributor-faces": "^1.0.0",
"eslint": "^4.9.0",
"eslint": "^6.6.0",
"eslint-config-ngryman": "^1.7.0",
"nyc": "^11.2.1",
"nyc": "^14.1.1",
"pre-commit": "^1.1.2",
"stream-assert": "^2.0.3",
"vinyl-fs": "^3.0.1"
Expand Down
9 changes: 6 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ Usually you use *watchify* to improve this, and only recompile files that have c
## Contributors

[//]: contributor-faces
<a href="https://github.com/ngryman"><img src="https://avatars.githubusercontent.com/u/892048?v=3" title="ngryman" width="80" height="80"></a>
<a href="https://github.com/DylanPiercey"><img src="https://avatars.githubusercontent.com/u/4985201?v=3" title="DylanPiercey" width="80" height="80"></a>
<a href="https://github.com/shannonmoeller"><img src="https://avatars.githubusercontent.com/u/155164?v=3" title="shannonmoeller" width="80" height="80"></a>
<a href="https://github.com/ngryman"><img src="https://avatars2.githubusercontent.com/u/892048?v=4" title="ngryman" width="80" height="80"></a>
<a href="https://github.com/apps/greenkeeper"><img src="https://avatars3.githubusercontent.com/in/505?v=4" title="greenkeeper[bot]" width="80" height="80"></a>
<a href="https://github.com/DylanPiercey"><img src="https://avatars2.githubusercontent.com/u/4985201?v=4" title="DylanPiercey" width="80" height="80"></a>
<a href="https://github.com/shannonmoeller"><img src="https://avatars3.githubusercontent.com/u/155164?v=4" title="shannonmoeller" width="80" height="80"></a>
<a href="https://github.com/fralonra"><img src="https://avatars2.githubusercontent.com/u/20400873?v=4" title="fralonra" width="80" height="80"></a>

[//]: contributor-faces

<sup>Generated with [contributors-faces](https://github.com/ngryman/contributor-faces).</sup>
Expand Down
187 changes: 112 additions & 75 deletions test/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,121 +9,152 @@ import chokidar from 'chokidar'
import fs from 'fs'

test.cb('bundle a file', t => {
vfs.src('test/fixtures/a+b.js')
vfs
.src('test/fixtures/a+b.js')
.pipe(bro())
.pipe(assert.length(1))
.pipe(assert.first(
d => t.deepEqual(
d.contents.toString().match(/exports = '[ab]'/g),
["exports = 'a'", "exports = 'b'"]
.pipe(
assert.first(d =>
t.deepEqual(d.contents.toString().match(/exports = '[ab]'/g), [
"exports = 'a'",
"exports = 'b'"
])
)
))
)
.pipe(assert.end(t.end))
})

test.cb('bundle a stream', t => {
vfs.src('test/fixtures/a+b.js')
vfs
.src('test/fixtures/a+b.js')
.pipe(bro())
.pipe(assert.length(1))
.pipe(assert.first(
d => t.deepEqual(
d.contents.toString().match(/exports = '[ab]'/g),
["exports = 'a'", "exports = 'b'"]
.pipe(
assert.first(d =>
t.deepEqual(d.contents.toString().match(/exports = '[ab]'/g), [
"exports = 'a'",
"exports = 'b'"
])
)
))
)
.pipe(assert.end(t.end))
})

test.cb('bundle multiple files separately', t => {
vfs.src(['test/fixtures/a+b.js', 'test/fixtures/a+c.js'])
vfs
.src(['test/fixtures/a+b.js', 'test/fixtures/a+c.js'])
.pipe(bro())
.pipe(assert.length(2))
.pipe(assert.first(
d => t.deepEqual(
d.contents.toString().match(/exports = '[ab]'/g),
["exports = 'a'", "exports = 'b'"]
.pipe(
assert.first(d =>
t.deepEqual(d.contents.toString().match(/exports = '[ab]'/g), [
"exports = 'a'",
"exports = 'b'"
])
)
))
.pipe(assert.second(
d => t.deepEqual(
d.contents.toString().match(/exports = '[ac]'/g),
["exports = 'a'", "exports = 'c'"]
)
.pipe(
assert.second(d =>
t.deepEqual(d.contents.toString().match(/exports = '[ac]'/g), [
"exports = 'a'",
"exports = 'c'"
])
)
))
)
.pipe(assert.end(t.end))
})

test.cb('bundle an empty file', t => {
vfs.src('test/fixtures/empty.js')
vfs
.src('test/fixtures/empty.js')
.pipe(bro())
.pipe(assert.length(1))
.pipe(assert.first(
d => t.true(d.contents.toString().length > 0 /* browserify runtime */)
))
.pipe(
assert.first(d =>
t.true(d.contents.toString().length > 0 /* browserify runtime */)
)
)
.pipe(assert.end(t.end))
})

test.cb('use incremental build', t => {
let times = []
vfs.src('test/fixtures/incremental.js')
vfs
.src('test/fixtures/incremental.js')
.pipe(bro())
.on('time', time => times.push(time))
.pipe(assert.end(() => {
vfs.src('test/fixtures/incremental.js')
.pipe(bro())
.on('time', time => times.push(time))
.pipe(assert.end(() => {
t.true(times[1] < times[0])
t.end()
}))
}))
.pipe(
assert.end(() => {
vfs
.src('test/fixtures/incremental.js')
.pipe(bro())
.on('time', time => times.push(time))
.pipe(
assert.end(() => {
t.true(times[1] < times[0])
t.end()
})
)
})
)
})

test.cb('accept browserify transforms', t => {
vfs.src('test/fixtures/es6.js')
.pipe(bro({
transform: babelify.configure({ presets: ['es2015'] })
}))
vfs
.src('test/fixtures/es6.js')
.pipe(
bro({
transform: babelify.configure({ presets: ['@babel/preset-env'] })
})
)
.pipe(assert.length(1))
.pipe(assert.first(
d => t.is(d.contents.toString().match(/_classCallCheck/).length, 1)
))
.pipe(
assert.first(d =>
t.is(d.contents.toString().match(/_classCallCheck/).length, 1)
)
)
.pipe(assert.end(t.end))
})

test.cb('log a syntax error', t => {
const restore = catchStdout()

vfs.src('test/fixtures/syntax_error.js')
.pipe(bro(() => {
vfs.src('test/fixtures/syntax_error.js').pipe(
bro(() => {
t.truthy(~restore().indexOf('SyntaxError'))
t.end()
}))
})
)
})

test.cb('emit a syntax error when asked to', t => {
vfs.src('test/fixtures/syntax_error.js')
vfs
.src('test/fixtures/syntax_error.js')
.pipe(bro({ error: 'emit' }))
.on('error', err => t.is(err.name, 'SyntaxError'))
.pipe(assert.end(t.end))
})

test.cb('call an error handler when provided', t => {
vfs.src('test/fixtures/syntax_error.js')
vfs
.src('test/fixtures/syntax_error.js')
.pipe(bro({ error: err => t.is(err.name, 'SyntaxError') }))
.pipe(assert.end(t.end))
})

test.cb('bundle a stream when deeply nested, #5', t => {
vfs.src('test/fixtures/modules/d/e/f.js')
vfs
.src('test/fixtures/modules/d/e/f.js')
.pipe(bro())
.pipe(assert.length(1))
.pipe(assert.first(
d => t.deepEqual(
d.contents.toString().match(/exports = '[ab]'/g),
["exports = 'a'", "exports = 'b'"]
.pipe(
assert.first(d =>
t.deepEqual(d.contents.toString().match(/exports = '[ab]'/g), [
"exports = 'a'",
"exports = 'b'"
])
)
))
)
.pipe(assert.end(t.end))
})

Expand All @@ -136,35 +167,41 @@ test.cb('gulp.watch detect changes in main entry, #4', t => {
chokidar.watch('test/fixtures/watch_entry.js').on('change', bundle)

function bundle() {
vfs.src('test/fixtures/watch_entry.js')
vfs
.src('test/fixtures/watch_entry.js')
.pipe(bro())
.pipe(assert.first(
d => {
.pipe(
assert.first(d => {
if (1 === calls) {
t.is(d.contents.toString().match(/alert\("yay"\)/).length, 1)
}
}
))
.pipe(assert.end(() => {
if (2 === ++calls) {
fs.unlinkSync('test/fixtures/watch_entry.js')
return t.end()
}

// mtime resolution can be 1-2sec depending on the os
setTimeout(() => {
fs.appendFileSync('test/fixtures/watch_entry.js', 'alert("yay")')
}, 100)
}))
})
)
.pipe(
assert.end(() => {
if (2 === ++calls) {
fs.unlinkSync('test/fixtures/watch_entry.js')
return t.end()
}

// mtime resolution can be 1-2sec depending on the os
setTimeout(() => {
fs.appendFileSync('test/fixtures/watch_entry.js', 'alert("yay")')
}, 100)
})
)
}
})

test.cb('accept an external option, #25', t => {
vfs.src('test/fixtures/external.js')
vfs
.src('test/fixtures/external.js')
.pipe(bro({ external: './modules/b' }))
.pipe(assert.length(1))
.pipe(assert.first(
d => t.is(d.contents.toString().match(/exports = '[ab]'/g).length, 1)
))
.pipe(
assert.first(d =>
t.is(d.contents.toString().match(/exports = '[ab]'/g).length, 1)
)
)
.pipe(assert.end(t.end))
})
Loading

0 comments on commit dde78ec

Please sign in to comment.