Summary: Moved all types related to plugin descriptions from plugin-lib (which handles downloads and such) to flipper-common. The goal of that is to remove all plugin-lib usage from ui-core to server-core, so that the UI itself doesn't do any file operations anymore related to plugins. That will be done in next diffs, this just moves types but no code.
Reviewed By: nikoant, aigoncharov
Differential Revision: D32665064
fbshipit-source-id: 86d908e7264569b0229b09290a891171876c8e00
Summary:
`flipper-pkg init` would always introduce `flipper-plugin` peer with version `latest`. Since that can never be checked against the current flipper version, it always generated a warning. Updated the init process to take the version the plugin was generated with as base version instead.
Note that in the test the version will always display as 0.0.0, will double check after release that the proper version will show up when running from npx, but don't see a reason why not (famous last words)
Reviewed By: nikoant, priteshrnandgaonkar
Differential Revision: D28992531
fbshipit-source-id: c32aad1650f575f790c2e04d089104b7a616d26f
Summary:
Added option to bootstrap device plugin in "flipper-pkg".
Changelog: "flipper-pkg init" can now be used to bootstrap device plugins
Reviewed By: mweststrate
Differential Revision: D26389429
fbshipit-source-id: 90773011bd50289004cd747111e1787402840922
Summary:
When running `flipper-pkg init path/plugin`, this allows to skip the `Do you wanna add this path to watching in Flipper config?`, if the path is direct first level subdirectory of any added path from Flipper `pluginPaths: []`
## Changelog
- Improve matching for watched pluginPaths when initialising new plugin
Pull Request resolved: https://github.com/facebook/flipper/pull/1269
Test Plan:
1. Create folder: `~/flipper-plugins`
2. Add this folder to Flipper config `pluginPaths: ['~/flipper-plugins']`
3. Create new subfolder `test-plugin`
4. Run `flipper-pkg init test-plugin`
5. It should not ask to add this folder to pluginPaths
To verify it only works for first level subdirectory, create another folder: `/deep/test-plugin2` and re-run steps with it.
This should also keep working if we specify exactly the path for the plugin itself.
Reviewed By: mweststrate
Differential Revision: D22065630
Pulled By: jknoxville
fbshipit-source-id: 9ef8d364e3815033b63579e37a6f2d19515ca902
Summary: Freshly init-ed plugins are not picked up by Flipper if they are not on the search path. This diff checks if the current dir is on the search path, and, if not, suggests to add it.
Reviewed By: jknoxville
Differential Revision: D21619632
fbshipit-source-id: b1dbe2695dbee9ce537999dc83e36f969ba4b747
Summary:
Created a test that snapshots the generated files, so that we can capture accidental regressions when generating files.
Also made the package id to package name a bit more robust
Reviewed By: jknoxville
Differential Revision: D21619633
fbshipit-source-id: 88ffb127e050d840df9ccd4b15ba29a71f341975
Summary:
Although there are tools that do this for you (create-react-app, react-native), and other that assume you are already in the created directory before you invoke the command (typescript, git), creating the directory by the tool has a few benefits:
1. less risk of making an accidental mess when people assume they don't need to create the dir first (I definitely ended up with a node_modules in the wrong directory)
1. it provide a naive way of detecting plugin name conflicts early (at least for plugins you create yourself)
1. in the next diff I'll add a pkg suggestion to add the current directory to the search path for flipper plugins. In the current setup, that would require needing to suggest to add the parent directory, which somehow feels less logical
2. makes sure that the directory name follows npm conventions: the package.json name should match the current directory name (not super important, but e.g VSCode will show warnings otherwise)
Reviewed By: jknoxville
Differential Revision: D21619631
fbshipit-source-id: 6d027ad18f14659e0347a66cacf056eacbc65680