Treat only packages with "flipper-plugin" keyword as Flipper plugins

Summary:
Treat only packages with "flipper-plugin" keyword as Flipper plugins. This will allow to place lib packages re-used by different plugins into "plugins" folder.

Changelog: Internals: it is now possible to add modules for re-use by different plugins into `desktop/plugins` folder.

Reviewed By: mweststrate

Differential Revision: D20898133

fbshipit-source-id: 8934870350ce42af3dc8060d1494025519ed307e
This commit is contained in:
Anton Nikolaev
2020-04-14 07:10:38 -07:00
committed by Facebook GitHub Bot
parent 452c52c291
commit 61a889a385
3 changed files with 10 additions and 1 deletions

View File

@@ -5,6 +5,9 @@
"license": "MIT", "license": "MIT",
"title": "KaiOS: big allocations", "title": "KaiOS: big allocations",
"icon": "apps", "icon": "apps",
"keywords": [
"flipper-plugin"
],
"bugs": { "bugs": {
"email": "oncall+wa_kaios@xmail.facebook.com", "email": "oncall+wa_kaios@xmail.facebook.com",
"url": "https://fb.workplace.com/groups/wa.kaios/" "url": "https://fb.workplace.com/groups/wa.kaios/"

View File

@@ -5,6 +5,9 @@
"license": "MIT", "license": "MIT",
"title": "KaiOS RAM graph", "title": "KaiOS RAM graph",
"icon": "apps", "icon": "apps",
"keywords": [
"flipper-plugin"
],
"bugs": { "bugs": {
"email": "oncall+wa_kaios@xmail.facebook.com", "email": "oncall+wa_kaios@xmail.facebook.com",
"url": "https://fb.workplace.com/groups/wa.kaios/" "url": "https://fb.workplace.com/groups/wa.kaios/"

View File

@@ -210,7 +210,10 @@ function entryPointForPluginFolder(pluginPath: string) {
if (packageJSON) { if (packageJSON) {
try { try {
const json = JSON.parse(packageJSON); const json = JSON.parse(packageJSON);
if (json.workspaces) { if (!json.keywords || !json.keywords.includes('flipper-plugin')) {
console.log(
`Skipping package "${json.name}", because its "keywords" field does not contain tag "flipper-plugin"`,
);
return null; return null;
} }
const pkg = json as PluginManifest; const pkg = json as PluginManifest;