Summary: Implemented json schema for flipper plugin package.json and used it for validation in "flipper-pkg lint" command. Nice thing about json schema is that it not only allows to validate json, but also can be referenced using "$schema" property in json so IDEs like VSCode can find it and use for code completion, validation and to show properties documentation. I'm going to deploy the schema as a part of documentation website so it can be referenced as https://fbflipper.com/schemas/plugin-package/v2.json. Also the "$schema" field can be used instead of "specVersion" to determine the specification according to which the plugin is defined. E.g., if specification version 3 would be created, it will be described in schema https://fbflipper.com/schemas/plugin-package/v3.json, etc. Reviewed By: passy Differential Revision: D21228294 fbshipit-source-id: f21351e584ef936a7d6b314436448489691f83a6
31 lines
675 B
JSON
31 lines
675 B
JSON
{
|
|
"$schema": "https://fbflipper.com/schemas/plugin-package/v2.json",
|
|
"name": "flipper-plugin-sea-mammals",
|
|
"id": "sea-mammals",
|
|
"private": true,
|
|
"version": "2.0.0",
|
|
"main": "dist/bundle.js",
|
|
"flipperBundlerEntry": "src/index.tsx",
|
|
"license": "MIT",
|
|
"keywords": [
|
|
"flipper-plugin"
|
|
],
|
|
"icon": "apps",
|
|
"title": "Sea Mammals",
|
|
"category": "Example Plugin",
|
|
"bugs": {
|
|
"email": "realpassy@fb.com"
|
|
},
|
|
"scripts": {
|
|
"lint": "flipper-pkg lint",
|
|
"prepack": "flipper-pkg lint && flipper-pkg bundle"
|
|
},
|
|
"peerDependencies": {
|
|
"flipper": "0.39.0"
|
|
},
|
|
"devDependencies": {
|
|
"flipper": "0.39.0",
|
|
"flipper-pkg": "0.39.0"
|
|
}
|
|
}
|