Fix issues with circular dependencies between plugins
This commit is contained in:
parent
62a6e59b7a
commit
e3b6b017a2
23 changed files with 36 additions and 29 deletions
14
backend/package-lock.json
generated
14
backend/package-lock.json
generated
|
@ -24,7 +24,7 @@
|
|||
"humanize-duration": "^3.15.0",
|
||||
"io-ts": "^2.0.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"knub": "^30.0.0-beta.40",
|
||||
"knub": "^30.0.0-beta.41",
|
||||
"knub-command-manager": "^9.1.0",
|
||||
"last-commit-log": "^2.1.0",
|
||||
"lodash.chunk": "^4.2.0",
|
||||
|
@ -3043,9 +3043,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/knub": {
|
||||
"version": "30.0.0-beta.40",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.40.tgz",
|
||||
"integrity": "sha512-oGuc2Q57Zpgr3iRqCo5dzZdinNsDr1uiJs3TB/4eQNCIaaLqD+a5HfwGbDBW11ix+zTCqbLUI8/4hjJIKpJT8g==",
|
||||
"version": "30.0.0-beta.41",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.41.tgz",
|
||||
"integrity": "sha512-tKHGG9vh62ZN0JIi2ULYHvJbR28WXhym8c9vRtyQCPQqJ1w3n7Fow9JXbh6BUTSD8QszWbvq1Ri22wbQtBEyNw==",
|
||||
"dependencies": {
|
||||
"discord-api-types": "^0.22.0",
|
||||
"discord.js": "^13.0.1",
|
||||
|
@ -8290,9 +8290,9 @@
|
|||
}
|
||||
},
|
||||
"knub": {
|
||||
"version": "30.0.0-beta.40",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.40.tgz",
|
||||
"integrity": "sha512-oGuc2Q57Zpgr3iRqCo5dzZdinNsDr1uiJs3TB/4eQNCIaaLqD+a5HfwGbDBW11ix+zTCqbLUI8/4hjJIKpJT8g==",
|
||||
"version": "30.0.0-beta.41",
|
||||
"resolved": "https://registry.npmjs.org/knub/-/knub-30.0.0-beta.41.tgz",
|
||||
"integrity": "sha512-tKHGG9vh62ZN0JIi2ULYHvJbR28WXhym8c9vRtyQCPQqJ1w3n7Fow9JXbh6BUTSD8QszWbvq1Ri22wbQtBEyNw==",
|
||||
"requires": {
|
||||
"discord-api-types": "^0.22.0",
|
||||
"discord.js": "^13.0.1",
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"humanize-duration": "^3.15.0",
|
||||
"io-ts": "^2.0.0",
|
||||
"js-yaml": "^3.13.1",
|
||||
"knub": "^30.0.0-beta.40",
|
||||
"knub": "^30.0.0-beta.41",
|
||||
"knub-command-manager": "^9.1.0",
|
||||
"last-commit-log": "^2.1.0",
|
||||
"lodash.chunk": "^4.2.0",
|
||||
|
|
|
@ -25,7 +25,7 @@ export const AutoDeletePlugin = zeppelinGuildPlugin<AutoDeletePluginType>()({
|
|||
configurationGuide: "Maximum deletion delay is currently 5 minutes",
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin, LogsPlugin],
|
||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ export const AutoReactionsPlugin = zeppelinGuildPlugin<AutoReactionsPluginType>(
|
|||
`),
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ export const AutomodPlugin = zeppelinGuildPlugin<AutomodPluginType>()({
|
|||
info: pluginInfo,
|
||||
|
||||
// prettier-ignore
|
||||
dependencies: [
|
||||
dependencies: () => [
|
||||
LogsPlugin,
|
||||
ModActionsPlugin,
|
||||
MutesPlugin,
|
||||
|
|
|
@ -18,6 +18,9 @@ import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
|
|||
import { CaseArgs, CaseNoteArgs, CasesPluginType, ConfigSchema } from "./types";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
|
||||
// Workaround for circular dependency
|
||||
const AnyTypedLogsPlugin = LogsPlugin as any;
|
||||
|
||||
const defaultOptions = {
|
||||
config: {
|
||||
log_automatic_actions: true,
|
||||
|
@ -39,7 +42,7 @@ export const CasesPlugin = zeppelinGuildPlugin<CasesPluginType>()({
|
|||
`),
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin, LogsPlugin],
|
||||
dependencies: () => [TimeAndDatePlugin, AnyTypedLogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ export const CensorPlugin = zeppelinGuildPlugin<CensorPluginType>()({
|
|||
legacy: true,
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ export const ChannelArchiverPlugin = zeppelinGuildPlugin<ChannelArchiverPluginTy
|
|||
name: "channel_archiver",
|
||||
showInDocs: false,
|
||||
|
||||
dependencies: [TimeAndDatePlugin],
|
||||
dependencies: () => [TimeAndDatePlugin],
|
||||
configSchema: t.type({}),
|
||||
|
||||
// prettier-ignore
|
||||
|
|
|
@ -24,7 +24,7 @@ export const CompanionChannelsPlugin = zeppelinGuildPlugin<CompanionChannelsPlug
|
|||
`),
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -52,5 +52,5 @@ export const ContextMenuPlugin = zeppelinGuildPlugin<ContextMenuPluginType>()({
|
|||
loadAllCommands(pluginData);
|
||||
},
|
||||
|
||||
dependencies: [MutesPlugin, LogsPlugin, UtilityPlugin],
|
||||
dependencies: () => [MutesPlugin, LogsPlugin, UtilityPlugin],
|
||||
});
|
||||
|
|
|
@ -108,6 +108,10 @@ import { logVoiceChannelLeave } from "./logFunctions/logVoiceChannelLeave";
|
|||
import { logVoiceChannelMove } from "./logFunctions/logVoiceChannelMove";
|
||||
import { logMemberTimedUnban } from "./logFunctions/logMemberTimedUnban";
|
||||
import { logDmFailed } from "./logFunctions/logDmFailed";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
|
||||
// Workaround for circular dependency
|
||||
const AnyTypedCasesPlugin = CasesPlugin as any;
|
||||
|
||||
const defaultOptions: PluginOptions<LogsPluginType> = {
|
||||
config: {
|
||||
|
@ -139,7 +143,7 @@ export const LogsPlugin = zeppelinGuildPlugin<LogsPluginType>()({
|
|||
prettyName: "Logs",
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin],
|
||||
dependencies: () => [TimeAndDatePlugin, AnyTypedCasesPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
|||
`),
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
||||
dependencies: () => [TimeAndDatePlugin, CasesPlugin, MutesPlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
|||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: [CasesPlugin, LogsPlugin],
|
||||
dependencies: () => [CasesPlugin, LogsPlugin],
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
|
|
@ -27,7 +27,7 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
|
|||
`),
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ export const PostPlugin = zeppelinGuildPlugin<PostPluginType>()({
|
|||
prettyName: "Post",
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin, LogsPlugin],
|
||||
dependencies: () => [TimeAndDatePlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
|
|||
prettyName: "Reaction roles",
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ export const RemindersPlugin = zeppelinGuildPlugin<RemindersPluginType>()({
|
|||
prettyName: "Reminders",
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin],
|
||||
dependencies: () => [TimeAndDatePlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ export const RolesPlugin = zeppelinGuildPlugin<RolesPluginType>()({
|
|||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
|
|
@ -42,7 +42,7 @@ export const SlowmodePlugin = zeppelinGuildPlugin<SlowmodePluginType>()({
|
|||
prettyName: "Slowmode",
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ export const SpamPlugin = zeppelinGuildPlugin<SpamPluginType>()({
|
|||
legacy: true,
|
||||
},
|
||||
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
|
|
@ -61,7 +61,7 @@ export const TagsPlugin = zeppelinGuildPlugin<TagsPluginType>()({
|
|||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
|
|
@ -119,7 +119,7 @@ export const UtilityPlugin = zeppelinGuildPlugin<UtilityPluginType>()({
|
|||
prettyName: "Utility",
|
||||
},
|
||||
|
||||
dependencies: [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
||||
dependencies: () => [TimeAndDatePlugin, ModActionsPlugin, LogsPlugin],
|
||||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ export const WelcomeMessagePlugin = zeppelinGuildPlugin<WelcomeMessagePluginType
|
|||
},
|
||||
|
||||
configSchema: ConfigSchema,
|
||||
dependencies: [LogsPlugin],
|
||||
dependencies: () => [LogsPlugin],
|
||||
defaultOptions,
|
||||
|
||||
// prettier-ignore
|
||||
|
|
Loading…
Add table
Reference in a new issue