-
Notifications
You must be signed in to change notification settings - Fork 374
feat: add extension management apis #3978
Conversation
| const { fetchPlugins } = useRecoilValue(dispatcherState); | ||
| useEffect(() => { | ||
| fetchPlugins(); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better place in the app to perform these client-side "on startup go and fetch some data" tasks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. This seems to be the right place. We could make an action like bootstrapApplication() or something that other initialization code can go.
| interface PublishAPI { | ||
| setConfigIsValid?: (valid: boolean) => void; | ||
| setPublishConfig?: (config: PublishConfig) => void; | ||
| useConfigBeingEdited?: (() => PublishConfig[]) | (() => void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could probably give this a better name
| iconName: p.icon ?? 'StatusCircleQuestionMark', | ||
| labelName: p.label, | ||
| exact: true, | ||
| disabled: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could possibly add some logic to the extension config here that says:
{
"views": {
"page": {
"label": "Sample UI Plugin",
...
"enabled": <some-condition>,
}
}
}
where <some-condition> could be something like "botProjectOpen" or another special Composer state that extensions can key off of.
Composer/packages/electron-server/src/utility/oauthImplicitFlowHelper.ts
Outdated
Show resolved
Hide resolved
| bundles: this.processBundles(pluginPath, packageJson.composer?.bundles ?? []), | ||
| contributes: packageJson.composer?.contributes, | ||
| }); | ||
| this.manifest.updateExtensionConfig(name, getExtensionMetadata(pluginPath, packageJson)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍 -- much cleaner
tonyanziano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚢
Composer/packages/extensions/plugin-loader/src/storage/extensionManifestStore.ts
Show resolved
Hide resolved
* Improved plugin infrastructure -- render custom UI * Aligned sample publish plugin with new publish api * client-plugin-lib improvements * Minor fixes for clarity and polish * Updated sample-ui-plugin package with docs * Removed logs * Updated sample-ui-plugin docs * Guarded against removing / disabling built-in plugins * Minor fixes * Linting * Comment update * More linting * Added licenses and removed a comment. * minor cleanup * hide plugins page in client * rename extension-manifest to just extensions * run npm commands in a safe manner * prettify extensions.json * make PluginManager a singleton * only spawn npm commands Co-authored-by: Andy Brown <[email protected]>
Description
This PR modifies the current Extension / Plugin infrastructure to add support for hosting custom extension UI in Composer.
/Composer/plugins/sample-ui-plugin/includes aREADME.mdwith instructions on how to author one of these extensions with custom UI, as well as how to enable the plugin so that a user can experiment with the sample.Task Item
refs #3991
refs #3997
Screenshots
Plugin management page (these are built-in / 1P plugins, so they can't be disabled or removed for now)
Sample of a page plugin
Sample of a publish plugin