@cenk1cenk2/oclif-common 3.9.4 → 3.9.5
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/hooks/index.js +9 -8
- package/dist/hooks/not-found.hook.js +9 -8
- package/dist/hooks/store.hook.js +9 -8
- package/dist/index.d.ts +3 -8
- package/dist/index.js +9 -8
- package/package.json +1 -1
package/dist/hooks/index.js
CHANGED
|
@@ -403,8 +403,7 @@ var ConfigService = class {
|
|
|
403
403
|
this.command = command;
|
|
404
404
|
if (ConfigService.instance) {
|
|
405
405
|
if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
|
|
406
|
-
|
|
407
|
-
ConfigService.instance.recalculate();
|
|
406
|
+
ConfigService.instance.recalculate(config);
|
|
408
407
|
}
|
|
409
408
|
return ConfigService.instance;
|
|
410
409
|
}
|
|
@@ -412,8 +411,7 @@ var ConfigService = class {
|
|
|
412
411
|
this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
|
|
413
412
|
this.logger = new Logger(this.constructor.name, { level: config.logLevel });
|
|
414
413
|
this.parser = new ParserService();
|
|
415
|
-
|
|
416
|
-
this.recalculate();
|
|
414
|
+
this.recalculate(config);
|
|
417
415
|
ConfigService.instance = this;
|
|
418
416
|
this.logger.trace("Created a new instance.");
|
|
419
417
|
}
|
|
@@ -526,10 +524,13 @@ var ConfigService = class {
|
|
|
526
524
|
async write(path, data) {
|
|
527
525
|
return this.parser.write(path, data);
|
|
528
526
|
}
|
|
529
|
-
recalculate() {
|
|
530
|
-
this.
|
|
531
|
-
this.
|
|
532
|
-
this.
|
|
527
|
+
recalculate(config) {
|
|
528
|
+
this.ci = config.ci;
|
|
529
|
+
this.json = config.json;
|
|
530
|
+
this.logLevel = config.logLevel;
|
|
531
|
+
this.isVerbose = isVerbose(config.logLevel);
|
|
532
|
+
this.isDebug = isDebug(config.logLevel);
|
|
533
|
+
this.isSilent = isSilent(config.logLevel);
|
|
533
534
|
}
|
|
534
535
|
};
|
|
535
536
|
__name(ConfigService, "ConfigService");
|
|
@@ -399,8 +399,7 @@ var ConfigService = class {
|
|
|
399
399
|
this.command = command;
|
|
400
400
|
if (ConfigService.instance) {
|
|
401
401
|
if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
|
|
402
|
-
|
|
403
|
-
ConfigService.instance.recalculate();
|
|
402
|
+
ConfigService.instance.recalculate(config);
|
|
404
403
|
}
|
|
405
404
|
return ConfigService.instance;
|
|
406
405
|
}
|
|
@@ -408,8 +407,7 @@ var ConfigService = class {
|
|
|
408
407
|
this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
|
|
409
408
|
this.logger = new Logger(this.constructor.name, { level: config.logLevel });
|
|
410
409
|
this.parser = new ParserService();
|
|
411
|
-
|
|
412
|
-
this.recalculate();
|
|
410
|
+
this.recalculate(config);
|
|
413
411
|
ConfigService.instance = this;
|
|
414
412
|
this.logger.trace("Created a new instance.");
|
|
415
413
|
}
|
|
@@ -522,10 +520,13 @@ var ConfigService = class {
|
|
|
522
520
|
async write(path, data) {
|
|
523
521
|
return this.parser.write(path, data);
|
|
524
522
|
}
|
|
525
|
-
recalculate() {
|
|
526
|
-
this.
|
|
527
|
-
this.
|
|
528
|
-
this.
|
|
523
|
+
recalculate(config) {
|
|
524
|
+
this.ci = config.ci;
|
|
525
|
+
this.json = config.json;
|
|
526
|
+
this.logLevel = config.logLevel;
|
|
527
|
+
this.isVerbose = isVerbose(config.logLevel);
|
|
528
|
+
this.isDebug = isDebug(config.logLevel);
|
|
529
|
+
this.isSilent = isSilent(config.logLevel);
|
|
529
530
|
}
|
|
530
531
|
};
|
|
531
532
|
__name(ConfigService, "ConfigService");
|
package/dist/hooks/store.hook.js
CHANGED
|
@@ -566,8 +566,7 @@ var ConfigService = class {
|
|
|
566
566
|
this.command = command;
|
|
567
567
|
if (ConfigService.instance) {
|
|
568
568
|
if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
|
|
569
|
-
|
|
570
|
-
ConfigService.instance.recalculate();
|
|
569
|
+
ConfigService.instance.recalculate(config);
|
|
571
570
|
}
|
|
572
571
|
return ConfigService.instance;
|
|
573
572
|
}
|
|
@@ -575,8 +574,7 @@ var ConfigService = class {
|
|
|
575
574
|
this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
|
|
576
575
|
this.logger = new Logger(this.constructor.name, { level: config.logLevel });
|
|
577
576
|
this.parser = new ParserService();
|
|
578
|
-
|
|
579
|
-
this.recalculate();
|
|
577
|
+
this.recalculate(config);
|
|
580
578
|
ConfigService.instance = this;
|
|
581
579
|
this.logger.trace("Created a new instance.");
|
|
582
580
|
}
|
|
@@ -689,10 +687,13 @@ var ConfigService = class {
|
|
|
689
687
|
async write(path, data) {
|
|
690
688
|
return this.parser.write(path, data);
|
|
691
689
|
}
|
|
692
|
-
recalculate() {
|
|
693
|
-
this.
|
|
694
|
-
this.
|
|
695
|
-
this.
|
|
690
|
+
recalculate(config) {
|
|
691
|
+
this.ci = config.ci;
|
|
692
|
+
this.json = config.json;
|
|
693
|
+
this.logLevel = config.logLevel;
|
|
694
|
+
this.isVerbose = isVerbose(config.logLevel);
|
|
695
|
+
this.isDebug = isDebug(config.logLevel);
|
|
696
|
+
this.isSilent = isSilent(config.logLevel);
|
|
696
697
|
}
|
|
697
698
|
};
|
|
698
699
|
__name(ConfigService, "ConfigService");
|
package/dist/index.d.ts
CHANGED
|
@@ -114,16 +114,11 @@ interface PipeProcessToLoggerOptions {
|
|
|
114
114
|
*/
|
|
115
115
|
declare function pipeProcessToLogger(logger: Logger, instance: ExecaChildProcess, options?: PipeProcessToLoggerOptions): ExecaChildProcess;
|
|
116
116
|
|
|
117
|
-
interface
|
|
117
|
+
interface GlobalConfig {
|
|
118
118
|
logLevel: LogLevels;
|
|
119
119
|
ci: boolean;
|
|
120
120
|
json: boolean;
|
|
121
121
|
}
|
|
122
|
-
interface GlobalConfig extends GlobalConfigInit {
|
|
123
|
-
isVerbose: boolean;
|
|
124
|
-
isDebug: boolean;
|
|
125
|
-
isSilent: boolean;
|
|
126
|
-
}
|
|
127
122
|
interface ConfigIterator {
|
|
128
123
|
key: (string | number)[];
|
|
129
124
|
env: string;
|
|
@@ -229,7 +224,7 @@ declare class ConfigService implements GlobalConfig {
|
|
|
229
224
|
ci: boolean;
|
|
230
225
|
json: boolean;
|
|
231
226
|
private logger;
|
|
232
|
-
constructor(oclif: Command['config'], command: Command['ctor'], config:
|
|
227
|
+
constructor(oclif: Command['config'], command: Command['ctor'], config: GlobalConfig);
|
|
233
228
|
read<T extends LockableData = LockableData>(path: string): Promise<T>;
|
|
234
229
|
extend<T extends LockableData = LockableData>(paths: (string | Partial<T>)[], strategy?: MergeStrategy): Promise<T>;
|
|
235
230
|
merge<T extends LockableData = LockableData>(configs: Partial<T>[], strategy?: MergeStrategy): T;
|
|
@@ -409,4 +404,4 @@ declare enum HelpGroups {
|
|
|
409
404
|
CLI = "CLI"
|
|
410
405
|
}
|
|
411
406
|
|
|
412
|
-
export { CLI_FLAGS, ClassType, Command, CommonLockerData, ConfigCommand, ConfigCommandChoices, ConfigCommandSetup, ConfigIterator, ConfigService, DeepPartial, EnvironmentVariableParser, FileConstants, FileSystemService, GenericParser, GlobalConfig,
|
|
407
|
+
export { CLI_FLAGS, ClassType, Command, CommonLockerData, ConfigCommand, ConfigCommandChoices, ConfigCommandSetup, ConfigIterator, ConfigService, DeepPartial, EnvironmentVariableParser, FileConstants, FileSystemService, GenericParser, GlobalConfig, HelpGroups, InferArgs, InferFlags, JsonParser, ListrLogger, LockData, LockableData, LockerService, LogFieldStatus, LogLevels, Logger, LoggerFormat, LoggerOptions, MergeStrategy, ParserService, PipeProcessToLoggerOptions, SetCtxAssignOptions, SetCtxDefaultsOptions, UnlockData, ValidatorService, ValidatorServiceOptions, Winston, YamlParser, color, isDebug, isSilent, isVerbose, merge, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup, uniqueFilter };
|
package/dist/index.js
CHANGED
|
@@ -462,8 +462,7 @@ var ConfigService = class {
|
|
|
462
462
|
this.command = command;
|
|
463
463
|
if (ConfigService.instance) {
|
|
464
464
|
if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
|
|
465
|
-
|
|
466
|
-
ConfigService.instance.recalculate();
|
|
465
|
+
ConfigService.instance.recalculate(config);
|
|
467
466
|
}
|
|
468
467
|
return ConfigService.instance;
|
|
469
468
|
}
|
|
@@ -471,8 +470,7 @@ var ConfigService = class {
|
|
|
471
470
|
this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
|
|
472
471
|
this.logger = new Logger(this.constructor.name, { level: config.logLevel });
|
|
473
472
|
this.parser = new ParserService();
|
|
474
|
-
|
|
475
|
-
this.recalculate();
|
|
473
|
+
this.recalculate(config);
|
|
476
474
|
ConfigService.instance = this;
|
|
477
475
|
this.logger.trace("Created a new instance.");
|
|
478
476
|
}
|
|
@@ -585,10 +583,13 @@ var ConfigService = class {
|
|
|
585
583
|
async write(path, data) {
|
|
586
584
|
return this.parser.write(path, data);
|
|
587
585
|
}
|
|
588
|
-
recalculate() {
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
591
|
-
this.
|
|
586
|
+
recalculate(config) {
|
|
587
|
+
this.ci = config.ci;
|
|
588
|
+
this.json = config.json;
|
|
589
|
+
this.logLevel = config.logLevel;
|
|
590
|
+
this.isVerbose = isVerbose(config.logLevel);
|
|
591
|
+
this.isDebug = isDebug(config.logLevel);
|
|
592
|
+
this.isSilent = isSilent(config.logLevel);
|
|
592
593
|
}
|
|
593
594
|
};
|
|
594
595
|
__name(ConfigService, "ConfigService");
|