Relax plugin package.json validation

pull/2073/head
Chocobozzz 2019-08-22 09:41:49 +02:00
parent c9917782ea
commit d1c0a964a2
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 6 additions and 2 deletions

View File

@ -41,7 +41,11 @@ function isPluginEngineValid (engine: any) {
}
function isPluginHomepage (value: string) {
return isUrlValid(value)
return exists(value) && (!value || isUrlValid(value))
}
function isPluginBugs (value: string) {
return exists(value) && (!value || isUrlValid(value))
}
function areStaticDirectoriesValid (staticDirs: any) {
@ -85,7 +89,7 @@ function isPackageJSONValid (packageJSON: PluginPackageJson, pluginType: PluginT
isPluginEngineValid(packageJSON.engine) &&
isPluginHomepage(packageJSON.homepage) &&
exists(packageJSON.author) &&
isUrlValid(packageJSON.bugs) &&
isPluginBugs(packageJSON.bugs) &&
(pluginType === PluginType.THEME || isSafePath(packageJSON.library)) &&
areStaticDirectoriesValid(packageJSON.staticDirs) &&
areCSSPathsValid(packageJSON.css) &&