-
Notifications
You must be signed in to change notification settings - Fork 667
Allow overriding the active plugin list #1875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow overriding the active plugin list #1875
Conversation
| return appPackage ? pluginFilter(appPackage, pluginPackages) : []; | ||
|
|
||
| if (!appPackage) { | ||
| throw new Error(`Cannot detect Console application package ${consoleAppName}`); |
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.
Note: this check was added to reflect the expectation that Console (app) itself is a plugin, i.e. packages/console-app/src/plugin.tsx.
|
@alecmerdler @spadgett If you'd like, we can use a shorter form e.g. CONSOLE_PLUGINS=app,foo,bar yarn devinstead of CONSOLE_PLUGINS=@console/app,@console/foo,@console/bar yarn devsince all Console plugin pkg names are expected to use |
|
@vojtechszocs being explicit is fine. You could add support for both and if there's no scope you assume the |
Agreed, will do. |
|
Before: After: Nice! |
alecmerdler
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.
Thanks for adding this!
/lgtm
| (window as any).localStorage = (window as any).sessionStorage = { | ||
| setItem(key, value) { | ||
| return Object.assign(_localStorage, {[key]: value}); | ||
| Object.assign(_localStorage, { [key]: value} ); |
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 guess this does adhere to the real web API. But the existing way is what it should be (in a FP world).
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.
Yup, the web storage API could be better 😃 the above change just reflects the method signature in node_modules/typescript/lib/lib.dom.d.ts
setItem(key: string, value: string): void;|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alecmerdler, vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Follow-up to #1871 (un-merged)
This PR adds the ability to override the list of active Console plugins.
Active plugins are used
packages/console-app/src/__tests__/plugin-test-utils.tscreates a test registry from all active plugins (for "what's tested" vs. "what's built" consistency)webpack.config.tscreates a virtual@console/active-pluginsmodule that returns the list of all active plugins for use in Console (i.e. plugins to be included in the output bundle)plugin-stats.tsdynamically loads entry modules of all active plugins (executed as part of devel & prod builds)By default, plugins must be listed in
packages/console-app/package.jsonfile underdependencieskey in order to be considered active.With this PR, it's possible to override that via
CONSOLE_PLUGINSenv. variable:The
CONSOLE_PLUGINSoverride is consistently applied todev(webpack)build(webpack)test(Jest / extension checks)plugin-stats(ts-node)/cc @spadgett @alecmerdler @christianvogt