Skip to content

Commit

Permalink
fix: 移除对gulp-utils的依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
TabSpace committed May 29, 2019
1 parent d95577c commit 0000dc5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
20 changes: 10 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const $fs = require('fs');
const $path = require('path');
const $gutil = require('gulp-util');
const $through = require('through2');
const $qcloudUpload = require('qcloud-cos-upload');

const $colors = $gutil.colors;
const $chalk = require('chalk');
const $log = require('fancy-log');
const $PluginError = require('plugin-error');

const PLUGIN_NAME = 'gulp-qcloud-cos-upload';

Expand Down Expand Up @@ -39,7 +39,7 @@ const upload = options => {
if (!conf[key]) {
this.emit(
'error',
new $gutil.PluginError(PLUGIN_NAME, `Need param: ${key}`)
new $PluginError(PLUGIN_NAME, `Need param: ${key}`)
);
}
return conf[key];
Expand All @@ -55,7 +55,7 @@ const upload = options => {
if (file.isStream()) {
this.emit(
'error',
new $gutil.PluginError(PLUGIN_NAME, 'Streaming not supported')
new $PluginError(PLUGIN_NAME, 'Streaming not supported')
);
callback();
}
Expand Down Expand Up @@ -98,11 +98,11 @@ const upload = options => {
callback();
}
}, callback => {
$gutil.log(
'Total:', $colors.green(nTotal),
'Skip:', $colors.gray(nSkip),
'Success:', $colors.green(nSuccess),
'Failed:', $colors.red(nFailed)
$log(
'Total:', $chalk.green(nTotal),
'Skip:', $chalk.gray(nSkip),
'Success:', $chalk.green(nSuccess),
'Failed:', $chalk.red(nFailed)
);
setTimeout(callback);
});
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
"semantic-release": "^15.13.3"
},
"dependencies": {
"gulp-util": "3.0.8",
"chalk": "^2.4.2",
"fancy-log": "^1.3.3",
"plugin-error": "^1.0.1",
"qcloud-cos-upload": "^1.2.8",
"through2": "2.0.3",
"url-join": "2.0.2"
Expand Down
25 changes: 21 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ ansi-align@^2.0.0:
dependencies:
string-width "^2.0.0"

ansi-colors@^1.0.1:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9"
integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==
dependencies:
ansi-wrap "^0.1.0"

ansi-escapes@^3.0.0, ansi-escapes@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
Expand Down Expand Up @@ -496,7 +503,7 @@ ansi-styles@^3.1.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1:
dependencies:
color-convert "^1.9.0"

[email protected]:
[email protected], ansi-wrap@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"
integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768=
Expand Down Expand Up @@ -1052,7 +1059,7 @@ chalk@^1.0.0, chalk@^1.1.3:
strip-ansi "^3.0.0"
supports-color "^2.0.0"

chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1:
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -2225,7 +2232,7 @@ extsprintf@^1.2.0:
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=

fancy-log@^1.1.0:
fancy-log@^1.1.0, fancy-log@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7"
integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==
Expand Down Expand Up @@ -2942,7 +2949,7 @@ [email protected]:
npm-run-path "^2.0.2"
through2 "^2.0.3"

gulp-util@3.0.8, gulp-util@^3.0.0, gulp-util@^3.0.8:
gulp-util@^3.0.0, gulp-util@^3.0.8:
version "3.0.8"
resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f"
integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08=
Expand Down Expand Up @@ -5647,6 +5654,16 @@ please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1:
dependencies:
semver-compare "^1.0.0"

plugin-error@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c"
integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==
dependencies:
ansi-colors "^1.0.1"
arr-diff "^4.0.0"
arr-union "^3.1.0"
extend-shallow "^3.0.2"

pluralize@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"
Expand Down

0 comments on commit 0000dc5

Please sign in to comment.