@backstage/config
Advanced tools
Comparing version 0.1.7 to 0.1.8
# @backstage/config | ||
## 0.1.8 | ||
### Patch Changes | ||
- 47113f1f1: Only warn once per key when trying to read visibility-filtered values | ||
## 0.1.7 | ||
@@ -4,0 +10,0 @@ |
@@ -49,2 +49,3 @@ 'use strict'; | ||
this.prefix = prefix; | ||
this.notifiedFilteredKeys = new Set(); | ||
} | ||
@@ -90,3 +91,4 @@ static fromConfigs(configs) { | ||
const fullKey = this.fullKey(key); | ||
if ((_b = this.filteredKeys) == null ? void 0 : _b.includes(fullKey)) { | ||
if (((_b = this.filteredKeys) == null ? void 0 : _b.includes(fullKey)) && !this.notifiedFilteredKeys.has(fullKey)) { | ||
this.notifiedFilteredKeys.add(fullKey); | ||
console.warn(`Failed to read configuration value at '${fullKey}' as it is not visible. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.`); | ||
@@ -144,3 +146,4 @@ } | ||
const fullKey = this.fullKey(key); | ||
if ((_a = this.filteredKeys) == null ? void 0 : _a.some((k) => k.startsWith(fullKey))) { | ||
if (((_a = this.filteredKeys) == null ? void 0 : _a.some((k) => k.startsWith(fullKey))) && !this.notifiedFilteredKeys.has(key)) { | ||
this.notifiedFilteredKeys.add(key); | ||
console.warn(`Failed to read configuration array at '${key}' as it does not have any visible elements. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.`); | ||
@@ -225,3 +228,4 @@ } | ||
const fullKey = this.fullKey(key); | ||
if ((_a = this.filteredKeys) == null ? void 0 : _a.includes(fullKey)) { | ||
if (((_a = this.filteredKeys) == null ? void 0 : _a.includes(fullKey)) && !this.notifiedFilteredKeys.has(fullKey)) { | ||
this.notifiedFilteredKeys.add(fullKey); | ||
console.warn(`Failed to read configuration value at '${fullKey}' as it is not visible. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.`); | ||
@@ -228,0 +232,0 @@ } |
@@ -55,2 +55,3 @@ declare type JsonPrimitive = number | string | boolean | null; | ||
private filteredKeys?; | ||
private notifiedFilteredKeys; | ||
static fromConfigs(configs: AppConfig[]): ConfigReader; | ||
@@ -57,0 +58,0 @@ constructor(data: JsonObject | undefined, context?: string, fallback?: ConfigReader | undefined, prefix?: string); |
@@ -40,2 +40,3 @@ import cloneDeep from 'lodash/cloneDeep'; | ||
this.prefix = prefix; | ||
this.notifiedFilteredKeys = new Set(); | ||
} | ||
@@ -81,3 +82,4 @@ static fromConfigs(configs) { | ||
const fullKey = this.fullKey(key); | ||
if ((_b = this.filteredKeys) == null ? void 0 : _b.includes(fullKey)) { | ||
if (((_b = this.filteredKeys) == null ? void 0 : _b.includes(fullKey)) && !this.notifiedFilteredKeys.has(fullKey)) { | ||
this.notifiedFilteredKeys.add(fullKey); | ||
console.warn(`Failed to read configuration value at '${fullKey}' as it is not visible. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.`); | ||
@@ -135,3 +137,4 @@ } | ||
const fullKey = this.fullKey(key); | ||
if ((_a = this.filteredKeys) == null ? void 0 : _a.some((k) => k.startsWith(fullKey))) { | ||
if (((_a = this.filteredKeys) == null ? void 0 : _a.some((k) => k.startsWith(fullKey))) && !this.notifiedFilteredKeys.has(key)) { | ||
this.notifiedFilteredKeys.add(key); | ||
console.warn(`Failed to read configuration array at '${key}' as it does not have any visible elements. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.`); | ||
@@ -216,3 +219,4 @@ } | ||
const fullKey = this.fullKey(key); | ||
if ((_a = this.filteredKeys) == null ? void 0 : _a.includes(fullKey)) { | ||
if (((_a = this.filteredKeys) == null ? void 0 : _a.includes(fullKey)) && !this.notifiedFilteredKeys.has(fullKey)) { | ||
this.notifiedFilteredKeys.add(fullKey); | ||
console.warn(`Failed to read configuration value at '${fullKey}' as it is not visible. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.`); | ||
@@ -219,0 +223,0 @@ } |
{ | ||
"name": "@backstage/config", | ||
"description": "Config API used by Backstage core, backend, and CLI", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"private": false, | ||
@@ -42,4 +42,4 @@ "publishConfig": { | ||
], | ||
"gitHead": "2f291dfd04f87a6ff4d6000204d0af7067bcda10", | ||
"gitHead": "e436edb5bface99d33b7a0e8dd863d8e204e81fc", | ||
"module": "dist/index.esm.js" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
69681
587