Flipper: Support flipper plugins that contain a scope in their name

Created on 29 Jul 2020  路  8Comments  路  Source: facebook/flipper

馃悰 Bug Report

My team has been experimenting with publishing our custom desktop plugins to Github packages (developers then install them by downloading a tarball and using the "install from file" flow within the Flipper desktop app).

Github packages requires packages to have a scope in their name. When installing a plugin named @tinyspeck/flipper-plugin-$pluginName, I don't see the plugin visible in Flipper's sidebar or the "manage plugins" page, and I see this error logged in the developer tools window:

Uncaught (in promise) Error: ENOENT: no such file or directory, open '/Users/jschear/.flipper/thirdparty/@tinyspeck/package.json'

This may be more of a feature request (flipper-pkg lint complains about the name not starting with flipper-plugin-, after all) -- is this something Flipper could support?

To Reproduce

  1. Create a new flipper plugin with flipper-pkg init
  2. Modify the name by adding a scope: @scope/flipper-plugin-$pluginName
  3. Run yarn pack (you'll need to modify the package.json to ignore the output of flipper-pkg lint in the prepack script).
  4. Within the Flipper desktop app, install the plugin from file.

Environment

Flipper 0.51.0, macos 10.15.4

Most helpful comment

"live-plugin-manager" is not used for plugin format v2, we'll remove this dependency soon. So it seems like this limitation is just a side effect of having a slash character.

All 8 comments

Thanks for the detailed report!

For sure 馃槃 I poked around in the source a bit (though I'm admittedly a bit out of my element); I can't tell if this is a limitation in live-plugin-manager or just a side effect of having a slash character in the plugin name.

@nikoant Will probably know where that limitation comes from. :)

"live-plugin-manager" is not used for plugin format v2, we'll remove this dependency soon. So it seems like this limitation is just a side effect of having a slash character.

@jschear. I'm not a JavaScript developer so I had a very basic question for you. What is the full command for creating a new plug? Is it:

yarn flipper-pkg init

Also, is it run from the "desktop" directory or the repo root?

@bizzguy npx flipper-pkg init. You run it in the directory where you want to store your plugin under development. Since you will typically want to create your own VCS directory for that, it is typically not done in the flipper checkout itself :)

@bizzguy I only dabble in JS, so I'm just as clueless 馃槃 I followed the documentation here, and installed flipper-pkg as a global package using yarn global add flipper-pkg (for better or worse), which appears to have added it to my path.

This is fixed in #1427 and will be releases with the next Flipper version. For now you can test this by building manually from sources using command "cd flipper/desktop && yarn build --mac" which will output binaries to "flipper/dist" folder.

Was this page helpful?
0 / 5 - 0 ratings