WIP plugins: add theme support
This commit is contained in:
parent
8d76959e11
commit
7cd4d2ba10
34 changed files with 311 additions and 38 deletions
|
@ -4,6 +4,7 @@ import { PluginType } from '../../../shared/models/plugins/plugin.type'
|
|||
import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
|
||||
import { PluginPackageJson } from '../../../shared/models/plugins/plugin-package-json.model'
|
||||
import { isUrlValid } from './activitypub/misc'
|
||||
import { isThemeRegistered } from '../../lib/plugins/theme-utils'
|
||||
|
||||
const PLUGINS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.PLUGINS
|
||||
|
||||
|
@ -61,6 +62,10 @@ function isCSSPathsValid (css: any[]) {
|
|||
return isArray(css) && css.every(c => isSafePath(c))
|
||||
}
|
||||
|
||||
function isThemeValid (name: string) {
|
||||
return isPluginNameValid(name) && isThemeRegistered(name)
|
||||
}
|
||||
|
||||
function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginType) {
|
||||
return isNpmPluginNameValid(packageJSON.name) &&
|
||||
isPluginDescriptionValid(packageJSON.description) &&
|
||||
|
@ -82,6 +87,7 @@ function isLibraryCodeValid (library: any) {
|
|||
export {
|
||||
isPluginTypeValid,
|
||||
isPackageJSONValid,
|
||||
isThemeValid,
|
||||
isPluginVersionValid,
|
||||
isPluginNameValid,
|
||||
isPluginDescriptionValid,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue