Skip to content

Commit

Permalink
feat(plugins): added plugin blacklist (#592)
Browse files Browse the repository at this point in the history
fix #588
dubisdev authored Sep 9, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8293442 commit 8ffdb76
Showing 2 changed files with 13 additions and 2 deletions.
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
@@ -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

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

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

return plugins
}

0 comments on commit 8ffdb76

Please sign in to comment.