Enrich plugin metadata on what apps they support and add unit tests

Summary:
- This Diff is part 1 of 2 of milestone 1 of my internship project flipper self sufficiency. The task can be found here - https://www.internalfb.com/tasks?q=958574791613645&t=91334896

- I have extended the plugin package meta data format to support a "supportedApps" field that consists of appID (facebook, instagram, messenger etc) along with OS and type that were previously defined in supportedDevices as well.

- The diff also adds unit tests for this new format to ensure addition of the supportedApps field does not break anything.

Reviewed By: nikoant

Differential Revision: D30133225

fbshipit-source-id: 6ef0d1cadd61c0d69640cf61793322acb4cd65f4
This commit is contained in:
Ananya Arun
2021-08-06 07:13:43 -07:00
committed by Facebook GitHub Bot
parent 1a7e3b9b00
commit 025ca05d62
4 changed files with 105 additions and 0 deletions

View File

@@ -126,6 +126,7 @@ function getPluginDetailsV1(packageJson: any): PluginDetails {
flipperSDKVersion: packageJson?.peerDependencies?.['flipper-plugin'],
pluginType: packageJson?.pluginType,
supportedDevices: packageJson?.supportedDevices,
supportedApps: packageJson?.supportedApps,
engines: packageJson.engines,
};
}
@@ -149,6 +150,7 @@ function getPluginDetailsV2(packageJson: any): PluginDetails {
flipperSDKVersion: packageJson?.peerDependencies?.['flipper-plugin'],
pluginType: packageJson?.pluginType,
supportedDevices: packageJson?.supportedDevices,
supportedApps: packageJson?.supportedApps,
engines: packageJson.engines,
publishedDocs: packageJson.publishedDocs,
};