@cenk1cenk2/oclif-common 5.0.0 → 5.0.1
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/dist/index.d.ts +3 -2
- package/dist/index.js +14 -13
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -69,7 +69,8 @@ type Winston = Logger$1 & Record<keyof typeof LogLevels, LeveledLogMethod>;
|
|
|
69
69
|
declare class Logger {
|
|
70
70
|
private context?;
|
|
71
71
|
private options?;
|
|
72
|
-
static instance
|
|
72
|
+
private static instance;
|
|
73
|
+
private static initiated;
|
|
73
74
|
private logger;
|
|
74
75
|
constructor(context?: string, options?: LoggerOptions);
|
|
75
76
|
log(level: LogLevels, data: string | Buffer, ...args: any): void;
|
|
@@ -360,7 +361,7 @@ declare class ConfigCommand<CommandChoices extends string = string, LockFile = a
|
|
|
360
361
|
run(): Promise<any>;
|
|
361
362
|
setup(): ConfigCommandSetup<CommandChoices, LockFile> | Promise<ConfigCommandSetup<CommandChoices, LockFile>>;
|
|
362
363
|
protected table(...options: Parameters<typeof ux.table>): void;
|
|
363
|
-
protected select(): Promise<
|
|
364
|
+
protected select(): Promise<CommandChoices>;
|
|
364
365
|
}
|
|
365
366
|
|
|
366
367
|
declare enum FileConstants {
|
package/dist/index.js
CHANGED
|
@@ -968,21 +968,20 @@ var _Logger = class {
|
|
|
968
968
|
__publicField(this, "logger");
|
|
969
969
|
this.context = context;
|
|
970
970
|
this.options = options;
|
|
971
|
-
if (_Logger.instance) {
|
|
971
|
+
if (_Logger.instance && _Logger.initiated === ConfigService.name) {
|
|
972
972
|
this.logger = _Logger.instance;
|
|
973
|
-
|
|
974
|
-
const level = Object.values(LogLevels).includes(_optionalChain([options, 'optionalAccess', _22 => _22.level])) ? options.level : LogLevels.INFO;
|
|
975
|
-
this.options = {
|
|
976
|
-
useIcons: true,
|
|
977
|
-
...options,
|
|
978
|
-
level
|
|
979
|
-
};
|
|
980
|
-
this.logger = this.initiateLogger();
|
|
981
|
-
this.trace("Logger singleton initiated from context: %s", context);
|
|
982
|
-
_Logger.instance = this.logger;
|
|
983
|
-
} else {
|
|
984
|
-
throw new Error("Logger can only be initiated inside the config service context!");
|
|
973
|
+
return this;
|
|
985
974
|
}
|
|
975
|
+
const level = Object.values(LogLevels).includes(_optionalChain([options, 'optionalAccess', _22 => _22.level])) ? options.level : LogLevels.INFO;
|
|
976
|
+
this.options = {
|
|
977
|
+
useIcons: true,
|
|
978
|
+
...options,
|
|
979
|
+
level
|
|
980
|
+
};
|
|
981
|
+
this.logger = this.initiateLogger();
|
|
982
|
+
this.trace("Logger singleton initiated from context: %s", context);
|
|
983
|
+
_Logger.initiated = context;
|
|
984
|
+
_Logger.instance = this.logger;
|
|
986
985
|
}
|
|
987
986
|
log(level, data, ...args) {
|
|
988
987
|
return this.parseMessage(level, data, args);
|
|
@@ -1144,6 +1143,7 @@ var _Logger = class {
|
|
|
1144
1143
|
var Logger = _Logger;
|
|
1145
1144
|
__name(Logger, "Logger");
|
|
1146
1145
|
__publicField(Logger, "instance");
|
|
1146
|
+
__publicField(Logger, "initiated");
|
|
1147
1147
|
|
|
1148
1148
|
// src/constants/global-flags.constants.ts
|
|
1149
1149
|
var CLI_FLAGS = {
|
|
@@ -1211,6 +1211,7 @@ var Command = class extends _core.Command {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1213
1213
|
async _run() {
|
|
1214
|
+
this.constructor.prototype.baseFlags = {};
|
|
1214
1215
|
let result;
|
|
1215
1216
|
try {
|
|
1216
1217
|
delete process.env[this.config.scopedEnvVarKey("REDIRECTED")];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cenk1cenk2/oclif-common",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Oclif common package for oclif2 projects.",
|
|
5
5
|
"repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
|
|
6
6
|
"author": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"object-path-immutable": "^4.1.2",
|
|
61
61
|
"reflect-metadata": "^0.1.13",
|
|
62
62
|
"through": "^2.3.8",
|
|
63
|
-
"update-notifier": "^
|
|
63
|
+
"update-notifier": "^6.0.2",
|
|
64
64
|
"winston": "^3.8.2",
|
|
65
65
|
"yaml": "^2.2.1"
|
|
66
66
|
},
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"enquirer": "^2.3.6",
|
|
75
75
|
"execa": "^5.1.1",
|
|
76
76
|
"fs-extra": "^11.1.1",
|
|
77
|
-
"listr2": "^6.0.
|
|
77
|
+
"listr2": "^6.0.3"
|
|
78
78
|
}
|
|
79
79
|
}
|