From 55137371f358fc190670d5ef2c77963326cfe283 Mon Sep 17 00:00:00 2001 From: Kevin Strider Date: Fri, 20 May 2022 03:53:24 -0700 Subject: [PATCH] plugin-distribution (Creating Plugins - Plugin Distribution) Summary: Restyle of page, including changes to spelling, grammar, links, and structure (where relevant). * plugin-distribution * imports: desktop-plugin-releases Reviewed By: nikoant Differential Revision: D36514954 fbshipit-source-id: cf350d30c049bc7daeef1af3f988ce3b6a2fb502 --- docs/extending/plugin-distribution.mdx | 36 +++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/docs/extending/plugin-distribution.mdx b/docs/extending/plugin-distribution.mdx index a6eda7d96..d7bc28788 100644 --- a/docs/extending/plugin-distribution.mdx +++ b/docs/extending/plugin-distribution.mdx @@ -9,10 +9,13 @@ import FbPluginReleases from './fb/desktop-plugin-releases.mdx' ## Publishing to npm -Flipper plugins are essentially standard npm packages. So you can publish them by executing `yarn publish` or `npm publish` in the plugin directory. The only requirements are: +Flipper plugins are essentially standard npm packages, which means you can publish them by executing `yarn publish` or `npm publish` in the plugin directory. + +The only requirements are: + +1. `package.json` and code must follow the [Flipper plugin specification](desktop-plugin-structure.mdx#plugin-definition) +2. Code must be bundled using "flipper-pkg" before packing or publishing. This can be done by executing `flipper-pkg bundle` on `prepack` step: -1. `package.json` and code [must follow the Flipper plugin specification](desktop-plugin-structure.mdx#plugin-definition) -2. code must be bundled using "flipper-pkg" before packing or publishing. This can be done by executing `flipper-pkg bundle` on `prepack` step: ```json { ... @@ -39,24 +42,27 @@ Flipper plugins are essentially standard npm packages. So you can publish them b ## Packaging to File -To package plugin as a tarball, you can use the same command as for packaging any other npm package, e.g. `yarn pack` or `npm pack`. +To package a plugin as a tarball, you can use the same command as for packaging any other npm package (using `yarn pack` or `npm pack`). -"flipper-pkg" also provides a convenient command `pack` which: +`flipper-pkg` also provides a convenient command `pack` that does the following: -1. Installs the plugin dependencies -2. Bundles the plugin -3. Creates the tarball and saves it at the specified location +1. Installs the plugin dependencies. +2. Bundles the plugin. +3. Creates the tarball and saves it at the specified location. -E.g. to package plugin located at `~/flipper-plugins/my-plugin` to `~/Desktop`, execute the following command: -``` +Example + +To package a plugin located at `~/flipper-plugins/my-plugin` to `~/Desktop`, execute the following command: + +```sh flipper-pkg pack ~/flipper-plugins/my-plugin -o ~/Desktop ``` ## Installation from File -It is possible to install plugins into Flipper from tarballs. This is useful in cases when you need to try a plugin version which is not published to npm, or if you want to distribute plugin privately: +It's possible to install plugins into Flipper from tarballs. This is useful in cases when you need to try a plugin version that is not published to npm, or if you want to distribute plugin privately. Take the following steps: -1. Launch Flipper -2. Click the "Manage Plugins" button in the bottom-left corner -3. Select the "Install Plugins" tab in the opened sheet -4. Specify the path to the plugin package (or just drag and drop it) and click "Install" +1. Launch Flipper. +2. Click the 'Manage Plugins' button in the bottom-left corner. +3. Select the 'Install Plugins' tab in the opened sheet. +4. Specify the path to the plugin package (or just drag and drop it) and click 'Install'.