This commit is contained in:
Eugene Pankov
2020-03-01 16:10:45 +01:00
parent fda4d2dcef
commit 04a0a0cc64
81 changed files with 284 additions and 295 deletions

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { BehaviorSubject, Observable } from 'rxjs'
import { debounceTime, distinctUntilChanged, first, tap, flatMap, map } from 'rxjs/operators'
import semverGt from 'semver/functions/gt'

View File

@@ -40,7 +40,7 @@ export class PluginManagerService {
this.logger = log.create('pluginManager')
}
async getNPM () {
async getNPM (): Promise<any> {
if (!this.npm) {
if (!this.npmReady) {
this.npmReady = new Promise(resolve => {
@@ -83,7 +83,7 @@ export class PluginManagerService {
)
}
async installPlugin (plugin: PluginInfo) {
async installPlugin (plugin: PluginInfo): Promise<void> {
(await this.getNPM()).commands.install([`${plugin.packageName}@${plugin.version}`], err => {
if (err) {
this.logger.error(err)
@@ -93,7 +93,7 @@ export class PluginManagerService {
})
}
async uninstallPlugin (plugin: PluginInfo) {
async uninstallPlugin (plugin: PluginInfo): Promise<void> {
(await this.getNPM()).commands.remove([plugin.packageName], err => {
if (err) {
this.logger.error(err)