Skip to content

Commit

Permalink
Merge pull request #57 from 0xCCY/main
Browse files Browse the repository at this point in the history
feat(testing): update instructions for testing
  • Loading branch information
jjw24 authored Nov 4, 2022
2 parents 356e363 + bd2d2ac commit 8e4c02c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
6 changes: 5 additions & 1 deletion _sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- [**Usage Tips**](/usage-tips.md)
- [**Plugin Directory**](/plugins.md)
- Plugin Development
- [**Get Started**](/plugin-dev.md)
- [**plugin.json**](/plugin.json.md)
- Dotnet Plugins
- [**Development Guide**](/develop-dotnet-plugins.md)
Expand All @@ -17,7 +18,10 @@
- [**Set up your project**](/nodejs-setup-project.md)
- [**Write the code**](/nodejs-write-code.md)
- [**Add your plugin to Flow**](/nodejs-release-project.md)
- Testing Plugins
- [**Testing Guide**](/testing.md)
- JSONRPC
- [**JSON RPC Introduction**](/json-rpc.md)
- [**Porting Plugins**](/port-plugins.md)
- Porting Plugins
- [**Porting Plugins Guide**](/port-plugins.md)
- [**How To Create a Theme**](/how-to-create-a-theme.md)
8 changes: 4 additions & 4 deletions json-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> [JSON-RPC](https://en.wikipedia.org/wiki/JSON-RPC) is a remote procedure call protocol encoded in JSON.
In Flow Launcher, we use JSON-RPC as a **local** procedure call protocol to bind Flow and other program languages.
In Flow Launcher, we use JSON-RPC as a **local** procedure call protocol to bind Flow and other program languages ([**Python plugin**](/py-develop-plugins.md) and [**JavaScript/TypeScript plugin**](/nodejs-develop-plugins.md)).

So we need to build a **common API** between Flow and Plugin.

Expand Down Expand Up @@ -33,7 +33,7 @@ API is located [here](https://github.com/Flow-Launcher/Flow.Launcher/blob/master
- `Flow.Launcher.HideApp`: hide flow launcher
- `Flow.Launcher.ShowApp`: show flow launcher
- `Flow.Launcher.ShowMsg`: show messagebox
- `Flow.Launcher.GetTranslation`: get translation of current language
- `Flow.Launcher.GetTranslation`: get translation of current language
- `Flow.Launcher.OpenSettingDialog`: open setting dialog
- `Flow.Launcher.GetAllPlugins`: get all loaded plugins
- `Flow.Launcher.StartLoadingBar`: start loading animation in flow launcher
Expand All @@ -44,8 +44,8 @@ API is located [here](https://github.com/Flow-Launcher/Flow.Launcher/blob/master

```json
{
"method": "Flow Launcher API Name",
"parameters": []
"method": "Flow Launcher API Name",
"parameters": []
}
```

Expand Down
20 changes: 20 additions & 0 deletions plugin-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Get Started

Welcome to the comprehensive guide to plugin development in Flow Launcher.

## Types of plugin implementation

While Flow Launcher is written in C#, plugins can be written natively or in other languages.

### Natively (no intergration needed)

- [**C# (.NET framework)**](/develop-dotnet-plugins.md)

### Using JSON-RPC

For other languages, Flow launcher communicates with the plugin via [JSON-RPC](/json-rpc.md).

Currently supported languages are:

- [**Python**](/py-develop-plugins.md)
- [**JavaScript / TypeScript (NodeJS)**](/nodejs-develop-plugins.md)
14 changes: 14 additions & 0 deletions testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Testing your plugin

After successfully building a plugin, it can be tested locally by moving the output files into Flow Launcher's `FlowLauncher\Plugins` directory accessible via the `userdata` command in Flow Launcher. Alternatively, if you are building .Net (C# or F#) plugins you can have your IDE build the artefact directly to that location (remember not to check this build output path into Git though).


### Detail Steps

1. Execute `userdata` in Flow Launcher.
2. Navigate into the `Plugins` folder.
3. Move exisiting plugin with the same `Plugin ID` as specify in `plugin.json` away from the folder (_**if more than one plugin have the same `Plugin ID`, none of them will be loaded**_).
4. Copy and paste the newly built plugin folder into this folder.
5. Execute `Restart Flow Launcher` to reload the new plugin.

Tip: .Net plugins (e.g. C# and F#) will require you to restart flow every time you make a change and build a new artefact to reload the plugin, but Python and JS/TS plugins you can edit the plugin directly.

0 comments on commit 8e4c02c

Please sign in to comment.