From 1383f4c98cb16ed97f1e5064b30beb94b934dcdf Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Fri, 26 Jul 2024 10:04:55 +0200 Subject: [PATCH] Update .changeset/neat-bears-divide.md Signed-off-by: Patrik Oldsberg --- .changeset/neat-bears-divide.md | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/.changeset/neat-bears-divide.md b/.changeset/neat-bears-divide.md index b40db6c7bd..a94b17f74d 100644 --- a/.changeset/neat-bears-divide.md +++ b/.changeset/neat-bears-divide.md @@ -1,28 +1,5 @@ --- -'@backstage/config-loader': major +'@backstage/config-loader': patch --- -**BREAKING** The `env` property on the `ConfigSourcesDefaultOptions` interface allows for undefined members. - -This change makes `ConfigSourcesDefaultOptions.env` consistent with other parts of this package and the wider -`node` ecosystem. Specifically, with this update `ConfigSourcesDefaultOptions.env`'s types match: - -#### EnvConfigSource - -- [`EnvConfigSource.constructor`](https://github.com/backstage/backstage/blob/c780320418b7775f18fc0d2cc279ee7db9c7cb25/packages/config-loader/src/sources/EnvConfigSource.ts#L68) -- [`EnvConfigSourceOptions`](https://github.com/backstage/backstage/blob/c780320418b7775f18fc0d2cc279ee7db9c7cb25/packages/config-loader/src/sources/EnvConfigSource.ts#L31) -- [`readEnvConfig`](https://github.com/backstage/backstage/blob/c780320418b7775f18fc0d2cc279ee7db9c7cb25/packages/config-loader/src/sources/EnvConfigSource.ts#L114) - -#### NodeJS process.env - -- [`ProcessEnv`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/aa121ee3a7a3caa16433b66c1103df5904f612ea/types/node/v18/process.d.ts#L137) - which extends [`Dict`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/aa121ee3a7a3caa16433b66c1103df5904f612ea/types/node/v18/globals.d.ts#L333-L335) - -While this is a somewhat trivial change, it does loosen typings on a public interface, so by definition it's a breaking -change and a major version bump. - -You may meed to update your backstage instance if you have built an implementation of `ConfigSources` or any other -functionality that relies on `ConfigSourcesDefaultOptions`. This change means you'll have to update that code to account -for the possibility of `undefined` values inside `ConfigSourcesDefaultOptions.env`, although it is very likely already -accounted for as the typings for [`process.env`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/aa121ee3a7a3caa16433b66c1103df5904f612ea/types/node/v18/process.d.ts#L137) -already include the possibility of [`undefined`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/aa121ee3a7a3caa16433b66c1103df5904f612ea/types/node/v18/globals.d.ts#L333-L335). +The `env` option of `ConfigSources.default` now correctly allows undefined members.