From 80feff16150fd4def6181f4b8296a89d734421fd Mon Sep 17 00:00:00 2001 From: Arthur Lee Date: Wed, 2 Jun 2021 05:47:03 -0700 Subject: [PATCH] Fix search by passing query to search request (#2377) Summary: When publishing a new flipper plugin, I realized my plugin wasn't showing up in the Plugin Installer search. This was due to a bug where we are only grabbing 50 plugins from NPM and filtering through them locally, instead of passing the search term to the search query. There are 59 plugins that match the keyword filter on npm so 9 plugins never get surfaced. ## Changelog Fix missing plugins in plugin manager's NPM search Pull Request resolved: https://github.com/facebook/flipper/pull/2377 Test Plan: Test the search feature in Plugin Manager Search for the previously missing package: ![image](https://user-images.githubusercontent.com/1904616/119906244-b4daa580-bf02-11eb-8545-c8cf0663ae92.png) Previously working searches continue to work: ![image](https://user-images.githubusercontent.com/1904616/119906274-c02dd100-bf02-11eb-938a-d84b27c6bd81.png) Reviewed By: nikoant Differential Revision: D28831054 Pulled By: passy fbshipit-source-id: 84442459cd760c3f593b3df5bb3d89d51852e1c4 --- desktop/plugin-lib/src/getUpdatablePlugins.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugin-lib/src/getUpdatablePlugins.ts b/desktop/plugin-lib/src/getUpdatablePlugins.ts index c78539952..2e19fbbd1 100644 --- a/desktop/plugin-lib/src/getUpdatablePlugins.ts +++ b/desktop/plugin-lib/src/getUpdatablePlugins.ts @@ -35,7 +35,7 @@ export async function getUpdatablePlugins( ): Promise { const installedPlugins = await getInstalledPlugins(); const npmHostedPlugins = new Map( - (await getNpmHostedPlugins()).map((p) => [p.name, p]), + (await getNpmHostedPlugins({query})).map((p) => [p.name, p]), ); const annotatedInstalledPlugins = await pmap( installedPlugins,