@ebay/muse-manager 1.3.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MUSE_README.md +849 -0
- package/build/MUSE_README.md +849 -0
- package/build/dev/assets/index-C1wX1tsR.css +1 -0
- package/build/dev/deps-manifest.json +22 -27
- package/build/dev/info.json +24 -0
- package/build/dev/main.js +38 -49
- package/build/dev/main.js.map +1 -1
- package/build/dist/assets/index-C1wX1tsR.css +1 -0
- package/build/dist/deps-manifest.json +20 -26
- package/build/dist/info.json +24 -0
- package/build/dist/main.js +39 -49
- package/build/dist/main.js.map +1 -1
- package/build/test/assets/index-C1wX1tsR.css +1 -0
- package/build/test/deps-manifest.json +20 -26
- package/build/test/info.json +24 -0
- package/build/test/main.js +39 -49
- package/build/test/main.js.map +1 -1
- package/package.json +44 -31
- package/build/dev/assets/index-Bb5-Rkc7.css +0 -1
- package/build/dist/assets/index-Bb5-Rkc7.css +0 -1
- package/build/test/assets/index-Bb5-Rkc7.css +0 -1
|
@@ -0,0 +1,849 @@
|
|
|
1
|
+
# Plugin Integration Guide: @ebay/muse-manager
|
|
2
|
+
|
|
3
|
+
**Generated**: 2026-03-28
|
|
4
|
+
**Plugin Type**: normal
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Plugin Purpose & Overview
|
|
9
|
+
|
|
10
|
+
### What This Plugin Does
|
|
11
|
+
|
|
12
|
+
The `@ebay/muse-manager` plugin provides a comprehensive web-based UI for managing MUSE apps, environments, and plugins. It serves as the central administrative interface for the MUSE micro-frontends platform, enabling users to create, configure, deploy, and monitor MUSE applications and their plugins through an intuitive dashboard.
|
|
13
|
+
|
|
14
|
+
### Key Features
|
|
15
|
+
|
|
16
|
+
- **Application Management**: Create apps, manage environments, configure app settings, and control plugin deployments
|
|
17
|
+
- **Plugin Management**: Register plugins, release versions, deploy/undeploy plugins across environments, and track deployment status
|
|
18
|
+
- **Request Tracking**: Monitor deployment requests and system operations with real-time status updates
|
|
19
|
+
- **Access Control Integration**: Implements permission-based UI controls using CASL/ACL system
|
|
20
|
+
- **Environment Variables**: Manage app-level, environment-level, and plugin-level configuration variables
|
|
21
|
+
- **Version Tracking**: Visual diff indicators showing version drift between deployed and latest plugin releases
|
|
22
|
+
|
|
23
|
+
### Plugin Type: normal
|
|
24
|
+
|
|
25
|
+
This is a normal-type plugin providing business features within the MUSE ecosystem. It runs after library plugins and consumes shared modules (React, Ant Design) from lib plugins at runtime.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Extension Points Exposed
|
|
30
|
+
|
|
31
|
+
This plugin exposes 70+ extension points that OTHER plugins can implement to extend its functionality. These extension points allow customization of forms, tables, modals, actions, and UI components throughout the muse-manager interface.
|
|
32
|
+
|
|
33
|
+
### Summary
|
|
34
|
+
|
|
35
|
+
- **Total Extension Points**: 70+ individual extension points
|
|
36
|
+
- **Categories**:
|
|
37
|
+
- Application Management Extensions (AM)
|
|
38
|
+
- Plugin Management Extensions (PM)
|
|
39
|
+
- Request Management Extensions (Req)
|
|
40
|
+
- App Page Extensions
|
|
41
|
+
- Form Extensions
|
|
42
|
+
- Table Extensions
|
|
43
|
+
- Modal Extensions
|
|
44
|
+
- Action Extensions
|
|
45
|
+
|
|
46
|
+
### Extension Point List
|
|
47
|
+
|
|
48
|
+
#### Application Management (AM) Extensions
|
|
49
|
+
|
|
50
|
+
##### `museManager.am.createAppForm.getWatchingFields`
|
|
51
|
+
|
|
52
|
+
- **Purpose**: Specify form fields to watch for changes in the create app form
|
|
53
|
+
- **When Invoked**: During form initialization
|
|
54
|
+
- **Context Parameters**:
|
|
55
|
+
- `meta`: `NiceFormMeta` - Form metadata
|
|
56
|
+
- `form`: `FormInstance` - Ant Design form instance
|
|
57
|
+
- **Expected Return**: `string[]` - Array of field names to watch
|
|
58
|
+
- **Use Case Example**: Add custom field validation that depends on other field values
|
|
59
|
+
- **File Reference**: src/features/am/CreateAppModal.jsx:54
|
|
60
|
+
|
|
61
|
+
##### `museManager.am.createAppForm.getFields`
|
|
62
|
+
|
|
63
|
+
- **Purpose**: Add custom fields to the create app form
|
|
64
|
+
- **When Invoked**: During form field collection
|
|
65
|
+
- **Context Parameters**:
|
|
66
|
+
- `meta`: `NiceFormMeta` - Form metadata
|
|
67
|
+
- `form`: `FormInstance` - Ant Design form instance
|
|
68
|
+
- **Expected Return**: `NiceFormFieldType | NiceFormFieldType[]` - Field definitions
|
|
69
|
+
- **Use Case Example**: Add organization or cost center fields for app creation
|
|
70
|
+
- **File Reference**: src/features/am/CreateAppModal.jsx:54
|
|
71
|
+
|
|
72
|
+
##### `museManager.am.createAppForm.preProcessMeta`
|
|
73
|
+
|
|
74
|
+
- **Purpose**: Modify form metadata before rendering in create app form
|
|
75
|
+
- **When Invoked**: Before form renders
|
|
76
|
+
- **Context Parameters**:
|
|
77
|
+
- `meta`: `NiceFormMeta` - Form metadata object
|
|
78
|
+
- `form`: `FormInstance` - Ant Design form instance
|
|
79
|
+
- **Expected Return**: `void` - Mutates meta object directly
|
|
80
|
+
- **Use Case Example**: Dynamically adjust field properties based on user permissions
|
|
81
|
+
- **File Reference**: src/features/am/CreateAppModal.jsx:54
|
|
82
|
+
|
|
83
|
+
##### `museManager.am.createAppForm.processMeta`
|
|
84
|
+
|
|
85
|
+
- **Purpose**: Process form metadata during rendering in create app form
|
|
86
|
+
- **When Invoked**: During form rendering
|
|
87
|
+
- **Context Parameters**:
|
|
88
|
+
- `meta`: `NiceFormMeta` - Form metadata
|
|
89
|
+
- `form`: `FormInstance` - Ant Design form instance
|
|
90
|
+
- **Expected Return**: `void` - Mutates meta object
|
|
91
|
+
- **Use Case Example**: Add conditional field visibility rules
|
|
92
|
+
- **File Reference**: src/features/am/CreateAppModal.jsx:54
|
|
93
|
+
|
|
94
|
+
##### `museManager.am.createAppForm.postProcessMeta`
|
|
95
|
+
|
|
96
|
+
- **Purpose**: Final metadata processing after all extensions in create app form
|
|
97
|
+
- **When Invoked**: After all other metadata processing
|
|
98
|
+
- **Context Parameters**:
|
|
99
|
+
- `meta`: `NiceFormMeta` - Form metadata
|
|
100
|
+
- `form`: `FormInstance` - Ant Design form instance
|
|
101
|
+
- **Expected Return**: `void` - Mutates meta object
|
|
102
|
+
- **Use Case Example**: Ensure custom field ordering or final validation rules
|
|
103
|
+
- **File Reference**: src/features/am/CreateAppModal.jsx:54
|
|
104
|
+
|
|
105
|
+
##### `museManager.am.editAppForm.getWatchingFields`
|
|
106
|
+
##### `museManager.am.editAppForm.getFields`
|
|
107
|
+
##### `museManager.am.editAppForm.preProcessMeta`
|
|
108
|
+
##### `museManager.am.editAppForm.processMeta`
|
|
109
|
+
##### `museManager.am.editAppForm.postProcessMeta`
|
|
110
|
+
|
|
111
|
+
- **Purpose**: Extend edit app form (similar lifecycle to createAppForm)
|
|
112
|
+
- **When Invoked**: During edit app modal rendering
|
|
113
|
+
- **Context Parameters**: `meta`, `form`, `app`, `setLoading`, `setError`
|
|
114
|
+
- **Expected Return**: Varies by lifecycle method
|
|
115
|
+
- **Use Case Example**: Add custom configuration fields for app editing
|
|
116
|
+
- **File Reference**: src/features/am/EditAppModal.jsx:54
|
|
117
|
+
|
|
118
|
+
##### `museManager.am.appBasicInfo.getWatchingFields`
|
|
119
|
+
##### `museManager.am.appBasicInfo.getFields`
|
|
120
|
+
##### `museManager.am.appBasicInfo.preProcessMeta`
|
|
121
|
+
##### `museManager.am.appBasicInfo.processMeta`
|
|
122
|
+
##### `museManager.am.appBasicInfo.postProcessMeta`
|
|
123
|
+
|
|
124
|
+
- **Purpose**: Extend app basic information display form
|
|
125
|
+
- **When Invoked**: During app overview rendering
|
|
126
|
+
- **Context Parameters**: `meta`, `app`
|
|
127
|
+
- **Expected Return**: Varies by lifecycle method
|
|
128
|
+
- **Use Case Example**: Add custom app metadata fields to basic info section
|
|
129
|
+
- **File Reference**: src/features/am/AppBasicInfo.jsx:60
|
|
130
|
+
|
|
131
|
+
##### `museManager.am.environments.preProcessColumns`
|
|
132
|
+
##### `museManager.am.environments.getColumns`
|
|
133
|
+
##### `museManager.am.environments.processColumns`
|
|
134
|
+
##### `museManager.am.environments.postProcessColumns`
|
|
135
|
+
|
|
136
|
+
- **Purpose**: Customize environment table columns
|
|
137
|
+
- **When Invoked**: During environment table rendering
|
|
138
|
+
- **Context Parameters**: `app`, `columns`
|
|
139
|
+
- **Expected Return**: Column definitions or void
|
|
140
|
+
- **Use Case Example**: Add deployment status or health check columns
|
|
141
|
+
- **File Reference**: src/features/am/Environments.jsx:32
|
|
142
|
+
|
|
143
|
+
##### `museManager.am.appPage.getNodes`
|
|
144
|
+
|
|
145
|
+
- **Purpose**: Add custom UI nodes to app page layout
|
|
146
|
+
- **When Invoked**: During app page rendering
|
|
147
|
+
- **Context Parameters**: `app`, `nodes`
|
|
148
|
+
- **Expected Return**: `NodeType | NodeType[]` - Node definitions
|
|
149
|
+
- **Use Case Example**: Add custom alerts, notices, or action buttons to app page
|
|
150
|
+
- **File Reference**: src/features/am/AppPage.jsx:99
|
|
151
|
+
|
|
152
|
+
##### `museManager.am.appPage.getAppNameActions`
|
|
153
|
+
|
|
154
|
+
- **Purpose**: Add action buttons/nodes next to app name header
|
|
155
|
+
- **When Invoked**: During app page header rendering
|
|
156
|
+
- **Context Parameters**: `app`, `appNameActions`
|
|
157
|
+
- **Expected Return**: `NodeType | NodeType[]` - Action node definitions
|
|
158
|
+
- **Use Case Example**: Add quick action buttons like "Export Config" or "Clone App"
|
|
159
|
+
- **File Reference**: src/features/am/AppPage.jsx:44
|
|
160
|
+
|
|
161
|
+
##### `museManager.am.appOverview.preProcessNodes`
|
|
162
|
+
##### `museManager.am.appOverview.getNodes`
|
|
163
|
+
##### `museManager.am.appOverview.processNodes`
|
|
164
|
+
##### `museManager.am.appOverview.postProcessNodes`
|
|
165
|
+
|
|
166
|
+
- **Purpose**: Extend app overview tab with custom sections
|
|
167
|
+
- **When Invoked**: During overview tab rendering
|
|
168
|
+
- **Context Parameters**: `app`, `nodes`
|
|
169
|
+
- **Expected Return**: `NodeType | NodeType[]` for getNodes, `void` for process methods
|
|
170
|
+
- **Use Case Example**: Add custom app statistics, dashboards, or monitoring widgets
|
|
171
|
+
- **File Reference**: src/features/am/AppOverview.jsx:49
|
|
172
|
+
|
|
173
|
+
#### Plugin Management (PM) Extensions
|
|
174
|
+
|
|
175
|
+
##### `museManager.pm.pluginInfoForm.getWatchingFields`
|
|
176
|
+
##### `museManager.pm.pluginInfoForm.getFields`
|
|
177
|
+
##### `museManager.pm.pluginInfoForm.preProcessMeta`
|
|
178
|
+
##### `museManager.pm.pluginInfoForm.processMeta`
|
|
179
|
+
##### `museManager.pm.pluginInfoForm.postProcessMeta`
|
|
180
|
+
|
|
181
|
+
- **Purpose**: Extend plugin information/edit form
|
|
182
|
+
- **When Invoked**: During plugin info modal rendering
|
|
183
|
+
- **Context Parameters**: `meta`, `form`, `app`, `plugin`, `viewMode`
|
|
184
|
+
- **Expected Return**: Varies by lifecycle method
|
|
185
|
+
- **Use Case Example**: Add repository URL, CI/CD status, or quality metrics fields
|
|
186
|
+
- **File Reference**: src/features/pm/PluginInfoModal.jsx:110
|
|
187
|
+
|
|
188
|
+
##### `museManager.pm.pluginInfoView.preProcessNodes`
|
|
189
|
+
##### `museManager.pm.pluginInfoView.getNodes`
|
|
190
|
+
##### `museManager.pm.pluginInfoView.processNodes`
|
|
191
|
+
##### `museManager.pm.pluginInfoView.postProcessNodes`
|
|
192
|
+
|
|
193
|
+
- **Purpose**: Add custom sections to plugin info modal body
|
|
194
|
+
- **When Invoked**: During plugin info modal rendering
|
|
195
|
+
- **Context Parameters**: `viewMode`, `plugin`, `app`
|
|
196
|
+
- **Expected Return**: `NodeType | NodeType[]` for getNodes, `void` for process methods
|
|
197
|
+
- **Use Case Example**: Add plugin dependency graph or usage statistics
|
|
198
|
+
- **File Reference**: src/features/pm/PluginInfoModal.jsx:137
|
|
199
|
+
|
|
200
|
+
##### `museManager.pm.pluginInfoModal.footer.preProcessItems`
|
|
201
|
+
##### `museManager.pm.pluginInfoModal.footer.getItems`
|
|
202
|
+
##### `museManager.pm.pluginInfoModal.footer.processItems`
|
|
203
|
+
##### `museManager.pm.pluginInfoModal.footer.postProcessItems`
|
|
204
|
+
|
|
205
|
+
- **Purpose**: Customize footer buttons in plugin info modal
|
|
206
|
+
- **When Invoked**: During modal footer rendering
|
|
207
|
+
- **Context Parameters**: `items` (button definitions)
|
|
208
|
+
- **Expected Return**: Footer item definitions or void
|
|
209
|
+
- **Use Case Example**: Add custom actions like "Build Plugin" or "Run Tests"
|
|
210
|
+
- **File Reference**: src/features/pm/PluginInfoModal.jsx:180
|
|
211
|
+
|
|
212
|
+
##### `museManager.pm.pluginList.preProcessColumns`
|
|
213
|
+
##### `museManager.pm.pluginList.getColumns`
|
|
214
|
+
##### `museManager.pm.pluginList.processColumns`
|
|
215
|
+
##### `museManager.pm.pluginList.postProcessColumns`
|
|
216
|
+
|
|
217
|
+
- **Purpose**: Customize plugin list table columns
|
|
218
|
+
- **When Invoked**: During plugin list rendering
|
|
219
|
+
- **Context Parameters**: `app`, `columns`, `plugins`, `searchValue`, `latestReleases`
|
|
220
|
+
- **Expected Return**: Column definitions or void
|
|
221
|
+
- **Use Case Example**: Add test coverage, build time, or bundle size columns
|
|
222
|
+
- **File Reference**: src/features/pm/PluginList.jsx:278
|
|
223
|
+
|
|
224
|
+
##### `museManager.pm.pluginList.pluginBadges.preProcessNodes`
|
|
225
|
+
##### `museManager.pm.pluginList.pluginBadges.getNodes`
|
|
226
|
+
##### `museManager.pm.pluginList.pluginBadges.processNodes`
|
|
227
|
+
##### `museManager.pm.pluginList.pluginBadges.postProcessNodes`
|
|
228
|
+
|
|
229
|
+
- **Purpose**: Add badges/tags next to plugin names in the list
|
|
230
|
+
- **When Invoked**: During plugin name cell rendering
|
|
231
|
+
- **Context Parameters**: `app`, `plugin`
|
|
232
|
+
- **Expected Return**: `NodeType | NodeType[]` for getNodes, `void` for process methods
|
|
233
|
+
- **Use Case Example**: Add status badges like "Deprecated", "Beta", or build status icons
|
|
234
|
+
- **File Reference**: Via src/features/pm/PluginList.jsx:132 → PluginBadges component
|
|
235
|
+
|
|
236
|
+
##### `museManager.pm.pluginList.preProcessActions`
|
|
237
|
+
##### `museManager.pm.pluginList.getActions`
|
|
238
|
+
##### `museManager.pm.pluginList.processActions`
|
|
239
|
+
##### `museManager.pm.pluginList.postProcessActions`
|
|
240
|
+
|
|
241
|
+
- **Purpose**: Customize plugin action dropdown menu
|
|
242
|
+
- **When Invoked**: During plugin actions rendering
|
|
243
|
+
- **Context Parameters**: `app`, `plugin`, `ability`, `actions`, `appByName`
|
|
244
|
+
- **Expected Return**: `ActionType | ActionType[]` for getActions, `void` for process methods
|
|
245
|
+
- **Use Case Example**: Add "Build", "Test", or "Publish to NPM" actions
|
|
246
|
+
- **File Reference**: src/features/pm/PluginActions.jsx:126
|
|
247
|
+
|
|
248
|
+
##### `museManager.pm.pluginList.getEnvFilters`
|
|
249
|
+
|
|
250
|
+
- **Purpose**: Add custom environment filters to plugin list
|
|
251
|
+
- **When Invoked**: During filter menu rendering
|
|
252
|
+
- **Context Parameters**: Filter context
|
|
253
|
+
- **Expected Return**: `EnvFilter | EnvFilter[]` - Filter definitions
|
|
254
|
+
- **Use Case Example**: Add filters like "Has Errors" or "Needs Update"
|
|
255
|
+
- **File Reference**: src/features/pm/EnvFilterMenu.jsx:61
|
|
256
|
+
|
|
257
|
+
##### `museManager.pm.pluginList.getEnvFilterFns`
|
|
258
|
+
|
|
259
|
+
- **Purpose**: Provide filter functions for environment-based filtering
|
|
260
|
+
- **When Invoked**: When applying environment filters
|
|
261
|
+
- **Context Parameters**: `filterKey`, `app`, `envName`
|
|
262
|
+
- **Expected Return**: `Function[]` - Filter functions to apply
|
|
263
|
+
- **Use Case Example**: Custom logic to filter plugins by deployment health
|
|
264
|
+
- **File Reference**: src/features/pm/PluginList.jsx:101
|
|
265
|
+
|
|
266
|
+
##### `museManager.pm.pluginList.getScopeFilterFns`
|
|
267
|
+
|
|
268
|
+
- **Purpose**: Provide filter functions for scope-based filtering (all/deployed)
|
|
269
|
+
- **When Invoked**: When applying scope filters
|
|
270
|
+
- **Context Parameters**: `scope` (string)
|
|
271
|
+
- **Expected Return**: `Function` - Filter function
|
|
272
|
+
- **Use Case Example**: Filter plugins by custom scopes like "mine" or "team"
|
|
273
|
+
- **File Reference**: src/features/pm/PluginList.jsx:63
|
|
274
|
+
|
|
275
|
+
##### `museManager.pm.pluginList.processPluginList`
|
|
276
|
+
|
|
277
|
+
- **Purpose**: Process/transform the entire plugin list before rendering
|
|
278
|
+
- **When Invoked**: After initial filtering, before display
|
|
279
|
+
- **Context Parameters**: `pluginList` (array)
|
|
280
|
+
- **Expected Return**: `void` - Mutates pluginList
|
|
281
|
+
- **Use Case Example**: Sort plugins by custom criteria or add computed properties
|
|
282
|
+
- **File Reference**: src/features/pm/PluginList.jsx:71
|
|
283
|
+
|
|
284
|
+
##### `museManager.pm.releaseList.preProcessColumns`
|
|
285
|
+
##### `museManager.pm.releaseList.getColumns`
|
|
286
|
+
##### `museManager.pm.releaseList.processColumns`
|
|
287
|
+
##### `museManager.pm.releaseList.postProcessColumns`
|
|
288
|
+
|
|
289
|
+
- **Purpose**: Customize release list table columns
|
|
290
|
+
- **When Invoked**: During releases drawer rendering
|
|
291
|
+
- **Context Parameters**: `plugin`, `app`, `releases`
|
|
292
|
+
- **Expected Return**: Column definitions or void
|
|
293
|
+
- **Use Case Example**: Add commit SHA, branch info, or build artifacts columns
|
|
294
|
+
- **File Reference**: src/features/pm/ReleasesDrawer.jsx:190
|
|
295
|
+
|
|
296
|
+
##### `museManager.pm.releaseList.preProcessActions`
|
|
297
|
+
##### `museManager.pm.releaseList.getActions`
|
|
298
|
+
##### `museManager.pm.releaseList.processActions`
|
|
299
|
+
##### `museManager.pm.releaseList.postProcessActions`
|
|
300
|
+
|
|
301
|
+
- **Purpose**: Customize release action dropdown
|
|
302
|
+
- **When Invoked**: During release row actions rendering
|
|
303
|
+
- **Context Parameters**: `app`, `plugin`, `ability`, `items`
|
|
304
|
+
- **Expected Return**: Action definitions or void
|
|
305
|
+
- **Use Case Example**: Add "Download Assets" or "View Build Log" actions
|
|
306
|
+
- **File Reference**: src/features/pm/ReleasesDrawer.jsx:159
|
|
307
|
+
|
|
308
|
+
##### `museManager.pm.releaseList.preProcessNodes`
|
|
309
|
+
##### `museManager.pm.releaseList.getNodes`
|
|
310
|
+
##### `museManager.pm.releaseList.processNodes`
|
|
311
|
+
##### `museManager.pm.releaseList.postProcessNodes`
|
|
312
|
+
|
|
313
|
+
- **Purpose**: Add custom sections to releases drawer
|
|
314
|
+
- **When Invoked**: During releases drawer rendering
|
|
315
|
+
- **Context Parameters**: `items`, `plugin`, `app`, `releases`
|
|
316
|
+
- **Expected Return**: Nodes or void
|
|
317
|
+
- **Use Case Example**: Add release timeline visualization or statistics
|
|
318
|
+
- **File Reference**: src/features/pm/ReleasesDrawer.jsx:214
|
|
319
|
+
|
|
320
|
+
##### `museManager.pm.releaseList.expandRow.preProcessNodes`
|
|
321
|
+
##### `museManager.pm.releaseList.expandRow.getNodes`
|
|
322
|
+
##### `museManager.pm.releaseList.expandRow.processNodes`
|
|
323
|
+
##### `museManager.pm.releaseList.expandRow.postProcessNodes`
|
|
324
|
+
|
|
325
|
+
- **Purpose**: Customize expanded row content for each release
|
|
326
|
+
- **When Invoked**: When release row is expanded
|
|
327
|
+
- **Context Parameters**: `items`, `release`
|
|
328
|
+
- **Expected Return**: Nodes or void
|
|
329
|
+
- **Use Case Example**: Show commit details, file changes, or test results
|
|
330
|
+
- **File Reference**: src/features/pm/ReleasesDrawer.jsx:186
|
|
331
|
+
|
|
332
|
+
##### `museManager.pm.deployPluginModal.form.getWatchingFields`
|
|
333
|
+
##### `museManager.pm.deployPluginModal.form.getFields`
|
|
334
|
+
##### `museManager.pm.deployPluginModal.form.preProcessMeta`
|
|
335
|
+
##### `museManager.pm.deployPluginModal.form.processMeta`
|
|
336
|
+
##### `museManager.pm.deployPluginModal.form.postProcessMeta`
|
|
337
|
+
|
|
338
|
+
- **Purpose**: Extend deploy plugin form
|
|
339
|
+
- **When Invoked**: During deploy modal rendering
|
|
340
|
+
- **Context Parameters**: `meta`, `ability`, `app`, `form`, `plugin`, `version`, plus state setters
|
|
341
|
+
- **Expected Return**: Varies by method
|
|
342
|
+
- **Use Case Example**: Add deployment options like "run smoke tests" or "notify team"
|
|
343
|
+
- **File Reference**: src/features/pm/DeployPluginModal.jsx:152
|
|
344
|
+
|
|
345
|
+
##### `museManager.pm.deployPluginModal.footer.preProcessItems`
|
|
346
|
+
##### `museManager.pm.deployPluginModal.footer.getItems`
|
|
347
|
+
##### `museManager.pm.deployPluginModal.footer.processItems`
|
|
348
|
+
##### `museManager.pm.deployPluginModal.footer.postProcessItems`
|
|
349
|
+
|
|
350
|
+
- **Purpose**: Customize deploy modal footer buttons
|
|
351
|
+
- **When Invoked**: During modal footer rendering
|
|
352
|
+
- **Context Parameters**: `items`, plus full extArgs context
|
|
353
|
+
- **Expected Return**: Footer items or void
|
|
354
|
+
- **Use Case Example**: Add "Deploy & Validate" or "Schedule Deployment" buttons
|
|
355
|
+
- **File Reference**: src/features/pm/DeployPluginModal.jsx:181
|
|
356
|
+
|
|
357
|
+
##### `museManager.pm.undeployPluginModal.form.getWatchingFields`
|
|
358
|
+
##### `museManager.pm.undeployPluginModal.form.getFields`
|
|
359
|
+
##### `museManager.pm.undeployPluginModal.form.preProcessMeta`
|
|
360
|
+
##### `museManager.pm.undeployPluginModal.form.processMeta`
|
|
361
|
+
##### `museManager.pm.undeployPluginModal.form.postProcessMeta`
|
|
362
|
+
|
|
363
|
+
- **Purpose**: Extend undeploy plugin form
|
|
364
|
+
- **When Invoked**: During undeploy modal rendering
|
|
365
|
+
- **Context Parameters**: Similar to deployPluginModal
|
|
366
|
+
- **Expected Return**: Varies by method
|
|
367
|
+
- **Use Case Example**: Add cleanup options or rollback configurations
|
|
368
|
+
- **File Reference**: src/features/pm/UndeployPluginModal.jsx:146
|
|
369
|
+
|
|
370
|
+
##### `museManager.pm.undeployPluginModal.footer.preProcessItems`
|
|
371
|
+
##### `museManager.pm.undeployPluginModal.footer.getItems`
|
|
372
|
+
##### `museManager.pm.undeployPluginModal.footer.processItems`
|
|
373
|
+
##### `museManager.pm.undeployPluginModal.footer.postProcessItems`
|
|
374
|
+
|
|
375
|
+
- **Purpose**: Customize undeploy modal footer
|
|
376
|
+
- **When Invoked**: During footer rendering
|
|
377
|
+
- **Context Parameters**: `items` plus extArgs
|
|
378
|
+
- **Expected Return**: Footer items or void
|
|
379
|
+
- **File Reference**: src/features/pm/UndeployPluginModal.jsx:175
|
|
380
|
+
|
|
381
|
+
##### `museManager.pm.groupDeployModal.form.getWatchingFields`
|
|
382
|
+
##### `museManager.pm.groupDeployModal.form.getFields`
|
|
383
|
+
##### `museManager.pm.groupDeployModal.form.preProcessMeta`
|
|
384
|
+
##### `museManager.pm.groupDeployModal.form.processMeta`
|
|
385
|
+
##### `museManager.pm.groupDeployModal.form.postProcessMeta`
|
|
386
|
+
|
|
387
|
+
- **Purpose**: Extend group deployment form (deploy/undeploy multiple plugins at once)
|
|
388
|
+
- **When Invoked**: During group deploy modal rendering
|
|
389
|
+
- **Context Parameters**: `meta`, `ability`, `form`, `app`, plus state management functions
|
|
390
|
+
- **Expected Return**: Varies by method
|
|
391
|
+
- **Use Case Example**: Add deployment strategies like "sequential" vs "parallel"
|
|
392
|
+
- **File Reference**: src/features/pm/GroupDeployModal.jsx:184
|
|
393
|
+
|
|
394
|
+
##### `museManager.pm.groupDeployModal.footer.preProcessItems`
|
|
395
|
+
##### `museManager.pm.groupDeployModal.footer.getItems`
|
|
396
|
+
##### `museManager.pm.groupDeployModal.footer.processItems`
|
|
397
|
+
##### `museManager.pm.groupDeployModal.footer.postProcessItems`
|
|
398
|
+
|
|
399
|
+
- **Purpose**: Customize group deploy modal footer
|
|
400
|
+
- **When Invoked**: During footer rendering
|
|
401
|
+
- **Context Parameters**: `items` plus extArgs
|
|
402
|
+
- **Expected Return**: Footer items or void
|
|
403
|
+
- **File Reference**: src/features/pm/GroupDeployModal.jsx:231
|
|
404
|
+
|
|
405
|
+
##### `museManager.pm.pluginConfigForm.getWatchingFields`
|
|
406
|
+
##### `museManager.pm.pluginConfigForm.getFields`
|
|
407
|
+
##### `museManager.pm.pluginConfigForm.preProcessMeta`
|
|
408
|
+
##### `museManager.pm.pluginConfigForm.processMeta`
|
|
409
|
+
##### `museManager.pm.pluginConfigForm.postProcessMeta`
|
|
410
|
+
##### `museManager.pm.pluginConfigForm.processPayload`
|
|
411
|
+
|
|
412
|
+
- **Purpose**: Extend plugin configuration form (app-level plugin settings)
|
|
413
|
+
- **When Invoked**: During plugin config modal rendering
|
|
414
|
+
- **Context Parameters**: `meta`, `form`, `app`, `plugin`
|
|
415
|
+
- **Expected Return**: Varies by method
|
|
416
|
+
- **Use Case Example**: Add plugin-specific config fields like feature flags or API keys
|
|
417
|
+
- **File Reference**: src/features/pm/PluginConfigModal.jsx:66
|
|
418
|
+
|
|
419
|
+
##### `museManager.pm.createPluginModal.form.getWatchingFields`
|
|
420
|
+
##### `museManager.pm.createPluginModal.form.getFields`
|
|
421
|
+
##### `museManager.pm.createPluginModal.form.preProcessMeta`
|
|
422
|
+
##### `museManager.pm.createPluginModal.form.processMeta`
|
|
423
|
+
##### `museManager.pm.createPluginModal.form.postProcessMeta`
|
|
424
|
+
|
|
425
|
+
- **Purpose**: Extend create plugin form
|
|
426
|
+
- **When Invoked**: During create plugin modal rendering
|
|
427
|
+
- **Context Parameters**: `meta`, `form`
|
|
428
|
+
- **Expected Return**: Varies by method
|
|
429
|
+
- **Use Case Example**: Add fields for repository template, initial version, or build configuration
|
|
430
|
+
- **File Reference**: src/features/pm/CreatePluginModal.jsx:115
|
|
431
|
+
|
|
432
|
+
##### `museManager.pm.pluginStatus.relatedToPlugin`
|
|
433
|
+
|
|
434
|
+
- **Purpose**: Determine if a request is related to a specific plugin
|
|
435
|
+
- **When Invoked**: During plugin status check
|
|
436
|
+
- **Context Parameters**: `plugin`, `app`, `request`
|
|
437
|
+
- **Expected Return**: `boolean | void` - True if request relates to this plugin
|
|
438
|
+
- **Use Case Example**: Filter custom request types related to plugin operations
|
|
439
|
+
- **File Reference**: Via src/features/pm/PluginStatus.jsx
|
|
440
|
+
|
|
441
|
+
##### `museManager.pm.pluginStatus.processRequest`
|
|
442
|
+
|
|
443
|
+
- **Purpose**: Process/transform request data for plugin status display
|
|
444
|
+
- **When Invoked**: During plugin status rendering
|
|
445
|
+
- **Context Parameters**: `request`, `app`, `plugin`
|
|
446
|
+
- **Expected Return**: `void` - Mutates request object
|
|
447
|
+
- **Use Case Example**: Add custom status messages or progress indicators
|
|
448
|
+
- **File Reference**: src/features/pm/PluginStatus.jsx:46
|
|
449
|
+
|
|
450
|
+
#### Request Management Extensions
|
|
451
|
+
|
|
452
|
+
##### `museManager.req.requestDetailModal.processModalProps`
|
|
453
|
+
|
|
454
|
+
- **Purpose**: Customize request detail modal properties
|
|
455
|
+
- **When Invoked**: Before modal renders
|
|
456
|
+
- **Context Parameters**: Modal props object
|
|
457
|
+
- **Expected Return**: `void` - Mutates props
|
|
458
|
+
- **Use Case Example**: Adjust modal width or behavior based on request type
|
|
459
|
+
- **File Reference**: src/features/req/RequestDetailModal.jsx:215
|
|
460
|
+
|
|
461
|
+
##### `museManager.req.requestDetailModal.form.getWatchingFields`
|
|
462
|
+
##### `museManager.req.requestDetailModal.form.getFields`
|
|
463
|
+
##### `museManager.req.requestDetailModal.form.preProcessMeta`
|
|
464
|
+
##### `museManager.req.requestDetailModal.form.processMeta`
|
|
465
|
+
##### `museManager.req.requestDetailModal.form.postProcessMeta`
|
|
466
|
+
##### `museManager.req.requestDetailModal.body.preProcessItems`
|
|
467
|
+
##### `museManager.req.requestDetailModal.body.getItems`
|
|
468
|
+
##### `museManager.req.requestDetailModal.body.processItems`
|
|
469
|
+
##### `museManager.req.requestDetailModal.body.postProcessItems`
|
|
470
|
+
##### `museManager.req.requestDetailModal.footer.preProcessItems`
|
|
471
|
+
##### `museManager.req.requestDetailModal.footer.getItems`
|
|
472
|
+
##### `museManager.req.requestDetailModal.footer.processItems`
|
|
473
|
+
##### `museManager.req.requestDetailModal.footer.postProcessItems`
|
|
474
|
+
|
|
475
|
+
- **Purpose**: Extend request detail modal form, body, and footer
|
|
476
|
+
- **When Invoked**: During request modal rendering
|
|
477
|
+
- **Context Parameters**: Varies by section
|
|
478
|
+
- **Expected Return**: Varies by method
|
|
479
|
+
- **Use Case Example**: Add custom request fields, logs, or action buttons
|
|
480
|
+
- **File Reference**: Via src/features/req/RequestDetailModal.jsx
|
|
481
|
+
|
|
482
|
+
#### App Page Extensions
|
|
483
|
+
|
|
484
|
+
##### `museManager.appPage.getTabs`
|
|
485
|
+
|
|
486
|
+
- **Purpose**: Add custom tabs to app detail page
|
|
487
|
+
- **When Invoked**: During app page rendering
|
|
488
|
+
- **Context Parameters**: `tabs`, `app`
|
|
489
|
+
- **Expected Return**: `TabsProps['items']` - Tab item definitions
|
|
490
|
+
- **Use Case Example**: Add "Analytics", "Logs", or "Settings" tabs
|
|
491
|
+
- **File Reference**: src/features/am/AppPage.jsx:39
|
|
492
|
+
|
|
493
|
+
#### List Bar Extensions
|
|
494
|
+
|
|
495
|
+
##### `museManager.pluginListBar.getScopes`
|
|
496
|
+
|
|
497
|
+
- **Purpose**: Add scope filters to plugin list bar (e.g., "all", "deployed", custom)
|
|
498
|
+
- **When Invoked**: During plugin list bar rendering
|
|
499
|
+
- **Context Parameters**: `setScope`, `scope`
|
|
500
|
+
- **Expected Return**: `ScopeType | ScopeType[]` - Scope definitions
|
|
501
|
+
- **Use Case Example**: Add "My Plugins" or "Team Plugins" scope
|
|
502
|
+
- **File Reference**: src/features/pm/PluginListBar.jsx:59
|
|
503
|
+
|
|
504
|
+
##### `museManager.appListBar.getScopes`
|
|
505
|
+
##### `museManager.appListBar.getDropdownItems`
|
|
506
|
+
##### `museManager.appListBar.processDropdownItems`
|
|
507
|
+
|
|
508
|
+
- **Purpose**: Customize app list bar scopes and dropdown menu
|
|
509
|
+
- **When Invoked**: During app list bar rendering
|
|
510
|
+
- **Context Parameters**: Varies
|
|
511
|
+
- **Expected Return**: Scopes or dropdown items
|
|
512
|
+
- **Use Case Example**: Add bulk operations or export functionality
|
|
513
|
+
- **File Reference**: src/features/am/AppListBar.jsx
|
|
514
|
+
|
|
515
|
+
#### Environment Forms
|
|
516
|
+
|
|
517
|
+
##### `museManager.addEnvForm.getWatchingFields`
|
|
518
|
+
##### `museManager.addEnvForm.getFields`
|
|
519
|
+
##### `museManager.addEnvForm.preProcessMeta`
|
|
520
|
+
##### `museManager.addEnvForm.processMeta`
|
|
521
|
+
##### `museManager.addEnvForm.postProcessMeta`
|
|
522
|
+
##### `museManager.editEnvForm.getWatchingFields`
|
|
523
|
+
##### `museManager.editEnvForm.getFields`
|
|
524
|
+
##### `museManager.editEnvForm.preProcessMeta`
|
|
525
|
+
##### `museManager.editEnvForm.processMeta`
|
|
526
|
+
##### `museManager.editEnvForm.postProcessMeta`
|
|
527
|
+
|
|
528
|
+
- **Purpose**: Extend add/edit environment forms
|
|
529
|
+
- **When Invoked**: During environment modal rendering
|
|
530
|
+
- **Context Parameters**: Form metadata and context
|
|
531
|
+
- **Expected Return**: Varies by method
|
|
532
|
+
- **Use Case Example**: Add environment-specific config like CDN URLs or API endpoints
|
|
533
|
+
- **File Reference**: Via src/features/am/AddEnvironmentModal.jsx, EditEnvironmentModal.jsx
|
|
534
|
+
|
|
535
|
+
#### Configuration Extension
|
|
536
|
+
|
|
537
|
+
##### `museManager.setConfig`
|
|
538
|
+
|
|
539
|
+
- **Purpose**: Set/override muse-manager configuration
|
|
540
|
+
- **When Invoked**: During plugin initialization
|
|
541
|
+
- **Context Parameters**: Config setter function
|
|
542
|
+
- **Expected Return**: `void`
|
|
543
|
+
- **Use Case Example**: Customize default page sizes, API endpoints, or UI behavior
|
|
544
|
+
- **File Reference**: src/config.js:13
|
|
545
|
+
|
|
546
|
+
### Usage Example
|
|
547
|
+
|
|
548
|
+
**CRITICAL**: Extension points are **nested object properties**, NOT string paths!
|
|
549
|
+
|
|
550
|
+
```javascript
|
|
551
|
+
// ✅ CORRECT - nested object properties
|
|
552
|
+
plugin.register({
|
|
553
|
+
name: 'my-custom-plugin',
|
|
554
|
+
museManager: {
|
|
555
|
+
pm: {
|
|
556
|
+
pluginList: {
|
|
557
|
+
getColumns: (context) => {
|
|
558
|
+
// Add custom column
|
|
559
|
+
return {
|
|
560
|
+
dataIndex: 'myCustomField',
|
|
561
|
+
title: 'Custom Data',
|
|
562
|
+
order: 85,
|
|
563
|
+
render: (val, plugin) => plugin.myCustomField
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
// ❌ INCORRECT - DO NOT use string paths
|
|
572
|
+
plugin.register({
|
|
573
|
+
name: 'my-custom-plugin',
|
|
574
|
+
'museManager.pm.pluginList.getColumns': (context) => { // WRONG!
|
|
575
|
+
// This will NOT work!
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
---
|
|
581
|
+
|
|
582
|
+
## 3. Extension Points Contributed
|
|
583
|
+
|
|
584
|
+
This plugin implements the following extension points from OTHER plugins to integrate with the MUSE ecosystem.
|
|
585
|
+
|
|
586
|
+
### Summary
|
|
587
|
+
|
|
588
|
+
- **Total Contributions**: 6
|
|
589
|
+
- **Host Plugins**: @ebay/muse-lib-react, @ebay/muse-layout-antd
|
|
590
|
+
|
|
591
|
+
### By Host Plugin
|
|
592
|
+
|
|
593
|
+
#### Contributes to: @ebay/muse-lib-react
|
|
594
|
+
|
|
595
|
+
##### `route`
|
|
596
|
+
|
|
597
|
+
- **Invoked By**: @ebay/muse-lib-react routing system
|
|
598
|
+
- **What This Plugin Provides**: Three routes:
|
|
599
|
+
- `/plugins` - Plugin list page
|
|
600
|
+
- `/apps` - Application list page
|
|
601
|
+
- `/app/:appName/:tabKey?/:scope?` - App detail page with optional tab and scope
|
|
602
|
+
- **Why Needed**: Integrates muse-manager pages into the MUSE application router
|
|
603
|
+
- **File Reference**: src/route.js:4-18
|
|
604
|
+
|
|
605
|
+
##### `rootComponent`
|
|
606
|
+
|
|
607
|
+
- **Invoked By**: @ebay/muse-lib-react plugin initialization system
|
|
608
|
+
- **What This Plugin Provides**: `InitAbilityComp` component that initializes the CASL ability object for access control
|
|
609
|
+
- **Why Needed**: Sets up permission system before any muse-manager components render
|
|
610
|
+
- **File Reference**: src/index.js:17-20, src/index.js:29
|
|
611
|
+
|
|
612
|
+
#### Contributes to: @ebay/muse-layout-antd
|
|
613
|
+
|
|
614
|
+
##### `museLayout.header.getConfig`
|
|
615
|
+
|
|
616
|
+
- **Invoked By**: @ebay/muse-layout-antd header component
|
|
617
|
+
- **What This Plugin Provides**: Header configuration:
|
|
618
|
+
- Black background (#000000)
|
|
619
|
+
- Title: "Muse Managers"
|
|
620
|
+
- Subtitle: "Muse app and plugin manager"
|
|
621
|
+
- Theme switcher enabled
|
|
622
|
+
- **Why Needed**: Configures the application header appearance
|
|
623
|
+
- **File Reference**: src/ext/museLayout.js:4-11
|
|
624
|
+
|
|
625
|
+
##### `museLayout.header.getItems`
|
|
626
|
+
|
|
627
|
+
- **Invoked By**: @ebay/muse-layout-antd header items collection
|
|
628
|
+
- **What This Plugin Provides**: Header menu items:
|
|
629
|
+
- "+ Create" dropdown menu with "Create App" and "Create Plugin" options
|
|
630
|
+
- **Why Needed**: Provides quick access to app/plugin creation from header
|
|
631
|
+
- **File Reference**: src/ext/museLayout.js:13-43
|
|
632
|
+
|
|
633
|
+
##### `museLayout.sider.getConfig`
|
|
634
|
+
|
|
635
|
+
- **Invoked By**: @ebay/muse-layout-antd sidebar component
|
|
636
|
+
- **What This Plugin Provides**: Sidebar configuration:
|
|
637
|
+
- Mode: `collapsable` (or `none` if running as sub-app)
|
|
638
|
+
- Default collapsed: true
|
|
639
|
+
- Home menu: enabled
|
|
640
|
+
- Width: 200px
|
|
641
|
+
- **Why Needed**: Configures sidebar behavior and appearance
|
|
642
|
+
- **File Reference**: src/ext/museLayout.js:47-53
|
|
643
|
+
|
|
644
|
+
##### `museLayout.sider.getItems`
|
|
645
|
+
|
|
646
|
+
- **Invoked By**: @ebay/muse-layout-antd sidebar menu
|
|
647
|
+
- **What This Plugin Provides**: Sidebar menu items:
|
|
648
|
+
- "Apps" menu item (link to /apps)
|
|
649
|
+
- "Plugins" menu item (link to /plugins)
|
|
650
|
+
- **Why Needed**: Provides main navigation menu for muse-manager
|
|
651
|
+
- **File Reference**: src/ext/museLayout.js:55-70
|
|
652
|
+
|
|
653
|
+
---
|
|
654
|
+
|
|
655
|
+
## 4. Exported Functionality
|
|
656
|
+
|
|
657
|
+
This plugin exports the following functionality for use by other plugins.
|
|
658
|
+
|
|
659
|
+
**Access via**: `plugin.getPlugin('@ebay/muse-manager').exports`
|
|
660
|
+
|
|
661
|
+
### Hooks
|
|
662
|
+
|
|
663
|
+
- **`useAbility`**: Returns the CASL ability object for permission checks. Use this to check if the current user can perform actions like create/edit/delete apps or plugins. Returns: `Ability` object with `can()` and `cannot()` methods.
|
|
664
|
+
|
|
665
|
+
- **`useSyncStatus`**: Hook to manually trigger data refresh for a specific data key. Takes a data key (e.g., 'muse.apps', 'muse.plugins') and returns a function to trigger sync. Useful after mutations to refresh cached data.
|
|
666
|
+
|
|
667
|
+
- **`useSearchState`**: Manages search state synchronized with URL query parameters. Returns search state and setter function. Use when building searchable UI components.
|
|
668
|
+
|
|
669
|
+
- **`useEnvFilter`**: Hook for environment filtering logic in plugin lists. Returns `{ getEnvFilterConfig, envFilterMap }` with filter configuration and current filter state. Use for building custom environment filter UI.
|
|
670
|
+
|
|
671
|
+
- **`useValidateDeployment`**: Hook that validates plugin deployments (checks shared module compatibility). Returns `{ validateDeployment, validateDeploymentError, validateDeploymentPending }`. Use before deploying plugins to ensure module compatibility.
|
|
672
|
+
|
|
673
|
+
- **`usePendingError`**: Combines multiple loading and error states into single pending/error state. Takes arrays of pending states and errors, returns unified `{ pending, error, setPending, setError }`. Useful for forms with multiple async operations.
|
|
674
|
+
|
|
675
|
+
- **`useExtPoint`**: Hook to consume extension points in React components. Takes extension point name and args, returns array of contributed components. Use when building extensible UI components.
|
|
676
|
+
|
|
677
|
+
- **`useMuseData`**: (from museHooks) React Query hook for fetching MUSE data. Takes data key (e.g., 'muse.apps'), returns `{ data, isLoading, error }`. Auto-polling support.
|
|
678
|
+
|
|
679
|
+
- **`usePollingMuseData`**: (from museHooks) Similar to useMuseData but with auto-polling enabled. Use for data that needs real-time updates like deployment status.
|
|
680
|
+
|
|
681
|
+
- **`useMuseMutation`**: (from museHooks) React Query mutation hook for MUSE API operations. Takes mutation key (e.g., 'am.createApp'), returns `{ mutateAsync, error, isLoading }`. Use for write operations.
|
|
682
|
+
|
|
683
|
+
### Components (from common features)
|
|
684
|
+
|
|
685
|
+
Components are exported via the `common` export object.
|
|
686
|
+
|
|
687
|
+
### PM (Plugin Management) Exports
|
|
688
|
+
|
|
689
|
+
- **`VersionSelect`**: Version selector component for plugin releases. Use in forms that need version selection.
|
|
690
|
+
|
|
691
|
+
- **`PluginReleaseSelect`**: Plugin release selector with version dropdown. Props: `{ plugin, app }`. Use in deployment forms.
|
|
692
|
+
|
|
693
|
+
- **`EnvFilterMenu`**: Environment filter menu component with version diff indicators. Use for building custom plugin list filters.
|
|
694
|
+
|
|
695
|
+
- **`LightOnIcon`**: Icon component for UI decoration. Use in info messages or alerts.
|
|
696
|
+
|
|
697
|
+
- **`MultiPluginSelector`**: Component for selecting multiple plugins with version. Props: `{ app }`. Use in group deployment forms.
|
|
698
|
+
|
|
699
|
+
- **`GroupDeployModal`**: Modal component for deploying/undeploying multiple plugins. Props: `{ app }`. Use via NiceModal.show().
|
|
700
|
+
|
|
701
|
+
- **`PluginStatus`**: Component showing real-time plugin deployment status. Props: `{ plugin, app }`. Use to display ongoing deployment operations.
|
|
702
|
+
|
|
703
|
+
- **`PluginBadges`**: Component rendering plugin badges/tags. Props: `{ app, plugin }`. Use to display plugin status indicators.
|
|
704
|
+
|
|
705
|
+
### Utils
|
|
706
|
+
|
|
707
|
+
- **`getPluginId`**: Converts scoped package names to ID format (e.g., `@ebay/foo` → `ebay.foo`). Use when working with plugin identifiers.
|
|
708
|
+
|
|
709
|
+
- **`versionDiff`**: Calculates semantic version difference between two versions. Returns: `'major' | 'minor' | 'patch' | 'null'`. Use for version comparison logic.
|
|
710
|
+
|
|
711
|
+
### Other Exports
|
|
712
|
+
|
|
713
|
+
- **`ability`**: The global CASL ability object for permission checking. Direct access to the ability singleton. Prefer using `useAbility()` hook in React components.
|
|
714
|
+
|
|
715
|
+
- **`museClient`**: Configured axios client for MUSE API v2. Pre-configured with authentication, timeout, and base URL. Use for custom API calls not covered by museHooks.
|
|
716
|
+
|
|
717
|
+
### Using Exported Functionality
|
|
718
|
+
|
|
719
|
+
```javascript
|
|
720
|
+
// Accessing exports from muse-manager
|
|
721
|
+
const museManager = plugin.getPlugin('@ebay/muse-manager');
|
|
722
|
+
if (!museManager) {
|
|
723
|
+
console.warn('@ebay/muse-manager plugin not found');
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const { hooks, pm, utils, ability, museClient } = museManager.exports;
|
|
728
|
+
|
|
729
|
+
// Using a hook in React component
|
|
730
|
+
const { useAbility } = hooks;
|
|
731
|
+
function MyComponent({ app }) {
|
|
732
|
+
const ability = useAbility();
|
|
733
|
+
const canEdit = ability.can('update', 'App', app);
|
|
734
|
+
return canEdit ? <EditButton /> : null;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// Using a component
|
|
738
|
+
const { PluginStatus } = pm;
|
|
739
|
+
<PluginStatus plugin={myPlugin} app={myApp} />
|
|
740
|
+
|
|
741
|
+
// Using a utility
|
|
742
|
+
const { versionDiff } = utils;
|
|
743
|
+
const diff = versionDiff('2.0.0', '1.5.3'); // Returns 'major'
|
|
744
|
+
|
|
745
|
+
// Using museClient for custom API calls
|
|
746
|
+
const { data } = await museClient.get('/api/v2/custom-endpoint');
|
|
747
|
+
```
|
|
748
|
+
|
|
749
|
+
**Note**: Exports create tight coupling between plugins. Prefer using extension points for loose coupling when possible. Use exports when you need to reuse complex components, hooks, or utilities across plugins.
|
|
750
|
+
|
|
751
|
+
---
|
|
752
|
+
|
|
753
|
+
## 5. Integration Examples
|
|
754
|
+
|
|
755
|
+
### Example 1: Adding a Custom Column to Plugin List (CORRECT Syntax)
|
|
756
|
+
|
|
757
|
+
```javascript
|
|
758
|
+
plugin.register({
|
|
759
|
+
name: 'my-monitoring-plugin',
|
|
760
|
+
museManager: {
|
|
761
|
+
pm: {
|
|
762
|
+
pluginList: {
|
|
763
|
+
getColumns: ({ app, plugins }) => {
|
|
764
|
+
return {
|
|
765
|
+
dataIndex: 'healthScore',
|
|
766
|
+
title: 'Health',
|
|
767
|
+
order: 55,
|
|
768
|
+
width: 100,
|
|
769
|
+
render: (_, plugin) => {
|
|
770
|
+
const score = calculateHealthScore(plugin);
|
|
771
|
+
return <Tag color={score > 80 ? 'green' : 'orange'}>{score}</Tag>;
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
### Example 2: Adding Custom App Page Tab
|
|
782
|
+
|
|
783
|
+
```javascript
|
|
784
|
+
plugin.register({
|
|
785
|
+
name: 'my-analytics-plugin',
|
|
786
|
+
museManager: {
|
|
787
|
+
appPage: {
|
|
788
|
+
getTabs: ({ app }) => {
|
|
789
|
+
return {
|
|
790
|
+
key: 'analytics',
|
|
791
|
+
label: 'Analytics',
|
|
792
|
+
order: 50,
|
|
793
|
+
children: <MyAnalyticsDashboard app={app} />
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
### Example 3: Extending Create Plugin Form
|
|
802
|
+
|
|
803
|
+
```javascript
|
|
804
|
+
plugin.register({
|
|
805
|
+
name: 'my-ci-cd-plugin',
|
|
806
|
+
museManager: {
|
|
807
|
+
pm: {
|
|
808
|
+
createPluginModal: {
|
|
809
|
+
form: {
|
|
810
|
+
getFields: () => {
|
|
811
|
+
return {
|
|
812
|
+
key: 'cicdPipeline',
|
|
813
|
+
label: 'CI/CD Pipeline',
|
|
814
|
+
order: 25,
|
|
815
|
+
widget: 'select',
|
|
816
|
+
options: ['GitHub Actions', 'Jenkins', 'GitLab CI'],
|
|
817
|
+
tooltip: 'Select the CI/CD system for this plugin'
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
### Example 4: Using Exported Hooks
|
|
828
|
+
|
|
829
|
+
```javascript
|
|
830
|
+
// In your plugin's component
|
|
831
|
+
import plugin from 'js-plugin';
|
|
832
|
+
|
|
833
|
+
function MyCustomComponent({ app, plugin }) {
|
|
834
|
+
const museManager = plugin.getPlugin('@ebay/muse-manager');
|
|
835
|
+
const { useAbility, useMuseData } = museManager.exports.hooks;
|
|
836
|
+
|
|
837
|
+
const ability = useAbility();
|
|
838
|
+
const { data: releases } = useMuseData(`muse.plugin-releases.${plugin.name}`);
|
|
839
|
+
|
|
840
|
+
const canDeploy = ability.can('deploy', 'App', app);
|
|
841
|
+
|
|
842
|
+
return (
|
|
843
|
+
<div>
|
|
844
|
+
<h3>Latest: {releases?.[0]?.version}</h3>
|
|
845
|
+
{canDeploy && <DeployButton />}
|
|
846
|
+
</div>
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
```
|