Files
flipper/desktop/pkg/schemas/plugin-package-v2.json
Anton Nikolaev d7cfcb5d8e Extend device plugin metadata to include supported devices
Summary: Plugin metadata format extended to include type of each plugin (client / device) and list of supported devices (android/ios/..., emulator/physical, etc). This will allow to detect plugins supported by device even if they are not installed and only available on Marketplace.

Reviewed By: mweststrate

Differential Revision: D26073531

fbshipit-source-id: e331f1be1af1046cd4220a286a1d52378c26cc53
2021-01-27 17:31:41 -08:00

90 lines
3.7 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"allOf": [
{"$ref": "https://schemastore.azurewebsites.net/schemas/json/package.json"}
],
"properties": {
"name": {
"description": "The name of the package. Must start with \"flipper-plugin-\" prefix.",
"type": "string",
"maxLength": 214,
"pattern": "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?flipper-plugin-[a-z0-9-._~]*$",
"errorMessage": "should start with \"flipper-plugin-\", e.g. \"flipper-plugin-example\""
},
"id": {
"type": "string",
"description": "Used as the plugin native identifier and must match the mobile plugin identifier. Also shown in the Flipper main sidebar if \"title\" property is omitted."
},
"flipperBundlerEntry": {
"type": "string",
"filePathExists": true,
"description": "Points to the source entry point which will be used for the plugin code bundling. \"flipper-pkg\" takes the path specified in this property as source, transpiles and bundles it, and saves the output to the path specified in property \"main\"."
},
"title": {
"type": "string",
"description": "Shown in the Flipper main sidebar as the human-readable name of the plugin. If omitted, \"id\" is used instead."
},
"icon": {
"type": "string",
"description": "Determines the plugin icon which is displayed in the main sidebar. The list of available icons is static for now and can be found in https://github.com/facebook/flipper/blob/master/desktop/static/icons.json."
},
"keywords": {
"description": "This helps people discover your package as it's listed in 'npm search'. To make the plugin discoverable in Flipper, the property must contain \"flipper-plugin\" keyword.",
"type": "array",
"items": {
"type": "string"
},
"contains": {
"type": "string",
"pattern": "flipper-plugin"
},
"errorMessage": "should contain keyword \"flipper-plugin\""
},
"pluginType": {
"description": "Type of the plugin - client or device. If omitted, \"client\" type is used by default.",
"type": "string",
"enum": ["client", "device"]
},
"supportedDevices": {
"description": "List of devices supported by the plugin. The list could contain multiple devices each defined as conjunction of several properties.",
"type": "array",
"items": {
"description": "Device definition. E.g. {\"os\": \"Android\", \"type\": \"physical\", \"archived\": false} means that plugin supports only Android physical unarchived devices.",
"type": "object",
"properties": {
"os": {
"description": "Device OS: iOS, Android or Metro. Lack of this property means that all OSes supported.",
"type": "string",
"enum": ["iOS", "Android", "Metro"]
},
"type": {
"description": "Device type: physical or emulator. Lack of this property means both physical and emulator devices supported.",
"type": "string",
"enum": ["physical", "emulator"]
},
"archived": {
"description": "Specifies support for archived devices. Lack of this property means that both live and archived devices supported. False means only live devices supported. True means only archived devices supported.",
"type": "boolean"
},
"specs": {
"description": "Additional specs required for plugin, e.g. \"KaiOS\" runtime.",
"type": "array",
"items": {
"type": "string",
"enum": ["KaiOS"]
}
}
}
}
}
},
"required": [
"name",
"version",
"id",
"main",
"flipperBundlerEntry",
"keywords"
]
}