@cenk1cenk2/oclif-common 3.1.0-beta.8 → 3.1.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.
Files changed (2) hide show
  1. package/dist/index.js +6 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -677,11 +677,11 @@ var ConfigService = class {
677
677
  try {
678
678
  variable = await this.parser.parse(variable.parser, data);
679
679
  } catch (e) {
680
- this.logger.trace("Can not parse environment environment variable for config: %s -> %s with %s", variable.key.join("."), variable.env, variable.parser);
680
+ this.logger.trace("Can not parse environment environment variable for config: %s -> %s with %s", variable.key?.join("."), variable.env, variable.parser);
681
681
  throw e;
682
682
  }
683
683
  }
684
- this.logger.trace("Overwriting config with environment variable: %s -> %s", variable.key.join("."), variable.env);
684
+ this.logger.trace("Overwriting config with environment variable: %s -> %s", variable.key?.join("."), variable.env);
685
685
  return import_object_path_immutable.default.set(config2, variable.key, variable);
686
686
  }, "cb");
687
687
  await Promise.all(
@@ -691,7 +691,7 @@ var ConfigService = class {
691
691
  if (data) {
692
692
  config = await cb(config, variable, data);
693
693
  }
694
- if (variable.extensions) {
694
+ if (variable.extensions && variable.extensions.length > 0) {
695
695
  const timeout = 6e4;
696
696
  const startedAt = Date.now();
697
697
  for (let i = 0; i < Infinity; i++) {
@@ -702,12 +702,13 @@ var ConfigService = class {
702
702
  variable.extensions.map(async (extension) => {
703
703
  const clone = JSON.parse(JSON.stringify(extension));
704
704
  clone.env = clone.env.replace("${i}" /* ELEMENT_REPLACER */, i.toString());
705
+ clone.key[clone.key.findIndex((value) => value === "__element" /* ELEMENT */)] = i;
705
706
  data = process.env[clone.env];
707
+ this.logger.trace("Extension: %o -> %s", clone, data);
706
708
  if (!data) {
707
- this.logger.trace("No extension for environment variable: %s -> %d", clone.env, i);
709
+ this.logger.trace("No extension for environment variable: %s -> %s", clone.key.join("."), clone.env);
708
710
  return;
709
711
  }
710
- clone.key[clone.key.findIndex((value) => value === "__element" /* ELEMENT */)] = i;
711
712
  return cb({}, clone, data);
712
713
  })
713
714
  )).filter(Boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/oclif-common",
3
- "version": "3.1.0-beta.8",
3
+ "version": "3.1.0-beta.9",
4
4
  "description": "Oclif common package for oclif2 projects.",
5
5
  "repository": "https://gitlab.kilic.dev/libraries/oclif-tools",
6
6
  "author": {