@backstage/config-loader
Advanced tools
Comparing version 0.0.0-nightly-20240414023511 to 0.0.0-nightly-20240415030456
# @backstage/config-loader | ||
## 0.0.0-nightly-20240414023511 | ||
## 0.0.0-nightly-20240415030456 | ||
### Minor Changes | ||
- 2ce31b3: The default environment variable substitution function will now trim whitespace characters from the substituted value. This alleviates bugs where whitespace characters are mistakenly included in environment variables. | ||
If you depend on the old behavior, you can override the default substitution function with your own, for example: | ||
```ts | ||
ConfigSources.default({ | ||
substitutionFunc: async name => process.env[name], | ||
}); | ||
``` | ||
- 99bab65: Support parameter substitution for environment variables | ||
@@ -8,0 +18,0 @@ |
@@ -834,3 +834,9 @@ 'use strict'; | ||
function createConfigTransformer(options) { | ||
const { substitutionFunc = async (name) => process.env[name], readFile } = options; | ||
const { | ||
substitutionFunc = async (name) => { | ||
var _a; | ||
return (_a = process.env[name]) == null ? void 0 : _a.trim(); | ||
}, | ||
readFile | ||
} = options; | ||
const substitutionTransform = createSubstitutionTransform(substitutionFunc); | ||
@@ -837,0 +843,0 @@ const transforms = [substitutionTransform]; |
@@ -329,2 +329,9 @@ import { JSONSchema7 } from 'json-schema'; | ||
remote?: Pick<RemoteConfigSourceOptions, 'reloadInterval'>; | ||
/** | ||
* A custom substitution function that overrides the default one. | ||
* | ||
* @remarks | ||
* The substitution function handles syntax like `${MY_ENV_VAR}` in configuration values. | ||
* The default substitution will read the value from the environment and trim whitespace. | ||
*/ | ||
substitutionFunc?: SubstitutionFunc; | ||
@@ -331,0 +338,0 @@ } |
{ | ||
"name": "@backstage/config-loader", | ||
"version": "0.0.0-nightly-20240414023511", | ||
"version": "0.0.0-nightly-20240415030456", | ||
"description": "Config loading functionality used by Backstage backend, and CLI", | ||
@@ -57,4 +57,4 @@ "backstage": { | ||
"devDependencies": { | ||
"@backstage/backend-test-utils": "^0.0.0-nightly-20240414023511", | ||
"@backstage/cli": "^0.0.0-nightly-20240414023511", | ||
"@backstage/backend-test-utils": "^0.0.0-nightly-20240415030456", | ||
"@backstage/cli": "^0.0.0-nightly-20240415030456", | ||
"@types/json-schema-merge-allof": "^0.6.0", | ||
@@ -61,0 +61,0 @@ "msw": "^1.0.0", |
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
263514
139545
2361
18
48
5
187