Commit Graph

10 Commits

Author SHA1 Message Date
Anton Nikolaev
419691da97 Added command "flipper-pkg checksum"
Summary: Changelog: Added command `flipper-pkg checksum` for computing the total checksum of all the files included into plugin package.

Reviewed By: passy

Differential Revision: D22255125

fbshipit-source-id: a4f91370b4ab16ea4ce4a60e29f9d20fdd5f4331
2020-06-26 03:25:27 -07:00
Anton Nikolaev
877e0816b8 Include templates into flipper-pkg npm package
Summary: "flipper-pkg init" command was broken: https://github.com/facebook/flipper/issues/1112

Reviewed By: passy

Differential Revision: D21385652

fbshipit-source-id: e852a3872130077b83523d4dc67963a4b23a7ad7
2020-05-05 03:49:40 -07:00
Anton Nikolaev
a47cd12c84 Fixed publishing of "flipper-pkg"
Summary: There was an error on "lint" command, because json schemas was not published as a part of npm package

Reviewed By: jknoxville

Differential Revision: D21328254

fbshipit-source-id: 531d5892ccfea0c68a6369d44af43c840c3fe4ca
2020-04-30 10:21:44 -07:00
Anton Nikolaev
1cf3c30b7c "migrate" command for flipper-pkg tool
Summary: "migrate" command for easy migration of existing Flipper plugins to the specification version 2.

Reviewed By: passy

Differential Revision: D21253913

fbshipit-source-id: 9edb170fbaa10e9c3f670d5d68e69f4f6106c151
2020-04-28 05:01:06 -07:00
Anton Nikolaev
d08dfee018 "init" command for flipper-pkg tool
Summary: Added command "init" to "flipper-pkg" which helps to quickly initialise Flipper desktop plugin.

Reviewed By: passy

Differential Revision: D21253819

fbshipit-source-id: 85a2fbde07ecb63737d180d2a7e5cc2846b4f533
2020-04-27 17:34:12 -07:00
Anton Nikolaev
21c574ac80 "lint" command for flipper-pkg tool
Summary:
Implemented json schema for flipper plugin package.json and used it for validation in "flipper-pkg lint" command.

Nice thing about json schema is that it not only allows to validate json, but also can be referenced using "$schema" property in json so IDEs like VSCode can find it and use for code completion, validation and to show properties documentation. I'm going to deploy the schema as a part of documentation website so it can be referenced as https://fbflipper.com/schemas/plugin-package/v2.json.

Also the "$schema" field can be used instead of "specVersion" to determine the specification according to which the plugin is defined. E.g., if specification version 3 would be created, it will be described in schema https://fbflipper.com/schemas/plugin-package/v3.json, etc.

Reviewed By: passy

Differential Revision: D21228294

fbshipit-source-id: f21351e584ef936a7d6b314436448489691f83a6
2020-04-27 17:34:11 -07:00
Anton Nikolaev
1491e111c9 Bundle command
Summary:
Command which transpiles and bundles plugin code.

It is supposed to be used in "prepack" script for all open-sourced plugin packages to bundle them before publishing like this:
```
{
  "devDependencies": {
    "flipper-pkg": "latest"
  },
  "scripts": {
    "prepack": "flipper-pkg bundle"
  }
}
```

Also made directory parameter of other command "pack" optional so it also can be called from plugin directory simply by `flipper-pkg pack`.

Changelog: "flipper-pkg bundle" command for bundling plugins before publishing.

Reviewed By: mweststrate

Differential Revision: D21129691

fbshipit-source-id: 8f97bc950c28cf9ad8b0117c0e1d811ed1b988eb
2020-04-20 11:14:37 -07:00
Anton Nikolaev
105345facd Rename command "bundle" to "pack"
Summary: Renamed command "bundle" to "pack" because the latter name better describe what the command does. Also I'm going to add another command which will only bundle the plugin code and it will be called "bundle" (see the next diff in this stack)

Reviewed By: mweststrate

Differential Revision: D21129690

fbshipit-source-id: 2dde30501c3776d6796c27c68d49948d1f84f822
2020-04-20 11:14:36 -07:00
Anton Nikolaev
2690894ad0 Fix npm publishing
Summary:
Fixed npm packaging/publishing scripts for "flipper-doctor", "flipper-pkg" and "flipper-babel-transformer".

Also removed scripts for testing and linting, because these packages are tested and linted by root level package.json.

Reviewed By: jknoxville

Differential Revision: D20839959

fbshipit-source-id: 4d9d037d4921fc97356c849054c389dfece05652
2020-04-06 02:35:51 -07:00
Anton Nikolaev
85c13bb1f3 Move desktop-related code to "desktop" subfolder (#872)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/872
Move all the JS code related to desktop app to "desktop" subfolder.

The structure of "desktop" folder:
- `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins".
- `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process
- `pkg` - Flipper packaging lib and CLI tool
- `doctor` - Flipper diagnostics lib and CLI tool
- `scripts` - Build scripts for Flipper desktop app
- `headless` - Headless version of Flipper app
- `headless-tests` - Integration tests running agains Flipper headless version

Reviewed By: passy

Differential Revision: D20249304

fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
2020-03-14 14:35:17 -07:00