@ -1,12 +1,12 @@
|
||||
export const METADATA_KEY = {
|
||||
plugin: "@ms/plugin:plugin",
|
||||
cmd: "@ms/plugin:cmd",
|
||||
tab: "@ms/plugin:tab",
|
||||
listener: "@ms/plugin:listener",
|
||||
config: "@ms/plugin:config",
|
||||
plugin: "@ccms/plugin:plugin",
|
||||
cmd: "@ccms/plugin:cmd",
|
||||
tab: "@ccms/plugin:tab",
|
||||
listener: "@ccms/plugin:listener",
|
||||
config: "@ccms/plugin:config",
|
||||
stage: {
|
||||
load: "@ms/plugin:stage:load",
|
||||
enable: "@ms/plugin:stage:enable",
|
||||
disable: "@ms/plugin:stage:disable"
|
||||
load: "@ccms/plugin:stage:load",
|
||||
enable: "@ccms/plugin:stage:enable",
|
||||
disable: "@ccms/plugin:stage:disable"
|
||||
}
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { injectable, decorate } from "@ms/container";
|
||||
import { injectable, decorate } from "@ccms/container";
|
||||
import { interfaces } from './interfaces'
|
||||
import { METADATA_KEY } from './constants'
|
||||
import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { server, MiaoScriptConsole, event } from "@ms/api";
|
||||
import { server, MiaoScriptConsole, event } from "@ccms/api";
|
||||
import { METADATA_KEY } from './constants'
|
||||
import { injectable, inject, postConstruct } from "@ms/container";
|
||||
import { injectable, inject, postConstruct } from "@ccms/container";
|
||||
import { getPluginMetadata } from "./utils";
|
||||
|
||||
export namespace interfaces {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import i18n from '@ms/i18n'
|
||||
import { plugin, server, command, event } from '@ms/api'
|
||||
import { inject, provideSingleton, Container, ContainerInstance } from '@ms/container'
|
||||
import * as fs from '@ms/common/dist/fs'
|
||||
import i18n from '@ccms/i18n'
|
||||
import { plugin, server, command, event } from '@ccms/api'
|
||||
import { inject, provideSingleton, Container, ContainerInstance } from '@ccms/container'
|
||||
import * as fs from '@ccms/common/dist/fs'
|
||||
|
||||
import { getPluginMetadatas, getPluginCommandMetadata, getPluginListenerMetadata, getPlugin, getPluginTabCompleterMetadata, getPluginConfigMetadata, getPluginStageMetadata } from './utils'
|
||||
import { interfaces } from './interfaces'
|
||||
@ -54,6 +54,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
|
||||
|
||||
private runPluginStage(plugin: interfaces.Plugin, stage: string, ext: Function) {
|
||||
this.logStage(plugin, i18n.translate(`ms.plugin.manager.stage.${stage}`))
|
||||
ext()
|
||||
this.runCatch(plugin, stage)
|
||||
this.runCatch(plugin, `${this.serverType}${stage}`)
|
||||
this.execPluginStage(plugin, stage)
|
||||
@ -178,7 +179,7 @@ export class PluginManagerImpl implements plugin.PluginManager {
|
||||
|
||||
private createPlugin(file: string) {
|
||||
//@ts-ignore
|
||||
require(file, { cache: false })
|
||||
require(file + '', { cache: false })
|
||||
}
|
||||
|
||||
private buildPlugins() {
|
||||
|
Reference in New Issue
Block a user