Move Static Fields to package.json: hermesdebuggerrn

Summary:
Flipper reads metadata to show on the sidebar from `package.json` and static fields (`id`, `title`, and `icon`) from `FlipperPlugin` class. If there are fields declared in both file, `FlipperPlugin` class takes precedences.

With Sandy (new Flipper plugin API), there is no static field available. In order to prevent unexpected scenario happening when migrating to Sandy, this codemod-ish is applied to plugins that contain static field.

The static fields are merged into `package.json` to get the same result. In addition, the static fields are also removed.

Reviewed By: rickhanlonii

Differential Revision: D22411862

fbshipit-source-id: cb381261f575313110b781c2fddd3a2099e6479a
This commit is contained in:
Chaiwat Ekkaewnumchai
2020-07-08 03:05:17 -07:00
committed by Facebook GitHub Bot
parent 2ce65c1b3c
commit f7e7131a7b
2 changed files with 2 additions and 6 deletions

View File

@@ -61,10 +61,6 @@ const Container = styled(FlexColumn)({
});
export default class extends FlipperDevicePlugin<State, any, any> {
static title = 'Hermes Debugger';
static id = 'Hermesdebuggerrn';
static icon = 'code';
static supportsDevice(device: Device) {
return !device.isArchived && device.os === 'Metro';
}

View File

@@ -1,13 +1,13 @@
{
"$schema": "https://fbflipper.com/schemas/plugin-package/v2.json",
"name": "flipper-plugin-hermesdebuggerrn",
"id": "flipper-plugin-hermesdebuggerrn",
"id": "Hermesdebuggerrn",
"version": "0.49.0",
"main": "dist/bundle.js",
"flipperBundlerEntry": "index.tsx",
"license": "MIT",
"title": "Hermes Debugger (RN)",
"icon": "apps",
"icon": "code",
"keywords": [
"flipper-plugin"
],