Update public docs to use Sandy

Summary: This updates the docs of Flipper to use Sandy, rather than `FlipperPlugin` class. Restructured the docs a bit as a result.

Reviewed By: passy

Differential Revision: D24991285

fbshipit-source-id: 66d5760c25cf9cf3983515433dfd64348d51db3d
This commit is contained in:
Michel Weststrate
2020-11-16 13:08:05 -08:00
committed by Facebook GitHub Bot
parent da6d6593a5
commit cc438e60ad
12 changed files with 418 additions and 592 deletions

View File

@@ -29,26 +29,14 @@ Your file will then look something like this:
}
```
## Installing flipper-pkg
`flipper-pkg` tool helps to define, validate and package Flipper desktop plugins. You can install it globally using:
```
yarn global add flipper-pkg
```
or
```
npm install flipper-pkg --global
```
## Creating the Plugin Package
With the loading part out of the way, we can create the new plugin. For that, first create a new folder inside the custom plugins directory. Then use `flpper-pkg init` to initialise a new Flipper desktop plugin package:
With the loading part out of the way, we can create the new plugin. For that, first create a new folder inside the custom plugins directory. Then use `flipper-pkg init` to initialise a new Flipper desktop plugin package.
`flipper-pkg` is a NPM module, so we can run it directly using `npx` if Node and NPM are installed.
```bash
$ cd ~/Flipper/custom-plugins/
$ mkdir sea-mammals
$ cd sea-mammals
$ flipper-pkg init
$ npx flipper-pkg init
```
The tool will ask you to provide "id" and "title" for your plugin. Use "sea-mammals" as "id" and "Sea Mammals" as "title". After that the tool will create two files in the directory: `package.json` and `src/index.tsx`.