Read description from plugin's package json
Summary: Added "description" field to PluginDetails interface and read it from package.json Reviewed By: passy Differential Revision: D21927391 fbshipit-source-id: 0513637d3afa3d8be8e2bc8ee87cc1d77c5e2250
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9324bef8cc
commit
907cb9e3cc
@@ -17,7 +17,8 @@ export default interface PluginDetails {
|
||||
id: string;
|
||||
gatekeeper?: string;
|
||||
icon?: string;
|
||||
title?: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
category?: string;
|
||||
bugs?: {
|
||||
email?: string;
|
||||
|
||||
@@ -16,6 +16,7 @@ test('getPluginDetailsV1', async () => {
|
||||
version: '2.0.0',
|
||||
title: 'Test Plugin',
|
||||
main: 'src/index.tsx',
|
||||
description: 'Description of Test Plugin',
|
||||
gatekeeper: 'GK_flipper_plugin_test',
|
||||
};
|
||||
jest.mock('fs-extra', () => jest.fn());
|
||||
@@ -25,6 +26,7 @@ test('getPluginDetailsV1', async () => {
|
||||
Object {
|
||||
"bugs": undefined,
|
||||
"category": undefined,
|
||||
"description": "Description of Test Plugin",
|
||||
"dir": "./plugins/flipper-plugin-test",
|
||||
"gatekeeper": "GK_flipper_plugin_test",
|
||||
"icon": undefined,
|
||||
@@ -47,6 +49,7 @@ test('getPluginDetailsV2', async () => {
|
||||
version: '3.0.1',
|
||||
main: 'dist/bundle.js',
|
||||
flipperBundlerEntry: 'src/index.tsx',
|
||||
description: 'Description of Test Plugin',
|
||||
gatekeeper: 'GK_flipper_plugin_test',
|
||||
};
|
||||
jest.mock('fs-extra', () => jest.fn());
|
||||
@@ -56,6 +59,7 @@ test('getPluginDetailsV2', async () => {
|
||||
Object {
|
||||
"bugs": undefined,
|
||||
"category": undefined,
|
||||
"description": "Description of Test Plugin",
|
||||
"dir": "./plugins/flipper-plugin-test",
|
||||
"gatekeeper": "GK_flipper_plugin_test",
|
||||
"icon": undefined,
|
||||
@@ -78,6 +82,7 @@ test('id used as title if the latter omited', async () => {
|
||||
version: '3.0.1',
|
||||
main: 'dist/bundle.js',
|
||||
flipperBundlerEntry: 'src/index.tsx',
|
||||
description: 'Description of Test Plugin',
|
||||
gatekeeper: 'GK_flipper_plugin_test',
|
||||
};
|
||||
jest.mock('fs-extra', () => jest.fn());
|
||||
@@ -87,6 +92,7 @@ test('id used as title if the latter omited', async () => {
|
||||
Object {
|
||||
"bugs": undefined,
|
||||
"category": undefined,
|
||||
"description": "Description of Test Plugin",
|
||||
"dir": "./plugins/flipper-plugin-test",
|
||||
"gatekeeper": "GK_flipper_plugin_test",
|
||||
"icon": undefined,
|
||||
@@ -108,6 +114,7 @@ test('name without "flipper-plugin-" prefix is used as title if the latter omite
|
||||
version: '3.0.1',
|
||||
main: 'dist/bundle.js',
|
||||
flipperBundlerEntry: 'src/index.tsx',
|
||||
description: 'Description of Test Plugin',
|
||||
gatekeeper: 'GK_flipper_plugin_test',
|
||||
};
|
||||
jest.mock('fs-extra', () => jest.fn());
|
||||
@@ -117,6 +124,7 @@ test('name without "flipper-plugin-" prefix is used as title if the latter omite
|
||||
Object {
|
||||
"bugs": undefined,
|
||||
"category": undefined,
|
||||
"description": "Description of Test Plugin",
|
||||
"dir": "./plugins/flipper-plugin-test",
|
||||
"gatekeeper": "GK_flipper_plugin_test",
|
||||
"icon": undefined,
|
||||
|
||||
@@ -49,6 +49,7 @@ async function getPluginDetailsV1(
|
||||
gatekeeper: packageJson.gatekeeper,
|
||||
icon: packageJson.icon,
|
||||
title: packageJson.title || packageJson.name,
|
||||
description: packageJson.description,
|
||||
category: packageJson.category,
|
||||
bugs: packageJson.bugs,
|
||||
};
|
||||
@@ -71,6 +72,7 @@ async function getPluginDetailsV2(
|
||||
icon: packageJson.icon,
|
||||
title:
|
||||
packageJson.title || packageJson.id || getTitleFromName(packageJson.name),
|
||||
description: packageJson.description,
|
||||
category: packageJson.category,
|
||||
bugs: packageJson.bugs,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user