From 99a29aceb19756c7355e5a5a41982501e9db3ec8 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 2 Nov 2023 13:30:01 -0700 Subject: [PATCH] fix(plugins): parse name issue with invalid plugins --- lib/services/plugins-service.ts | 41 +++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/lib/services/plugins-service.ts b/lib/services/plugins-service.ts index 46c45b23ec..05369fb666 100644 --- a/lib/services/plugins-service.ts +++ b/lib/services/plugins-service.ts @@ -623,25 +623,32 @@ This framework comes from ${dependencyName} plugin, which is installed multiple cacheData: IDependencyData | INodeModuleData, projectDir: string ): IPluginData { - const pluginData: any = {}; - pluginData.name = cacheData.name; - pluginData.version = cacheData.version; - pluginData.fullPath = - (cacheData).directory || - path.dirname( - this.getPackageJsonFilePathForModule(cacheData.name, projectDir) + try { + const pluginData: any = {}; + pluginData.name = cacheData.name; + pluginData.version = cacheData.version; + pluginData.fullPath = + (cacheData).directory || + path.dirname( + this.getPackageJsonFilePathForModule(cacheData.name, projectDir) + ); + pluginData.isPlugin = !!cacheData.nativescript; + pluginData.pluginPlatformsFolderPath = (platform: string) => + path.join(pluginData.fullPath, "platforms", platform.toLowerCase()); + const data = cacheData.nativescript; + + if (pluginData.isPlugin) { + pluginData.platformsData = data.platforms; + pluginData.pluginVariables = data.variables; + } + } catch (err) { + this.$logger.trace( + "NOTE: There appears to be a problem with this dependency:", + cacheData.name ); - pluginData.isPlugin = !!cacheData.nativescript; - pluginData.pluginPlatformsFolderPath = (platform: string) => - path.join(pluginData.fullPath, "platforms", platform.toLowerCase()); - const data = cacheData.nativescript; - - if (pluginData.isPlugin) { - pluginData.platformsData = data.platforms; - pluginData.pluginVariables = data.variables; + this.$logger.trace(err); + return null; } - - return pluginData; } private removeDependencyFromPackageJsonContent( pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy