Skip to content

Commit

Permalink
update dependencies, remove gulp-util, as #12
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Dec 30, 2017
1 parent 484d711 commit c2067a8
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: node_js
node_js:
- "0.10"
- "0.12"
- "4.2"
- "5"
- "4"
- "6"
- "8"
- "9"
sudo: false
cache:
directories:
- node_modules
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 teambition
Copyright (c) 2014-2018 teambition

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

var gulp = require('gulp')
var gulpSequence = require('./index')
var test = require('./test/index')
const gulp = require('gulp')
const gulpSequence = require('./index')
const test = require('./test/index')

test()

Expand Down
18 changes: 8 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,38 @@
* Licensed under the MIT license.
*/

var thunk = require('thunks')()
var gutil = require('gulp-util')
var packageName = require('./package.json').name
var slice = Array.prototype.slice
const thunk = require('thunks').thunk
const slice = Array.prototype.slice

module.exports = sequence()

function sequence (gulp) {
function gulpSequence () {
if (!gulp) gulp = require('gulp')

var BREAKER = {}
var args = slice.call(arguments)
const BREAKER = {}
const args = slice.call(arguments)
var done = args[args.length - 1]

if (typeof done === 'function') args.pop()
else done = null

if (!args.length) {
throw new gutil.PluginError(packageName, 'No tasks were provided to gulp-sequence!')
throw new Error('No tasks were provided to gulp-sequence!')

This comment has been minimized.

Copy link
@demurgos

demurgos Dec 30, 2017

It would have been better to replace it with plugin-error as indicated in gulp-util's README. Could you update it?

This comment has been minimized.

Copy link
@zensh

zensh Dec 30, 2017

Author Collaborator

Sorry. I think it is unnecessary.

This comment has been minimized.

Copy link
@demurgos

demurgos Dec 30, 2017

The main difference is that the error message is consistent with the other gulp errors (prefixed by the plugin name) but you are right that it's not a high priority.

Thank you for updating your plugin.

}

var runSequence = thunk.seq(args.filter(function (taskName) {
const runSequence = thunk.seq(args.filter(function (taskName) {
// filter falsely taskName
return taskName
}).map(function (task) {
return function (callback) {
if (!Array.isArray(task)) task = [task]

function successListener (e) {
var index = task.indexOf(e.task)
let index = task.indexOf(e.task)
if (index < 0) return
task[index] = BREAKER
for (var i = 0; i < task.length; i++) {
for (let i = 0; i < task.length; i++) {
if (task[i] !== BREAKER) return
}
removeListener()
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"authors": [
"Yan Qing <admin@zensh.com>"
],
"version": "0.4.6",
"version": "1.0.0",
"main": "index.js",
"repository": {
"type": "git",
Expand All @@ -20,12 +20,11 @@
"flow"
],
"dependencies": {
"gulp-util": ">=3.0.0",
"thunks": "^4.5.1"
"thunks": "^4.9.0"
},
"devDependencies": {
"gulp": "^3.9.1",
"standard": "^8.0.0"
"standard": "^10.0.3"
},
"scripts": {
"test": "gulp test"
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'
/* global */

var gulp = require('gulp')
var gulpSequence = require('../index')
const gulp = require('gulp')
const gulpSequence = require('../index')

module.exports = function () {
gulp.task('a', function (cb) {
Expand Down

0 comments on commit c2067a8

Please sign in to comment.