From f7e7131a7b10b347df5c8e331cf8c59cc9ec88e0 Mon Sep 17 00:00:00 2001 From: Chaiwat Ekkaewnumchai Date: Wed, 8 Jul 2020 03:05:17 -0700 Subject: [PATCH] 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 --- desktop/plugins/hermesdebuggerrn/index.tsx | 4 ---- desktop/plugins/hermesdebuggerrn/package.json | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/desktop/plugins/hermesdebuggerrn/index.tsx b/desktop/plugins/hermesdebuggerrn/index.tsx index 6d57459f0..39dd02ba0 100644 --- a/desktop/plugins/hermesdebuggerrn/index.tsx +++ b/desktop/plugins/hermesdebuggerrn/index.tsx @@ -61,10 +61,6 @@ const Container = styled(FlexColumn)({ }); export default class extends FlipperDevicePlugin { - static title = 'Hermes Debugger'; - static id = 'Hermesdebuggerrn'; - static icon = 'code'; - static supportsDevice(device: Device) { return !device.isArchived && device.os === 'Metro'; } diff --git a/desktop/plugins/hermesdebuggerrn/package.json b/desktop/plugins/hermesdebuggerrn/package.json index 96af47807..eff49762d 100644 --- a/desktop/plugins/hermesdebuggerrn/package.json +++ b/desktop/plugins/hermesdebuggerrn/package.json @@ -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" ],