4.3 KiB
@backstage/config-loader
0.5.1
Patch Changes
062df71db: Bumpconfig-loadertoajv7, to enable v7 feature use elsewheree9aab60c7: Each piece of the configuration schema is now validated upfront, in order to produce more informative errors.
0.5.0
Minor Changes
ef7957be4: Removed support for the deprecated$dataplaceholder.ef7957be4: Enable further processing of configuration files included using the$includeplaceholder. Meaning that for example for example$envincludes will be processed as usual in included files.
Patch Changes
-
ef7957be4: Added support for environment variable substitutions in string configuration values using a${VAR}placeholder. All environment variables must be available, or the entire expression will be evaluated toundefined. To escape a substitution, use${...}, which will end up as${...}.For example:
app: baseUrl: https://${BASE_HOST}
0.4.1
Patch Changes
-
ad5c56fd9: Deprecate$dataand replace it with$includewhich allows for any type of json value to be read from external files. In addition,$includecan be used without a path, which causes the value at the root of the file to be loaded.Most usages of
$datacan be directly replaced with$include, except if the referenced value is not a string, in which case the value needs to be changed. For example:# app-config.yaml foo: $data: foo.yaml#myValue # replacing with $include will turn the value into a number $data: bar.yaml#myValue # replacing with $include is safe # foo.yaml myValue: 0xf00 # bar.yaml myValue: bar
0.4.0
Minor Changes
-
4e7091759: Fix typo of "visibility" in config schema referenceIf you have defined a config element named
visiblity, you will need to fix the spelling tovisibility. For more info, see https://backstage.io/docs/conf/defining#visibility.
Patch Changes
b4488ddb0: Added a type alias for PositionError = GeolocationPositionError
0.3.0
Minor Changes
-
1722cb53c: Added support for loading and validating configuration schemas, as well as declaring config visibility through schemas.The new
loadConfigSchemafunction exported by@backstage/config-loaderallows for the collection and merging of configuration schemas from all nearby dependencies of the project.A configuration schema is declared using the
https://backstage.io/schema/config-v1JSON Schema meta schema, which is based on draft07. The only difference to the draft07 schema is the customvisibilitykeyword, which is used to indicate whether the given config value should be visible in the frontend or not. The possible values arefrontend,backend, andsecret, wherebackendis the default. A visibility ofsecrethas the same scope at runtime, but it will be treated with more care in certain contexts, and defining bothfrontendandsecretfor the same value in two different schemas will result in an error during schema merging.Packages that wish to contribute configuration schema should declare it in a root
"configSchema"field inpackage.json. The field can either contain an inlined JSON schema, or a relative path to a schema file. Schema files can be in either.jsonor.d.tsformat.TypeScript configuration schema files should export a single
Configtype, for example:export interface Config { app: { /** * Frontend root URL * @visibility frontend */ baseUrl: string; }; }
0.2.0
Minor Changes
-
8c2b76e45: BREAKING CHANGEThe existing loading of additional config files like
app-config.development.yamlusing APP_ENV or NODE_ENV has been removed. Instead, the CLI and backend process now accept one or more--configflags to load config files.Without passing any flags,
app-config.yamland, if it exists,app-config.local.yamlwill be loaded. If passing any--config <path>flags, only those files will be loaded, NOT the defaultapp-config.yamlone.The old behaviour of for example
APP_ENV=developmentcan be replicated using the following flags:--config ../../app-config.yaml --config ../../app-config.development.yaml -
ce5512bc0: Added support for new shorthand when defining secrets, where$env: ENVcan be used instead of$secret: { env: ENV }etc.