Skip to content

Commit 0000dc5

Browse files
committed
fix: 移除对gulp-utils的依赖
1 parent d95577c commit 0000dc5

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const $fs = require('fs');
22
const $path = require('path');
3-
const $gutil = require('gulp-util');
43
const $through = require('through2');
54
const $qcloudUpload = require('qcloud-cos-upload');
6-
7-
const $colors = $gutil.colors;
5+
const $chalk = require('chalk');
6+
const $log = require('fancy-log');
7+
const $PluginError = require('plugin-error');
88

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

@@ -39,7 +39,7 @@ const upload = options => {
3939
if (!conf[key]) {
4040
this.emit(
4141
'error',
42-
new $gutil.PluginError(PLUGIN_NAME, `Need param: ${key}`)
42+
new $PluginError(PLUGIN_NAME, `Need param: ${key}`)
4343
);
4444
}
4545
return conf[key];
@@ -55,7 +55,7 @@ const upload = options => {
5555
if (file.isStream()) {
5656
this.emit(
5757
'error',
58-
new $gutil.PluginError(PLUGIN_NAME, 'Streaming not supported')
58+
new $PluginError(PLUGIN_NAME, 'Streaming not supported')
5959
);
6060
callback();
6161
}
@@ -98,11 +98,11 @@ const upload = options => {
9898
callback();
9999
}
100100
}, callback => {
101-
$gutil.log(
102-
'Total:', $colors.green(nTotal),
103-
'Skip:', $colors.gray(nSkip),
104-
'Success:', $colors.green(nSuccess),
105-
'Failed:', $colors.red(nFailed)
101+
$log(
102+
'Total:', $chalk.green(nTotal),
103+
'Skip:', $chalk.gray(nSkip),
104+
'Success:', $chalk.green(nSuccess),
105+
'Failed:', $chalk.red(nFailed)
106106
);
107107
setTimeout(callback);
108108
});

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
"semantic-release": "^15.13.3"
5555
},
5656
"dependencies": {
57-
"gulp-util": "3.0.8",
57+
"chalk": "^2.4.2",
58+
"fancy-log": "^1.3.3",
59+
"plugin-error": "^1.0.1",
5860
"qcloud-cos-upload": "^1.2.8",
5961
"through2": "2.0.3",
6062
"url-join": "2.0.2"

yarn.lock

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,13 @@ ansi-align@^2.0.0:
462462
dependencies:
463463
string-width "^2.0.0"
464464

465+
ansi-colors@^1.0.1:
466+
version "1.1.0"
467+
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9"
468+
integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==
469+
dependencies:
470+
ansi-wrap "^0.1.0"
471+
465472
ansi-escapes@^3.0.0, ansi-escapes@^3.1.0:
466473
version "3.2.0"
467474
resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b"
@@ -496,7 +503,7 @@ ansi-styles@^3.1.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1:
496503
dependencies:
497504
color-convert "^1.9.0"
498505

499-
506+
[email protected], ansi-wrap@^0.1.0:
500507
version "0.1.0"
501508
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"
502509
integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768=
@@ -1052,7 +1059,7 @@ chalk@^1.0.0, chalk@^1.1.3:
10521059
strip-ansi "^3.0.0"
10531060
supports-color "^2.0.0"
10541061

1055-
chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1:
1062+
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:
10561063
version "2.4.2"
10571064
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
10581065
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -2225,7 +2232,7 @@ extsprintf@^1.2.0:
22252232
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
22262233
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=
22272234

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

2945-
gulp-util@3.0.8, gulp-util@^3.0.0, gulp-util@^3.0.8:
2952+
gulp-util@^3.0.0, gulp-util@^3.0.8:
29462953
version "3.0.8"
29472954
resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f"
29482955
integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08=
@@ -5647,6 +5654,16 @@ please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1:
56475654
dependencies:
56485655
semver-compare "^1.0.0"
56495656

5657+
plugin-error@^1.0.1:
5658+
version "1.0.1"
5659+
resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c"
5660+
integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==
5661+
dependencies:
5662+
ansi-colors "^1.0.1"
5663+
arr-diff "^4.0.0"
5664+
arr-union "^3.1.0"
5665+
extend-shallow "^3.0.2"
5666+
56505667
pluralize@^7.0.0:
56515668
version "7.0.0"
56525669
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777"

0 commit comments

Comments
 (0)