Fix plugin meta data

Summary:
See previous diff, if the plugin `id` on the class definition mismatches with the `package.json`, the navigation in Sandy will use the wrong id (from the meta data) causing the plugin not to open.

Since the `id` exposed on the class is the one that is used to setup the connect on the client, updated the ids in the `package.json` which have afaik no further meaning.

Pinging nikoant to verify that assumption. I can imagine this might impact historical data / plugin distribution?

Reviewed By: passy, nikoant

Differential Revision: D25302542

fbshipit-source-id: 43fe1667604eb7a28f6f9b7d260bc2a1e6e82dd3
This commit is contained in:
Michel Weststrate
2020-12-03 07:19:02 -08:00
committed by Facebook GitHub Bot
parent d8832aa78e
commit dd7c2ab96d

View File

@@ -233,6 +233,11 @@ const requirePluginInternal = (
throw new Error(`Plugin ${plugin.name} is not a FlipperBasePlugin`);
}
if (plugin.id && pluginDetails.id !== plugin.id) {
console.error(
`Plugin name mismatch: Package '${pluginDetails.id}' exposed a plugin with id '${plugin.id}'. Please update the 'package.json' to match the exposed plugin id`,
);
}
plugin.id = plugin.id || pluginDetails.id;
plugin.packageName = pluginDetails.name;
plugin.details = pluginDetails;