Skip to content

Commit 83aed36

Browse files
committed
fix: 修复部分逻辑,升级依赖
1 parent 766d2b0 commit 83aed36

File tree

3 files changed

+1096
-756
lines changed

3 files changed

+1096
-756
lines changed

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
]
4747
},
4848
"devDependencies": {
49-
"@micro-app/cli": "^0.3.17",
50-
"@micro-app/plugin-deploy": "^0.0.7",
49+
"@micro-app/cli": "^0.4.0",
50+
"@micro-app/plugin-deploy": "^0.0.8",
5151
"@types/jest": "^24.9.1",
5252
"eslint-config-2o3t": "^2.0.1",
5353
"husky": "^3.1.0",
@@ -56,12 +56,12 @@
5656
"webpack-merge": "^4.2.2"
5757
},
5858
"dependencies": {
59-
"ajv": "^6.12.0",
60-
"ajv-keywords": "^3.4.1",
59+
"ajv": "^6.12.6",
60+
"ajv-keywords": "^3.5.2",
6161
"assert": "^2.0.0",
6262
"chalk": "^3.0.0",
6363
"cheerio": "^1.0.0-rc.3",
64-
"debug": "^4.1.1",
64+
"debug": "^4.3.1",
6565
"dedent": "^0.7.0",
6666
"execa": "^3.4.0",
6767
"fs-extra": "^8.1.0",
@@ -70,27 +70,27 @@
7070
"globby": "^10.0.2",
7171
"hash-sum": "^2.0.0",
7272
"import-fresh": "^3.2.1",
73-
"inquirer": "^7.1.0",
73+
"inquirer": "^7.3.3",
7474
"is-docker": "^2.0.0",
7575
"is-glob": "^4.0.1",
7676
"lodash": "^4.17.15",
7777
"lru-cache": "^5.1.1",
7878
"multimatch": "^4.0.0",
7979
"npm-package-arg": "^6.1.1",
8080
"npmlog": "^4.1.2",
81-
"open": "^7.0.3",
81+
"open": "^7.4.2",
8282
"ora": "^3.4.0",
83-
"parse-json": "^5.0.0",
83+
"parse-json": "^5.2.0",
8484
"semver": "^6.3.0",
85-
"semver-regex": "^3.1.1",
86-
"shelljs": "^0.8.3",
85+
"semver-regex": "^3.1.2",
86+
"shelljs": "^0.8.4",
8787
"signal-exit": "^3.0.3",
8888
"stream-to-string": "^1.2.0",
8989
"stringify-object": "^3.3.0",
9090
"try-require": "^1.2.1",
9191
"yaml": "^1.9.0",
9292
"yargs-parser": "^18.1.3",
93-
"yargs-unparser": "^1.5.0"
93+
"yargs-unparser": "^1.6.4"
9494
},
9595
"engines": {
9696
"node": ">=8"

src/logger/index.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,38 @@ class Logger {
139139
}
140140

141141
checkLevel(l) {
142-
return npmlog.levels[npmlog.level] > l;
142+
if (typeof l === 'string') {
143+
l = CUSTOM_LEVEL[l] && CUSTOM_LEVEL[l].level || 0;
144+
}
145+
return this.npmlog.levels[this.npmlog.level] > l;
143146
}
144147

145148
debug() {
149+
if (this.checkLevel('verbose')) return;
146150
return this.getMethod('verbose')(...arguments);
147151
}
148152
warn() {
153+
if (this.checkLevel('warn')) return;
149154
return this.getMethod('warn')(...arguments);
150155
}
151156
error() {
157+
if (this.checkLevel('error')) return;
152158
return this.getMethod('error')(...arguments);
153159
}
154160
info() {
161+
if (this.checkLevel('info')) return;
155162
return this.getMethod('info')(...arguments);
156163
}
157164
success() {
165+
if (this.checkLevel('success')) return;
158166
return this.getMethod('success')(...arguments);
159167
}
160168
json() {
161-
if (this.checkLevel(3500)) return;
169+
if (this.checkLevel('notice')) return;
162170
return this.getMethod('json')(...arguments);
163171
}
164-
logo() { // 不会禁用
172+
logo() { // 基本不会禁用, 10000
173+
if (this.checkLevel('noise')) return;
165174
return this.getMethod('logo')(...arguments);
166175
}
167176

@@ -255,9 +264,9 @@ class Logger {
255264
return this.aliasMap.get(type);
256265
}
257266

258-
newGroup(name, ...args) {
259-
const newLog = this.npmlog.newGroup(name, ...args);
260-
return factroy(newLog, { alias: this.aliasMap });
267+
newGroup() {
268+
// 弃用,兼容老版本
269+
return this;
261270
}
262271
}
263272

0 commit comments

Comments
 (0)