Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dependency on deprecated gulp-util #17

Merged
merged 1 commit into from
Jan 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/gulp-print.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@
"pretest": "coffee --bare --output ./lib --compile ./src/*.coffee"
},
"dependencies": {
"map-stream": "~0.0.6",
"gulp-util": "^3.0.6"
"ansi-colors": "^1.0.1",
"fancy-log": "^1.3.2",
"map-stream": "~0.0.6"
},
"devDependencies": {
"coffee-script": "~1.12.2",
"chai": "^4.1.2",
"coffee-errors": "~0.8.6",
"coffee-script": "~1.12.2",
"mocha": "^4.0.1",
"sinon": "^4.0.1",
"sinon-chai": "^2.8.0",
"mocha": "^4.0.1",
"chai": "^4.1.2"
"vinyl": "^2.1.0"
},
"engines": {
"node": ">=0.10.0",
Expand Down
3 changes: 2 additions & 1 deletion src/gulp-print.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
map = require 'map-stream'
path = require 'path'
{log, colors} = require 'gulp-util'
log = require 'fancy-log'
colors = require 'ansi-colors'

{green, magenta} = colors

Expand Down
11 changes: 6 additions & 5 deletions test/gulp-print.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ require 'coffee-errors'
path = require 'path'
chai = require 'chai'
sinon = require 'sinon'
gutil = require 'gulp-util'
Vinyl = require 'vinyl'
colors = require 'ansi-colors'
# using compiled JavaScript file here to be sure module works
print = require '../lib/gulp-print.js'

Expand All @@ -23,20 +24,20 @@ describe 'gulp-print', ->
filepath = path.join process.cwd(), 'foo/bar.js'

stream.on 'end', ->
expect(print.log).to.have.been.calledWith gutil.colors.magenta path.relative process.cwd(), filepath
expect(print.log).to.have.been.calledWith colors.magenta path.relative process.cwd(), filepath
done()

stream.write new gutil.File path: filepath
stream.write new Vinyl path: filepath
stream.end()

it 'logs file paths using custom formatter', (done) ->
stream = print (filepath) -> "Hello #{filepath}"
filepath = path.join process.cwd(), 'foo/bar.js'

stream.on 'end', ->
expect(print.log).to.have.been.calledWith "Hello #{gutil.colors.magenta path.relative process.cwd(), filepath}"
expect(print.log).to.have.been.calledWith "Hello #{colors.magenta path.relative process.cwd(), filepath}"
done()

stream.write new gutil.File path: filepath
stream.write new Vinyl path: filepath
stream.end()