@cenk1cenk2/oclif-common 3.9.2 → 3.9.4

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.
@@ -402,17 +402,19 @@ var ConfigService = class {
402
402
  this.oclif = oclif;
403
403
  this.command = command;
404
404
  if (ConfigService.instance) {
405
- Object.assign(ConfigService.instance, config);
405
+ if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
406
+ Object.assign(ConfigService.instance, config);
407
+ ConfigService.instance.recalculate();
408
+ }
406
409
  return ConfigService.instance;
407
- } else {
408
- ConfigService.instance = this;
409
410
  }
410
411
  this.root = this.oclif.root;
411
412
  this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
412
413
  this.logger = new Logger(this.constructor.name, { level: config.logLevel });
413
414
  this.parser = new ParserService();
414
- Object.assign(ConfigService.instance, config);
415
+ Object.assign(this, config);
415
416
  this.recalculate();
417
+ ConfigService.instance = this;
416
418
  this.logger.trace("Created a new instance.");
417
419
  }
418
420
  async read(path) {
@@ -398,17 +398,19 @@ var ConfigService = class {
398
398
  this.oclif = oclif;
399
399
  this.command = command;
400
400
  if (ConfigService.instance) {
401
- Object.assign(ConfigService.instance, config);
401
+ if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
402
+ Object.assign(ConfigService.instance, config);
403
+ ConfigService.instance.recalculate();
404
+ }
402
405
  return ConfigService.instance;
403
- } else {
404
- ConfigService.instance = this;
405
406
  }
406
407
  this.root = this.oclif.root;
407
408
  this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
408
409
  this.logger = new Logger(this.constructor.name, { level: config.logLevel });
409
410
  this.parser = new ParserService();
410
- Object.assign(ConfigService.instance, config);
411
+ Object.assign(this, config);
411
412
  this.recalculate();
413
+ ConfigService.instance = this;
412
414
  this.logger.trace("Created a new instance.");
413
415
  }
414
416
  async read(path) {
@@ -565,17 +565,19 @@ var ConfigService = class {
565
565
  this.oclif = oclif;
566
566
  this.command = command;
567
567
  if (ConfigService.instance) {
568
- Object.assign(ConfigService.instance, config);
568
+ if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
569
+ Object.assign(ConfigService.instance, config);
570
+ ConfigService.instance.recalculate();
571
+ }
569
572
  return ConfigService.instance;
570
- } else {
571
- ConfigService.instance = this;
572
573
  }
573
574
  this.root = this.oclif.root;
574
575
  this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
575
576
  this.logger = new Logger(this.constructor.name, { level: config.logLevel });
576
577
  this.parser = new ParserService();
577
- Object.assign(ConfigService.instance, config);
578
+ Object.assign(this, config);
578
579
  this.recalculate();
580
+ ConfigService.instance = this;
579
581
  this.logger.trace("Created a new instance.");
580
582
  }
581
583
  async read(path) {
package/dist/index.js CHANGED
@@ -461,17 +461,19 @@ var ConfigService = class {
461
461
  this.oclif = oclif;
462
462
  this.command = command;
463
463
  if (ConfigService.instance) {
464
- Object.assign(ConfigService.instance, config);
464
+ if (Object.entries(config).some(([key, value]) => value !== ConfigService.instance[key])) {
465
+ Object.assign(ConfigService.instance, config);
466
+ ConfigService.instance.recalculate();
467
+ }
465
468
  return ConfigService.instance;
466
- } else {
467
- ConfigService.instance = this;
468
469
  }
469
470
  this.root = this.oclif.root;
470
471
  this.defaults = (0, import_path2.join)(this.oclif.root, "config" /* CONFIG_SERVICE_DEFAULTS_DIR */);
471
472
  this.logger = new Logger(this.constructor.name, { level: config.logLevel });
472
473
  this.parser = new ParserService();
473
- Object.assign(ConfigService.instance, config);
474
+ Object.assign(this, config);
474
475
  this.recalculate();
476
+ ConfigService.instance = this;
475
477
  this.logger.trace("Created a new instance.");
476
478
  }
477
479
  async read(path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "3.9.2",
3
+ "version": "3.9.4",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "author": {
@@ -69,7 +69,7 @@
69
69
  "@oclif/core": "^1.20.4",
70
70
  "@types/fs-extra": "^9.0.13",
71
71
  "@types/through": "^0.0.30",
72
- "@types/update-notifier": "^6",
72
+ "@types/update-notifier": "^5",
73
73
  "class-transformer": "^0.5.1",
74
74
  "class-validator": "^0.13.2",
75
75
  "enquirer": "^2.3.6",