Skip to content
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

feat(plugins): plugins blacklist #592

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/plugins/core/plugins/blacklist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* This file contains plugins that have been blacklisted.
* The main purpose of this is to hide plugins that have been republished under our scope.
* The name must match (case sensitive) the name in the `package.json`.
*/
export default [
'cerebro-basic-apps' // @cerebroapp/cerebro-basic-apps
]
7 changes: 5 additions & 2 deletions app/plugins/core/plugins/loadPlugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import compareVersions from 'semver/functions/gt'
import availablePlugins from './getAvailablePlugins'
import getInstalledPlugins from './getInstalledPlugins'
import getDebuggingPlugins from './getDebuggingPlugins'
import blacklist from './blacklist'

const maxAge = 5 * 60 * 1000 // 5 minutes

Expand Down Expand Up @@ -50,9 +51,11 @@ export default async () => {
isDebugging: true
}))

return [
const plugins = [
...listOfInstalledPlugins,
...listOfAvailablePlugins,
...listOfDebuggingPlugins
]
].filter((plugin) => !blacklist.includes(plugin.name))

return plugins
}