Moved the options of the config service out to the factory
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-app-api': patch
|
||||
---
|
||||
|
||||
Moved the options of the config service out to the factory itself, where it belongs
|
||||
@@ -53,7 +53,9 @@ export interface Backend {
|
||||
export const cacheFactory: () => ServiceFactory<PluginCacheManager>;
|
||||
|
||||
// @public (undocumented)
|
||||
export const configFactory: () => ServiceFactory<ConfigService>;
|
||||
export const configFactory: (
|
||||
options?: ConfigFactoryOptions | undefined,
|
||||
) => ServiceFactory<ConfigService>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ConfigFactoryOptions {
|
||||
|
||||
@@ -35,13 +35,14 @@ export interface ConfigFactoryOptions {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export const configFactory = createServiceFactory({
|
||||
service: coreServices.config,
|
||||
deps: {},
|
||||
async factory({}, options?: ConfigFactoryOptions) {
|
||||
const { argv = process.argv, remote } = options ?? {};
|
||||
|
||||
const { config } = await loadBackendConfig({ argv, remote });
|
||||
return config;
|
||||
},
|
||||
});
|
||||
export const configFactory = createServiceFactory(
|
||||
(options?: ConfigFactoryOptions) => ({
|
||||
service: coreServices.config,
|
||||
deps: {},
|
||||
async factory({}) {
|
||||
const { argv = process.argv, remote } = options ?? {};
|
||||
const { config } = await loadBackendConfig({ argv, remote });
|
||||
return config;
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user