Strip flipper-plugin prefix when listing public plugins

Summary:
Stripping the common prefix when displaying plugin names.
Prior art for this is Jest, Babel, and ESlint.

Only altering it at the presentation level so we still work with the full name under the hood everywhere.

Reviewed By: mweststrate

Differential Revision: D20509786

fbshipit-source-id: ec6b3b064cdaa4d8dd32324fc19131c0bacd5c73
This commit is contained in:
John Knox
2020-03-18 06:32:48 -07:00
committed by Facebook GitHub Bot
parent 9eea885a2d
commit 85abad2daf

View File

@@ -352,7 +352,13 @@ function useNPMSearch(
(h: UpdatablePluginDefinition) => ({ (h: UpdatablePluginDefinition) => ({
key: h.name, key: h.name,
columns: { columns: {
name: {value: <EllipsisText>{h.name}</EllipsisText>}, name: {
value: (
<EllipsisText>
{h.name.replace(/^flipper-plugin-/, '')}
</EllipsisText>
),
},
version: { version: {
value: <EllipsisText>{h.version}</EllipsisText>, value: <EllipsisText>{h.version}</EllipsisText>,
align: 'flex-end' as 'flex-end', align: 'flex-end' as 'flex-end',