From 8003e7eb340cf463ed160872b8c23419c5fa6e6e Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Mon, 15 Jun 2020 07:28:12 -0700 Subject: [PATCH] Migrate all plugins to spec v2 Summary: All the plugins migrated to spec v2 to allow packaging/publishing them independently from Flipper releases. Reviewed By: passy Differential Revision: D22041384 fbshipit-source-id: 23bfaf724f771a57bd628b9ea1c4d37846534a93 --- desktop/plugins/cpu/package.json | 16 +++++++++++---- desktop/plugins/crash_reporter/package.json | 16 +++++++++++---- desktop/plugins/databases/package.json | 12 ++++++++--- desktop/plugins/example/package.json | 20 +++++++++++++++++-- desktop/plugins/fresco/package.json | 16 +++++++++++---- desktop/plugins/hermesdebuggerrn/package.json | 14 ++++++++++--- .../plugins/kaios-allocations/package.json | 10 +++++++--- desktop/plugins/kaios-ram/package.json | 12 ++++++++--- desktop/plugins/layout/package.json | 12 ++++++++--- desktop/plugins/leak_canary/package.json | 12 ++++++++--- desktop/plugins/logs/package.json | 16 +++++++++++---- desktop/plugins/navigation/package.json | 14 ++++++++++--- desktop/plugins/network/package.json | 5 ++++- desktop/plugins/reactdevtools/package.json | 12 ++++++++--- desktop/plugins/rn-tic-tac-toe/package.json | 16 +++++++++++---- desktop/plugins/sandbox/package.json | 16 +++++++++++---- desktop/plugins/sections/package.json | 14 ++++++++++--- .../plugins/shared_preferences/package.json | 16 +++++++++++---- 18 files changed, 191 insertions(+), 58 deletions(-) diff --git a/desktop/plugins/cpu/package.json b/desktop/plugins/cpu/package.json index 4bec80132..530cfa805 100644 --- a/desktop/plugins/cpu/package.json +++ b/desktop/plugins/cpu/package.json @@ -1,12 +1,20 @@ { - "name": "DeviceCPU", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-device-cpu", + "id": "DeviceCPU", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "title": "CPU", "icon": "underline", "bugs": { "email": "barney@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/crash_reporter/package.json b/desktop/plugins/crash_reporter/package.json index 89e9184b8..5914a2dfd 100644 --- a/desktop/plugins/crash_reporter/package.json +++ b/desktop/plugins/crash_reporter/package.json @@ -1,11 +1,16 @@ { - "name": "CrashReporter", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-crash-reporter", + "id": "CrashReporter", "version": "0.1.0", "description": "A plugin which will display a crash", - "main": "index.js", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.js", "repository": "https://github.com/facebook/flipper", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "title": "Crash Reporter", "bugs": { "email": "prit91@fb.com", @@ -13,5 +18,8 @@ }, "dependencies": { "unicode-substring": "^1.0.0" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/databases/package.json b/desktop/plugins/databases/package.json index f134b857c..f5fae8aa6 100644 --- a/desktop/plugins/databases/package.json +++ b/desktop/plugins/databases/package.json @@ -1,9 +1,12 @@ { - "name": "Databases", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-databases", + "id": "Databases", "version": "1.0.0", "title": "Databases", "icon": "internet", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "keywords": [ "flipper-plugin" @@ -22,5 +25,8 @@ "bugs": { "email": "oncall+flipper@xmail.facebook.com", "url": "https://fb.workplace.com/groups/flippersupport/" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/example/package.json b/desktop/plugins/example/package.json index 1e23def5c..4dad37be6 100644 --- a/desktop/plugins/example/package.json +++ b/desktop/plugins/example/package.json @@ -1,13 +1,29 @@ { + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-example", + "id": "flipper-plugin-example", "version": "1.0.0", "description": "An example for a Flipper plugin", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "title": "Example Plugin", "icon": "apps", "bugs": { "url": "https://fbflipper.com/" + }, + "scripts": { + "lint": "flipper-pkg lint", + "prepack": "flipper-pkg lint && flipper-pkg bundle" + }, + "peerDependencies": { + "flipper": "0.46.0" + }, + "devDependencies": { + "flipper": "0.46.0", + "flipper-pkg": "0.46.0" } } diff --git a/desktop/plugins/fresco/package.json b/desktop/plugins/fresco/package.json index 70e8f58ad..efd43534d 100644 --- a/desktop/plugins/fresco/package.json +++ b/desktop/plugins/fresco/package.json @@ -1,12 +1,20 @@ { - "name": "Fresco", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-fresco", + "id": "Fresco", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "title": "Images", "icon": "profile", "bugs": { "email": "oncall+fresco@xmail.facebook.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/hermesdebuggerrn/package.json b/desktop/plugins/hermesdebuggerrn/package.json index 3c36f9a9f..980b80428 100644 --- a/desktop/plugins/hermesdebuggerrn/package.json +++ b/desktop/plugins/hermesdebuggerrn/package.json @@ -1,12 +1,20 @@ { + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-hermesdebuggerrn", + "id": "flipper-plugin-hermesdebuggerrn", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "title": "Hermes Debugger (RN)", "icon": "apps", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "bugs": { "email": "rickhanlonii@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/kaios-allocations/package.json b/desktop/plugins/kaios-allocations/package.json index 1503706a2..94edd9bba 100644 --- a/desktop/plugins/kaios-allocations/package.json +++ b/desktop/plugins/kaios-allocations/package.json @@ -1,7 +1,10 @@ { + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-kaios-big-allocations", + "id": "flipper-plugin-kaios-big-allocations", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "title": "KaiOS: big allocations", "icon": "apps", @@ -13,7 +16,8 @@ "url": "https://fb.workplace.com/groups/wa.kaios/" }, "scripts": { - "postinstall": "patch-package" + "postinstall": "patch-package", + "prepack": "../../pkg/bin/run bundle" }, "devDependencies": { "patch-package": "^6.2.0" @@ -25,4 +29,4 @@ "resolutions": { "minimist": "1.2.3" } -} +} \ No newline at end of file diff --git a/desktop/plugins/kaios-ram/package.json b/desktop/plugins/kaios-ram/package.json index a5b5728bf..14508cfb3 100644 --- a/desktop/plugins/kaios-ram/package.json +++ b/desktop/plugins/kaios-ram/package.json @@ -1,7 +1,10 @@ { - "name": "kaios-graphs", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-kaios-graphs", + "id": "kaios-graphs", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "title": "KaiOS RAM graph", "icon": "apps", @@ -21,5 +24,8 @@ }, "resolutions": { "@types/react": "16.9.17" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/layout/package.json b/desktop/plugins/layout/package.json index d6fc04acf..f94655b1c 100644 --- a/desktop/plugins/layout/package.json +++ b/desktop/plugins/layout/package.json @@ -1,7 +1,10 @@ { - "name": "Inspector", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-inspector", + "id": "Inspector", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "keywords": [ "flipper-plugin" @@ -18,5 +21,8 @@ "bugs": { "email": "oncall+flipper@xmail.facebook.com", "url": "https://fb.workplace.com/groups/flippersupport/" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/leak_canary/package.json b/desktop/plugins/leak_canary/package.json index 6535a3146..5d4272abf 100644 --- a/desktop/plugins/leak_canary/package.json +++ b/desktop/plugins/leak_canary/package.json @@ -1,7 +1,10 @@ { - "name": "LeakCanary", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-leak-canary", + "id": "LeakCanary", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "keywords": [ "flipper-plugin" @@ -12,5 +15,8 @@ "title": "LeakCanary", "bugs": { "email": "jhli@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/logs/package.json b/desktop/plugins/logs/package.json index 107ac9da3..ad767c8b4 100644 --- a/desktop/plugins/logs/package.json +++ b/desktop/plugins/logs/package.json @@ -1,14 +1,22 @@ { - "name": "DeviceLogs", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-device-logs", + "id": "DeviceLogs", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "dependencies": {}, "title": "Logs", "icon": "arrow-right", "bugs": { "email": "oncall+flipper@xmail.facebook.com", "url": "https://fb.workplace.com/groups/flippersupport/" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/navigation/package.json b/desktop/plugins/navigation/package.json index d9b20e573..dc19b0afe 100644 --- a/desktop/plugins/navigation/package.json +++ b/desktop/plugins/navigation/package.json @@ -1,12 +1,20 @@ { + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-navigation", + "id": "flipper-plugin-navigation", "version": "0.0.1", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "title": "Navigation", "icon": "directions", "bugs": { "email": "beneloca@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/network/package.json b/desktop/plugins/network/package.json index 220bef8a8..f99493444 100644 --- a/desktop/plugins/network/package.json +++ b/desktop/plugins/network/package.json @@ -3,7 +3,7 @@ "name": "flipper-plugin-network", "id": "Network", "flipperBundlerEntry": "index.tsx", - "main": "dist/index.js", + "main": "dist/bundle.js", "title": "Network", "description": "Use the Network inspector to inspect outgoing network traffic in your apps.", "icon": "internet", @@ -23,5 +23,8 @@ }, "devDependencies": { "@types/pako": "^1.0.1" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } } diff --git a/desktop/plugins/reactdevtools/package.json b/desktop/plugins/reactdevtools/package.json index 2edb3af45..58bdcfdbe 100644 --- a/desktop/plugins/reactdevtools/package.json +++ b/desktop/plugins/reactdevtools/package.json @@ -1,7 +1,10 @@ { + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-react-devtools", + "id": "flipper-plugin-react-devtools", "version": "1.0.1", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", "keywords": [ "flipper-plugin" @@ -16,5 +19,8 @@ "bugs": { "email": "danielbuechele@fb.com" }, - "devDependencies": {} -} + "devDependencies": {}, + "scripts": { + "prepack": "../../pkg/bin/run bundle" + } +} \ No newline at end of file diff --git a/desktop/plugins/rn-tic-tac-toe/package.json b/desktop/plugins/rn-tic-tac-toe/package.json index a6b7d9a02..7459df99c 100644 --- a/desktop/plugins/rn-tic-tac-toe/package.json +++ b/desktop/plugins/rn-tic-tac-toe/package.json @@ -1,13 +1,21 @@ { - "name": "ReactNativeTicTacToe", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-react-native-tic-tac-toe", + "id": "ReactNativeTicTacToe", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "icon": "apps", "title": "React Native Tic Tac Toe", "category": "Examples", "bugs": { "email": "mweststrate@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/sandbox/package.json b/desktop/plugins/sandbox/package.json index 452183565..5f355a786 100644 --- a/desktop/plugins/sandbox/package.json +++ b/desktop/plugins/sandbox/package.json @@ -1,12 +1,20 @@ { - "name": "Sandbox", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-sandbox", + "id": "Sandbox", "title": "Sandbox", "version": "1.0.0", - "main": "index.tsx", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.tsx", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "icon": "translate", "bugs": { "email": "edoardo@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/sections/package.json b/desktop/plugins/sections/package.json index 31fe07637..34e397961 100644 --- a/desktop/plugins/sections/package.json +++ b/desktop/plugins/sections/package.json @@ -1,19 +1,27 @@ { + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-sections", + "id": "flipper-plugin-sections", "title": "Sections", "bugs": { "email": "oncall+ios_componentkit@xmail.facebook.com", "url": "https://fb.workplace.com/groups/componentkit/" }, "version": "1.0.0", - "main": "index.js", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.js", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "gatekeeper": "flipper_sections_plugin", "dependencies": { "react-d3-tree": "^1.12.1" }, "resolutions": { "react-d3-tree/d3": "file:./d3" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file diff --git a/desktop/plugins/shared_preferences/package.json b/desktop/plugins/shared_preferences/package.json index 0c08c41e0..eba6948c2 100644 --- a/desktop/plugins/shared_preferences/package.json +++ b/desktop/plugins/shared_preferences/package.json @@ -1,14 +1,22 @@ { - "name": "Preferences", + "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", + "name": "flipper-plugin-preferences", + "id": "Preferences", "version": "1.0.0", - "main": "index.js", + "main": "dist/bundle.js", + "flipperBundlerEntry": "index.js", "license": "MIT", - "keywords": ["flipper-plugin"], + "keywords": [ + "flipper-plugin" + ], "dependencies": { "lodash": "^4.17.13" }, "title": "Shared Preferences Viewer", "bugs": { "email": "halsibai@fb.com" + }, + "scripts": { + "prepack": "../../pkg/bin/run bundle" } -} +} \ No newline at end of file