Fix review comment: don't use ConfigSchemaPackageEntry nor make it public.

Signed-off-by: David Festal <dfestal@redhat.com>
This commit is contained in:
David Festal
2024-02-06 16:43:27 +01:00
parent 54ad8e1553
commit 84fcbc49d6
18 changed files with 76 additions and 83 deletions
+4 -2
View File
@@ -4,8 +4,8 @@
```ts
import { Config } from '@backstage/config';
import { ConfigSchemaPackageEntry } from '@backstage/config-loader';
import express from 'express';
import { JsonObject } from '@backstage/types';
import { Logger } from 'winston';
import { PluginDatabaseManager } from '@backstage/backend-common';
@@ -14,7 +14,9 @@ export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public (undocumented)
export interface RouterOptions {
additionalSchemas?: ConfigSchemaPackageEntry[];
additionalSchemas?: {
[context: string]: JsonObject;
};
appPackageName: string;
// (undocumented)
config: Config;
+1 -2
View File
@@ -20,7 +20,6 @@ import { Logger } from 'winston';
import { AppConfig, Config } from '@backstage/config';
import { JsonObject } from '@backstage/types';
import { loadConfigSchema, readEnvConfig } from '@backstage/config-loader';
import { ConfigSchemaPackageEntry } from '@backstage/config-loader';
type InjectOptions = {
appConfigs: AppConfig[];
@@ -75,7 +74,7 @@ type ReadOptions = {
env: { [name: string]: string | undefined };
appDistDir: string;
config: Config;
additionalSchemas?: ConfigSchemaPackageEntry[];
additionalSchemas?: { [context: string]: JsonObject };
};
/**
+3 -3
View File
@@ -37,7 +37,7 @@ import {
CACHE_CONTROL_NO_CACHE,
CACHE_CONTROL_REVALIDATE_CACHE,
} from '../lib/headers';
import { ConfigSchemaPackageEntry } from '@backstage/config-loader';
import { JsonObject } from '@backstage/types';
// express uses mime v1 while we only have types for mime v2
type Mime = { lookup(arg0: string): string };
@@ -89,14 +89,14 @@ export interface RouterOptions {
/**
*
* Provides a list of additional config schemas, in addition to the serialized schemas
* Provides a map of additional config schemas, in addition to the serialized schemas
* generated during the application build.
* This is useful when additional plugins are dynamically loaded in the application at start,
* which were not part of the application build. This option allows feeding the corresponding
* JSON schemas.
*
*/
additionalSchemas?: ConfigSchemaPackageEntry[];
additionalSchemas?: { [context: string]: JsonObject };
}
/** @public */