Migrate catalog-react and app blueprints to configSchema
Move EntityCardBlueprint and EntityContentBlueprint to the new `configSchema` option using zod v3, and AppLanguageApi to zod v4. Fix config schema merge in `makeWithOverrides` when mixing `configSchema` and deprecated `config.schema` sources. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -18,14 +18,13 @@
|
||||
import { AppLanguageSelector } from '../../../../packages/core-app-api/src/apis/implementations/AppLanguageApi';
|
||||
import { appLanguageApiRef } from '@backstage/frontend-plugin-api';
|
||||
import { ApiBlueprint } from '@backstage/frontend-plugin-api';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const AppLanguageApi = ApiBlueprint.makeWithOverrides({
|
||||
name: 'app-language',
|
||||
config: {
|
||||
schema: {
|
||||
defaultLanguage: z => z.string().optional(),
|
||||
availableLanguages: z => z.array(z.string()).optional(),
|
||||
},
|
||||
configSchema: {
|
||||
defaultLanguage: z.string().optional(),
|
||||
availableLanguages: z.array(z.string()).optional(),
|
||||
},
|
||||
factory(originalFactory, { config }) {
|
||||
return originalFactory(defineParams =>
|
||||
|
||||
Reference in New Issue
Block a user