diff --git a/desktop/flipper-common/src/PluginDetails.tsx b/desktop/flipper-common/src/PluginDetails.tsx index cf344348a..458c9cdaa 100644 --- a/desktop/flipper-common/src/PluginDetails.tsx +++ b/desktop/flipper-common/src/PluginDetails.tsx @@ -37,7 +37,10 @@ export interface PluginDetails { overview?: boolean; setup?: boolean; }; - /** Provided by NPM. Allows developers to deprecated packages. Its value is the deprecation reason. */ + /** + * Provided by NPM. Allows developers to deprecated packages. Its value is the deprecation reason. + * Alternatively, might be a part of the plugin's package JSON. In this case, the plugin is excluded from bundling. + */ deprecated?: string; } diff --git a/desktop/pkg/schemas/plugin-package-v2.json b/desktop/pkg/schemas/plugin-package-v2.json index f8c89657d..7e168a115 100644 --- a/desktop/pkg/schemas/plugin-package-v2.json +++ b/desktop/pkg/schemas/plugin-package-v2.json @@ -113,6 +113,10 @@ "headless": { "type": "boolean", "description": "Specifies if plugin works in a headless mode. Default: false." + }, + "deprecated": { + "type": "string", + "description": "Mark plugin as deprecated and exclude it from the bundle. Optionally, provide a reason for deprecation. Set to '' to use the default deprecation reason." } }, "required": [ diff --git a/desktop/plugin-lib/src/getSourcePlugins.tsx b/desktop/plugin-lib/src/getSourcePlugins.tsx index 99104f2e1..4a370370c 100644 --- a/desktop/plugin-lib/src/getSourcePlugins.tsx +++ b/desktop/plugin-lib/src/getSourcePlugins.tsx @@ -77,7 +77,11 @@ async function entryPointForPluginFolder( } }), ) - .then((plugins) => plugins.filter(notNull)) + .then((plugins) => + plugins + .filter(notNull) + .filter(({deprecated}) => typeof deprecated !== 'string'), + ) .then((plugins) => plugins.reduce<{[key: string]: InstalledPluginDetails}>((acc, cv) => { acc[cv!.name] = cv!;