@oclif/core 3.0.0-beta.8 → 3.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ux/index.d.ts +0 -6
- package/lib/ux/index.js +4 -13
- package/package.json +1 -1
package/lib/ux/index.d.ts
CHANGED
|
@@ -32,12 +32,6 @@ export default class ux {
|
|
|
32
32
|
static url(text: string, uri: string, params?: {}): void;
|
|
33
33
|
static annotation(text: string, annotation: string): void;
|
|
34
34
|
static flush(ms?: number): Promise<void>;
|
|
35
|
-
static error(err: Error | string, options?: {
|
|
36
|
-
code?: string;
|
|
37
|
-
exit?: number;
|
|
38
|
-
}): never;
|
|
39
|
-
static exit(code?: number): never;
|
|
40
|
-
static warn(err: Error | string): void;
|
|
41
35
|
}
|
|
42
36
|
declare const action: ActionBase;
|
|
43
37
|
declare const annotation: typeof ux.annotation;
|
package/lib/ux/index.js
CHANGED
|
@@ -39,10 +39,10 @@ class ux {
|
|
|
39
39
|
}
|
|
40
40
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
41
41
|
static styledObject(obj, keys) {
|
|
42
|
-
this.
|
|
42
|
+
this.info(styled.styledObject(obj, keys));
|
|
43
43
|
}
|
|
44
44
|
static styledHeader(header) {
|
|
45
|
-
this.
|
|
45
|
+
this.info(chalk.dim('=== ') + chalk.bold(header) + '\n');
|
|
46
46
|
}
|
|
47
47
|
static get styledJSON() {
|
|
48
48
|
return styled.styledJSON;
|
|
@@ -63,12 +63,12 @@ class ux {
|
|
|
63
63
|
config_1.config.action.stop();
|
|
64
64
|
}
|
|
65
65
|
static trace(format, ...args) {
|
|
66
|
-
if (
|
|
66
|
+
if (this.config.outputLevel === 'trace') {
|
|
67
67
|
stream_1.stdout.write(util.format(format, ...args) + '\n');
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
static debug(format, ...args) {
|
|
71
|
-
if (['trace', 'debug'].includes(
|
|
71
|
+
if (['trace', 'debug'].includes(this.config.outputLevel)) {
|
|
72
72
|
stream_1.stdout.write(util.format(format, ...args) + '\n');
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -100,15 +100,6 @@ class ux {
|
|
|
100
100
|
static async flush(ms = 10000) {
|
|
101
101
|
await _flush.default(ms);
|
|
102
102
|
}
|
|
103
|
-
static error(err, options = {}) {
|
|
104
|
-
throw Errors.error(err, options);
|
|
105
|
-
}
|
|
106
|
-
static exit(code = 0) {
|
|
107
|
-
throw Errors.exit(code);
|
|
108
|
-
}
|
|
109
|
-
static warn(err) {
|
|
110
|
-
Errors.warn(err);
|
|
111
|
-
}
|
|
112
103
|
}
|
|
113
104
|
exports.default = ux;
|
|
114
105
|
ux.config = config_1.config;
|