From 01f716153e8d2e1865cc2402736c6aadb1247c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Rom=C3=A1n?= Date: Tue, 2 Feb 2021 14:27:35 +0100 Subject: [PATCH] feat(client): change stores from a Set to a Map (#129) This allows easy overriding of stores in plugins/user-code. BREAKING CHANGE: `client.arguments` is now `client.stores.get('arguments')` BREAKING CHANGE: `client.commands` is now `client.stores.get('commands')` BREAKING CHANGE: `client.events` is now `client.stores.get('events')` BREAKING CHANGE: `client.preconditions` is now `client.stores.get('preconditions')` BREAKING CHANGE: `client.registerUserDirectories` is now `client.stores.registerUserDirectories` BREAKING CHANGE: `client.deregisterStore` is now `client.stores.deregister` BREAKING CHANGE: `client.registerStore` is now `client.stores.register` --- package.json | 16 +- .../command-handler/CorePrefixedMessage.ts | 9 +- src/index.ts | 1 + src/lib/SapphireClient.ts | 109 ++--------- src/lib/parsers/Args.ts | 3 +- src/lib/structures/ExtendedArgument.ts | 2 +- src/lib/structures/StoreRegistry.ts | 100 ++++++++++ .../PreconditionContainerSingle.ts | 3 +- yarn.lock | 183 +++++++++--------- 9 files changed, 229 insertions(+), 197 deletions(-) create mode 100644 src/lib/structures/StoreRegistry.ts diff --git a/package.json b/package.json index 899c90f87..fbb08af92 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@sapphire/discord.js-utilities": "^1.3.1", "@sapphire/pieces": "^1.2.1", "@sapphire/ratelimits": "^1.1.4", - "@sapphire/utilities": "^1.4.3", + "@sapphire/utilities": "^1.4.4", "lexure": "^0.17.0" }, "peerDependencies": { @@ -47,11 +47,11 @@ "@types/jest": "^26.0.20", "@types/node": "^14.14.22", "@types/ws": "^7.4.0", - "@typescript-eslint/eslint-plugin": "^4.14.1", - "@typescript-eslint/parser": "^4.14.1", + "@typescript-eslint/eslint-plugin": "^4.14.2", + "@typescript-eslint/parser": "^4.14.2", "cz-conventional-changelog": "^3.3.0", "discord.js": "^12.5.1", - "eslint": "^7.18.0", + "eslint": "^7.19.0", "eslint-config-prettier": "^7.2.0", "eslint-plugin-prettier": "^3.3.1", "husky": "^4.3.8", @@ -61,12 +61,12 @@ "npm-run-all": "^4.1.5", "prettier": "^2.2.1", "pretty-quick": "^3.1.0", - "rollup": "^2.38.2", + "rollup": "^2.38.3", "rollup-plugin-dts": "^2.0.1", "standard-version": "^9.1.0", - "ts-jest": "^26.4.4", + "ts-jest": "^26.5.0", "ts-node": "^9.1.1", - "typedoc": "^0.20.19", + "typedoc": "^0.20.20", "typedoc-plugin-nojekyll": "^1.0.1", "typescript": "^4.1.3" }, @@ -118,7 +118,7 @@ "access": "public" }, "resolutions": { - "acorn": "^8.0.4", + "acorn": "^8.0.5", "minimist": "^1.2.5", "kind-of": "^6.0.3", "jest-environment-jsdom": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz", diff --git a/src/events/command-handler/CorePrefixedMessage.ts b/src/events/command-handler/CorePrefixedMessage.ts index ae8f22876..3143fb161 100644 --- a/src/events/command-handler/CorePrefixedMessage.ts +++ b/src/events/command-handler/CorePrefixedMessage.ts @@ -9,25 +9,26 @@ export class CoreEvent extends Event { } public run(message: Message, prefix: string | RegExp) { + const { client, stores } = this.context; // Retrieve the command name and validate: const trimLength = typeof prefix === 'string' ? prefix.length : prefix.exec(message.content)?.[0].length ?? 0; const prefixLess = message.content.slice(trimLength).trim(); const spaceIndex = prefixLess.indexOf(' '); const name = spaceIndex === -1 ? prefixLess : prefixLess.slice(0, spaceIndex); if (!name) { - message.client.emit(Events.UnknownCommandName, message, prefix); + client.emit(Events.UnknownCommandName, message, prefix); return; } // Retrieve the command and validate: - const command = message.client.commands.get(message.client.options.caseInsensitiveCommands ? name.toLowerCase() : name); + const command = stores.get('commands').get(client.options.caseInsensitiveCommands ? name.toLowerCase() : name); if (!command) { - message.client.emit(Events.UnknownCommand, message, name, prefix); + client.emit(Events.UnknownCommand, message, name, prefix); return; } // Run the last stage before running the command: const parameters = spaceIndex === -1 ? '' : prefixLess.substr(spaceIndex + 1).trim(); - message.client.emit(Events.PreCommandRun, { message, command, parameters, context: { commandName: name, prefix } }); + client.emit(Events.PreCommandRun, { message, command, parameters, context: { commandName: name, prefix } }); } } diff --git a/src/index.ts b/src/index.ts index 89f6c9d3e..efc1af8cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,6 +30,7 @@ export * from './lib/structures/EventStore'; export * from './lib/structures/ExtendedArgument'; export * from './lib/structures/Precondition'; export * from './lib/structures/PreconditionStore'; +export * from './lib/structures/StoreRegistry'; export * from './lib/types/Enums'; export * from './lib/types/Events'; export * from './lib/utils/logger/ILogger'; diff --git a/src/lib/SapphireClient.ts b/src/lib/SapphireClient.ts index f98329c17..6792f2862 100644 --- a/src/lib/SapphireClient.ts +++ b/src/lib/SapphireClient.ts @@ -1,4 +1,4 @@ -import { Awaited, getRootData, Piece, Store } from '@sapphire/pieces'; +import { Awaited, Store } from '@sapphire/pieces'; import { Client, ClientOptions, Message } from 'discord.js'; import { join } from 'path'; import type { Plugin } from './plugins/Plugin'; @@ -7,6 +7,7 @@ import { ArgumentStore } from './structures/ArgumentStore'; import { CommandStore } from './structures/CommandStore'; import { EventStore } from './structures/EventStore'; import { PreconditionStore } from './structures/PreconditionStore'; +import { StoreRegistry } from './structures/StoreRegistry'; import { PluginHook } from './types/Enums'; import { Events } from './types/Events'; import { ILogger, LogLevel } from './utils/logger/ILogger'; @@ -183,35 +184,11 @@ export class SapphireClient extends Client { */ public logger: ILogger; - /** - * The arguments the framework has registered. - * @since 1.0.0 - */ - public arguments: ArgumentStore; - - /** - * The commands the framework has registered. - * @since 1.0.0 - */ - public commands: CommandStore; - - /** - * The events the framework has registered. - * @since 1.0.0 - */ - public events: EventStore; - - /** - * The precondition the framework has registered. - * @since 1.0.0 - */ - public preconditions: PreconditionStore; - /** * The registered stores. * @since 1.0.0 */ - public stores: Set>; + public stores: StoreRegistry; public constructor(options: ClientOptions = {}) { super(options); @@ -224,9 +201,11 @@ export class SapphireClient extends Client { } this.logger = options.logger?.instance ?? new Logger(options.logger?.level ?? LogLevel.Info); - Store.injectedContext.logger = this.logger; + this.stores = new StoreRegistry(); + Store.injectedContext.stores = this.stores; + this.fetchPrefix = options.fetchPrefix ?? (() => this.options.defaultPrefix ?? null); for (const plugin of SapphireClient.plugins.values(PluginHook.PreInitialization)) { @@ -235,18 +214,12 @@ export class SapphireClient extends Client { } this.id = options.id ?? null; - this.arguments = new ArgumentStore().registerPath(join(__dirname, '..', 'arguments')); - this.commands = new CommandStore(); - this.events = new EventStore().registerPath(join(__dirname, '..', 'events')); - this.preconditions = new PreconditionStore().registerPath(join(__dirname, '..', 'preconditions')); - - if (options.loadDefaultErrorEvents !== false) this.events.registerPath(join(__dirname, '..', 'errorEvents')); - - this.stores = new Set(); - this.registerStore(this.arguments) // - .registerStore(this.commands) - .registerStore(this.events) - .registerStore(this.preconditions); + this.stores + .register(new ArgumentStore().registerPath(join(__dirname, '..', 'arguments'))) // + .register(new CommandStore()) + .register(new EventStore().registerPath(join(__dirname, '..', 'events'))) + .register(new PreconditionStore().registerPath(join(__dirname, '..', 'preconditions'))); + if (options.loadDefaultErrorEvents !== false) this.stores.get('events').registerPath(join(__dirname, '..', 'errorEvents')); for (const plugin of SapphireClient.plugins.values(PluginHook.PostInitialization)) { plugin.hook.call(this, options); @@ -254,54 +227,6 @@ export class SapphireClient extends Client { } } - /** - * Registers all user directories from the process working directory, the default value is obtained by assuming - * CommonJS (high accuracy) but with fallback for ECMAScript Modules (reads package.json's `main` entry, fallbacks - * to `process.cwd()`). - * - * By default, if you have this folder structure: - * ``` - * /home/me/my-bot - * ├─ src - * │ ├─ commands - * │ ├─ events - * │ └─ main.js - * └─ package.json - * ``` - * - * And you run `node src/main.js`, the directories `/home/me/my-bot/src/commands` and `/home/me/my-bot/src/events` will - * be registered for the commands and events stores respectively, since both directories are located in the same - * directory as your main file. - * - * **Note**: this also registers directories for all other stores, even if they don't have a folder, this allows you - * to create new pieces and hot-load them later anytime. - * @param rootDirectory The root directory to register pieces at. - */ - public registerUserDirectories(rootDirectory = getRootData().root) { - for (const store of this.stores) { - store.registerPath(join(rootDirectory, store.name)); - } - } - - /** - * Registers a store. - * @param store The store to register. - */ - public registerStore(store: Store): this { - this.stores.add((store as unknown) as Store); - return this; - } - - /** - * Deregisters a store. - * @since 1.0.0 - * @param store The store to deregister. - */ - public deregisterStore(store: Store): this { - this.stores.delete((store as unknown) as Store); - return this; - } - /** * Loads all pieces, then logs the client in, establishing a websocket connection to Discord. * @since 1.0.0 @@ -311,7 +236,7 @@ export class SapphireClient extends Client { public async login(token?: string) { // Register the user directory if not null: if (this.options.baseUserDirectory !== null) { - this.registerUserDirectories(this.options.baseUserDirectory); + this.stores.registerUserDirectories(this.options.baseUserDirectory); } // Call pre-login plugins: @@ -321,7 +246,7 @@ export class SapphireClient extends Client { } // Loads all stores, then call login: - await Promise.all([...this.stores].map((store) => store.loadAll())); + await Promise.all([...this.stores.values()].map((store) => store.loadAll())); const login = await super.login(token); // Call post-login plugins: @@ -350,10 +275,7 @@ declare module 'discord.js' { interface Client { id: string | null; logger: ILogger; - arguments: ArgumentStore; - commands: CommandStore; - events: EventStore; - preconditions: PreconditionStore; + stores: StoreRegistry; fetchPrefix: SapphirePrefixHook; } @@ -364,5 +286,6 @@ declare module '@sapphire/pieces' { interface PieceContextExtras { client: SapphireClient; logger: ILogger; + stores: StoreRegistry; } } diff --git a/src/lib/parsers/Args.ts b/src/lib/parsers/Args.ts index ef349b8cd..89e235345 100644 --- a/src/lib/parsers/Args.ts +++ b/src/lib/parsers/Args.ts @@ -1,3 +1,4 @@ +import { Store } from '@sapphire/pieces'; import type { CategoryChannel, Channel, @@ -625,7 +626,7 @@ export class Args { */ private resolveArgument(arg: keyof ArgType | IArgument): IArgument | undefined { if (typeof arg === 'object') return arg; - return this.message.client.arguments.get(arg as string) as IArgument | undefined; + return Store.injectedContext.stores.get('arguments').get(arg as string) as IArgument | undefined; } /** diff --git a/src/lib/structures/ExtendedArgument.ts b/src/lib/structures/ExtendedArgument.ts index b00bf1d72..d6da3e216 100644 --- a/src/lib/structures/ExtendedArgument.ts +++ b/src/lib/structures/ExtendedArgument.ts @@ -62,7 +62,7 @@ export abstract class ExtendedArgument extends Argum * into the value used to compute the extended argument's value. */ public get base(): IArgument { - return this.context.client.arguments.get(this.baseArgument) as IArgument; + return this.context.stores.get('arguments').get(this.baseArgument) as IArgument; } public async run(parameter: string, context: ArgumentContext): AsyncArgumentResult { diff --git a/src/lib/structures/StoreRegistry.ts b/src/lib/structures/StoreRegistry.ts new file mode 100644 index 000000000..90eef146d --- /dev/null +++ b/src/lib/structures/StoreRegistry.ts @@ -0,0 +1,100 @@ +import Collection from '@discordjs/collection'; +import { getRootData, Piece, Store } from '@sapphire/pieces'; +import { join } from 'path'; +import type { ArgumentStore } from './ArgumentStore'; +import type { CommandStore } from './CommandStore'; +import type { EventStore } from './EventStore'; +import type { PreconditionStore } from './PreconditionStore'; + +type Key = keyof StoreRegistryEntries; +type Value = StoreRegistryEntries[Key]; + +/** + * A strict-typed store registry. This is available in both [[Client.stores]] and [[Store.injectedContext]]. + * @since 1.0.0 + * @example + * ```typescript + * // Adding new stores + * + * // Register the store: + * Store.injectedContext.stores.register(new RouteStore()); + * + * // Augment Sapphire to add the new store, in case of a JavaScript + * // project, this can be moved to an `Augments.d.ts` (or any other name) + * // file somewhere: + * declare module '(at)sapphire/framework' { + * export interface StoreRegistryEntries { + * routes: RouteStore; + * } + * } + * ``` + */ +export class StoreRegistry extends Collection { + /** + * Registers all user directories from the process working directory, the default value is obtained by assuming + * CommonJS (high accuracy) but with fallback for ECMAScript Modules (reads package.json's `main` entry, fallbacks + * to `process.cwd()`). + * + * By default, if you have this folder structure: + * ``` + * /home/me/my-bot + * ├─ src + * │ ├─ commands + * │ ├─ events + * │ └─ main.js + * └─ package.json + * ``` + * + * And you run `node src/main.js`, the directories `/home/me/my-bot/src/commands` and `/home/me/my-bot/src/events` will + * be registered for the commands and events stores respectively, since both directories are located in the same + * directory as your main file. + * + * **Note**: this also registers directories for all other stores, even if they don't have a folder, this allows you + * to create new pieces and hot-load them later anytime. + * @since 1.0.0 + * @param rootDirectory The root directory to register pieces at. + */ + public registerUserDirectories(rootDirectory = getRootData().root) { + for (const store of this.values()) { + store.registerPath(join(rootDirectory, store.name)); + } + } + + /** + * Registers a store. + * @since 1.0.0 + * @param store The store to register. + */ + public register(store: Store): this { + this.set(store.name as Key, (store as unknown) as Value); + return this; + } + + /** + * Deregisters a store. + * @since 1.0.0 + * @param store The store to deregister. + */ + public deregister(store: Store): this { + this.delete(store.name as Key); + return this; + } +} + +export interface StoreRegistry { + get(key: K): StoreRegistryEntries[K]; + get(key: string): undefined; + has(key: Key): true; + has(key: string): false; +} + +/** + * The [[StoreRegistry]]'s registry, use module augmentation against this interface when adding new stores. + * @since 1.0.0 + */ +export interface StoreRegistryEntries { + arguments: ArgumentStore; + commands: CommandStore; + events: EventStore; + preconditions: PreconditionStore; +} diff --git a/src/lib/utils/preconditions/PreconditionContainerSingle.ts b/src/lib/utils/preconditions/PreconditionContainerSingle.ts index 6f5bca749..3fd153b43 100644 --- a/src/lib/utils/preconditions/PreconditionContainerSingle.ts +++ b/src/lib/utils/preconditions/PreconditionContainerSingle.ts @@ -1,3 +1,4 @@ +import { Store } from '@sapphire/pieces'; import type { Message } from 'discord.js'; import type { Command } from '../../structures/Command'; import type { PreconditionContext } from '../../structures/Precondition'; @@ -64,7 +65,7 @@ export class PreconditionContainerSingle implements IPreconditionContainer { * @param command The command the message invoked. */ public run(message: Message, command: Command) { - const precondition = message.client.preconditions.get(this.name); + const precondition = Store.injectedContext.stores.get('preconditions').get(this.name); if (precondition) return precondition.run(message, command, this.context); throw new Error(`The precondition "${this.name}" is not available.`); } diff --git a/yarn.lock b/yarn.lock index ed2eb1727..8195a034b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -775,10 +775,10 @@ resolved "https://registry.yarnpkg.com/@sapphire/ts-config/-/ts-config-2.0.0.tgz#414f47a134e8016193e1685c7ca999dfdcd54bf2" integrity sha512-gYjOTGZ9jMOWJoCbxbMZo7hspBDzz7gX2CJnt7iB4C4xR8gOXA2EpZLFD8e9b8EWmwclQWiQjdZYGGRqMEVovw== -"@sapphire/utilities@^1.4.3": - version "1.4.3" - resolved "https://registry.yarnpkg.com/@sapphire/utilities/-/utilities-1.4.3.tgz#cf5540ee79fdb63c9af64754c9db6d533f58c812" - integrity sha512-OS4Tvimwqa2iKusNeP3rPd3RnoRazbKHh1ANEzwbE6zawSTPstcehmIYJ1G02eDae/45H1nrOg37O67eAY8uOw== +"@sapphire/utilities@^1.4.4": + version "1.4.4" + resolved "https://registry.yarnpkg.com/@sapphire/utilities/-/utilities-1.4.4.tgz#3774c79b573d8af68c838b52813b55cd24c2a0b6" + integrity sha512-RMEEOlykuYRde4hdH2T03or24EsjtTU1OdN+gw6aJdf+1GEcL6VqyN9B56tyU6CGF5PXLUOYZJiEgM6TiYcp1Q== "@sinonjs/commons@^1.7.0": version "1.8.1" @@ -944,13 +944,13 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.1.tgz#22dd301ce228aaab3416b14ead10b1db3e7d3180" - integrity sha512-5JriGbYhtqMS1kRcZTQxndz1lKMwwEXKbwZbkUZNnp6MJX0+OVXnG0kOlBZP4LUAxEyzu3cs+EXd/97MJXsGfw== +"@typescript-eslint/eslint-plugin@^4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.2.tgz#47a15803cfab89580b96933d348c2721f3d2f6fe" + integrity sha512-uMGfG7GFYK/nYutK/iqYJv6K/Xuog/vrRRZX9aEP4Zv1jsYXuvFUMDFLhUnc8WFv3D2R5QhNQL3VYKmvLS5zsQ== dependencies: - "@typescript-eslint/experimental-utils" "4.14.1" - "@typescript-eslint/scope-manager" "4.14.1" + "@typescript-eslint/experimental-utils" "4.14.2" + "@typescript-eslint/scope-manager" "4.14.2" debug "^4.1.1" functional-red-black-tree "^1.0.1" lodash "^4.17.15" @@ -958,48 +958,48 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.1.tgz#a5c945cb24dabb96747180e1cfc8487f8066f471" - integrity sha512-2CuHWOJwvpw0LofbyG5gvYjEyoJeSvVH2PnfUQSn0KQr4v8Dql2pr43ohmx4fdPQ/eVoTSFjTi/bsGEXl/zUUQ== +"@typescript-eslint/experimental-utils@4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.2.tgz#9df35049d1d36b6cbaba534d703648b9e1f05cbb" + integrity sha512-mV9pmET4C2y2WlyHmD+Iun8SAEqkLahHGBkGqDVslHkmoj3VnxnGP4ANlwuxxfq1BsKdl/MPieDbohCEQgKrwA== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/scope-manager" "4.14.1" - "@typescript-eslint/types" "4.14.1" - "@typescript-eslint/typescript-estree" "4.14.1" + "@typescript-eslint/scope-manager" "4.14.2" + "@typescript-eslint/types" "4.14.2" + "@typescript-eslint/typescript-estree" "4.14.2" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.14.1.tgz#3bd6c24710cd557d8446625284bcc9c6d52817c6" - integrity sha512-mL3+gU18g9JPsHZuKMZ8Z0Ss9YP1S5xYZ7n68Z98GnPq02pYNQuRXL85b9GYhl6jpdvUc45Km7hAl71vybjUmw== +"@typescript-eslint/parser@^4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.14.2.tgz#31e216e4baab678a56e539f9db9862e2542c98d0" + integrity sha512-ipqSP6EuUsMu3E10EZIApOJgWSpcNXeKZaFeNKQyzqxnQl8eQCbV+TSNsl+s2GViX2d18m1rq3CWgnpOxDPgHg== dependencies: - "@typescript-eslint/scope-manager" "4.14.1" - "@typescript-eslint/types" "4.14.1" - "@typescript-eslint/typescript-estree" "4.14.1" + "@typescript-eslint/scope-manager" "4.14.2" + "@typescript-eslint/types" "4.14.2" + "@typescript-eslint/typescript-estree" "4.14.2" debug "^4.1.1" -"@typescript-eslint/scope-manager@4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.14.1.tgz#8444534254c6f370e9aa974f035ced7fe713ce02" - integrity sha512-F4bjJcSqXqHnC9JGUlnqSa3fC2YH5zTtmACS1Hk+WX/nFB0guuynVK5ev35D4XZbdKjulXBAQMyRr216kmxghw== +"@typescript-eslint/scope-manager@4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.14.2.tgz#64cbc9ca64b60069aae0c060b2bf81163243b266" + integrity sha512-cuV9wMrzKm6yIuV48aTPfIeqErt5xceTheAgk70N1V4/2Ecj+fhl34iro/vIssJlb7XtzcaD07hWk7Jk0nKghg== dependencies: - "@typescript-eslint/types" "4.14.1" - "@typescript-eslint/visitor-keys" "4.14.1" + "@typescript-eslint/types" "4.14.2" + "@typescript-eslint/visitor-keys" "4.14.2" -"@typescript-eslint/types@4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.1.tgz#b3d2eb91dafd0fd8b3fce7c61512ac66bd0364aa" - integrity sha512-SkhzHdI/AllAgQSxXM89XwS1Tkic7csPdndUuTKabEwRcEfR8uQ/iPA3Dgio1rqsV3jtqZhY0QQni8rLswJM2w== +"@typescript-eslint/types@4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.14.2.tgz#d96da62be22dc9dc6a06647f3633815350fb3174" + integrity sha512-LltxawRW6wXy4Gck6ZKlBD05tCHQUj4KLn4iR69IyRiDHX3d3NCAhO+ix5OR2Q+q9bjCrHE/HKt+riZkd1At8Q== -"@typescript-eslint/typescript-estree@4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.1.tgz#20d3b8c8e3cdc8f764bdd5e5b0606dd83da6075b" - integrity sha512-M8+7MbzKC1PvJIA8kR2sSBnex8bsR5auatLCnVlNTJczmJgqRn8M+sAlQfkEq7M4IY3WmaNJ+LJjPVRrREVSHQ== +"@typescript-eslint/typescript-estree@4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.2.tgz#9c5ebd8cae4d7b014f890acd81e8e17f309c9df9" + integrity sha512-ESiFl8afXxt1dNj8ENEZT12p+jl9PqRur+Y19m0Z/SPikGL6rqq4e7Me60SU9a2M28uz48/8yct97VQYaGl0Vg== dependencies: - "@typescript-eslint/types" "4.14.1" - "@typescript-eslint/visitor-keys" "4.14.1" + "@typescript-eslint/types" "4.14.2" + "@typescript-eslint/visitor-keys" "4.14.2" debug "^4.1.1" globby "^11.0.1" is-glob "^4.0.1" @@ -1007,12 +1007,12 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/visitor-keys@4.14.1": - version "4.14.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.1.tgz#e93c2ff27f47ee477a929b970ca89d60a117da91" - integrity sha512-TAblbDXOI7bd0C/9PE1G+AFo7R5uc+ty1ArDoxmrC1ah61Hn6shURKy7gLdRb1qKJmjHkqu5Oq+e4Kt0jwf1IA== +"@typescript-eslint/visitor-keys@4.14.2": + version "4.14.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.2.tgz#997cbe2cb0690e1f384a833f64794e98727c70c6" + integrity sha512-KBB+xLBxnBdTENs/rUgeUKO0UkPBRs2vD09oMRRIkj5BEN8PX1ToXV532desXfpQnZsYTyLLviS7JrPhdL154w== dependencies: - "@typescript-eslint/types" "4.14.1" + "@typescript-eslint/types" "4.14.2" eslint-visitor-keys "^2.0.0" JSONStream@^1.0.4: @@ -1035,10 +1035,10 @@ acorn-jsx@^5.3.1: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== -acorn@^7.4.0, acorn@^8.0.4: - version "8.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.0.4.tgz#7a3ae4191466a6984eee0fe3407a4f3aa9db8354" - integrity sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ== +acorn@^7.4.0, acorn@^8.0.5: + version "8.0.5" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.0.5.tgz#a3bfb872a74a6a7f661bc81b9849d9cac12601b7" + integrity sha512-v+DieK/HJkJOpFBETDJioequtc3PfxsWMaxIdIwujtF7FEV/MAyDQLlm6/zPvr7Mix07mLh6ccVwIsloceodlg== add-stream@^1.0.0: version "1.0.0" @@ -2230,10 +2230,10 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== -eslint@^7.18.0: - version "7.18.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.18.0.tgz#7fdcd2f3715a41fe6295a16234bd69aed2c75e67" - integrity sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ== +eslint@^7.19.0: + version "7.19.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.19.0.tgz#6719621b196b5fad72e43387981314e5d0dc3f41" + integrity sha512-CGlMgJY56JZ9ZSYhJuhow61lMPPjUzWmChFya71Z/jilVos7mR/jPgaEfVGgMBY5DshbKdG8Ezb8FDCHcoMEMg== dependencies: "@babel/code-frame" "^7.0.0" "@eslint/eslintrc" "^0.3.0" @@ -2636,7 +2636,7 @@ fs-extra@^6.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^9.0.0, fs-extra@^9.0.1: +fs-extra@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== @@ -2646,6 +2646,16 @@ fs-extra@^9.0.0, fs-extra@^9.0.1: jsonfile "^6.0.1" universalify "^1.0.0" +fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2656,10 +2666,10 @@ fsevents@^2.1.2: resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.2.1.tgz#1fb02ded2036a8ac288d507a65962bd87b97628d" integrity sha512-bTLYHSeC0UH/EFXS9KqWnXuOl/wHK5Z/d+ghd5AsFMYN7wIGkUCOJyzy88+wJKkZPGON8u4Z9f6U4FdgURE9qA== -fsevents@~2.1.2: - version "2.1.3" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== +fsevents@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.1.tgz#b209ab14c61012636c8863507edf7fb68cc54e9f" + integrity sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw== function-bind@^1.1.1: version "1.1.1" @@ -4071,11 +4081,6 @@ lodash.map@^4.5.1: resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM= -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - lodash.template@^4.0.2: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" @@ -4096,7 +4101,7 @@ lodash.uniq@4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20: +lodash@4.x, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -4208,10 +4213,10 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -marked@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/marked/-/marked-1.2.7.tgz#6e14b595581d2319cdcf033a24caaf41455a01fb" - integrity sha512-No11hFYcXr/zkBvL6qFmAp1z6BKY3zqLMHny/JN/ey+al7qwCM2+CMBL9BOgqMxZU36fz4cCWfn2poWIf7QRXA== +marked@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/marked/-/marked-1.2.8.tgz#5008ece15cfa43e653e85845f3525af4beb6bdd4" + integrity sha512-lzmFjGnzWHkmbk85q/ILZjFoHHJIQGF+SxGEfIdGk/XhiTPhqGs37gbru6Kkd48diJnEyYwnG67nru0Z2gQtuQ== mdast-squeeze-paragraphs@^4.0.0: version "4.0.0" @@ -5335,12 +5340,12 @@ rollup-plugin-dts@^2.0.1: optionalDependencies: "@babel/code-frame" "^7.10.4" -rollup@^2.38.2: - version "2.38.2" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.38.2.tgz#ac5feef9e3b5f1c4386a0578f3add52b8b66759f" - integrity sha512-3Sg65zfgqsnI2LUFsOmhJDvTWXwio+taySq/dsyvel8+GW+AxeW9V6YZG8BpVGQk/TS4uvGLARRH5T3ygDyyNQ== +rollup@^2.38.3: + version "2.38.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.38.3.tgz#2a0b6cc6eab1da4431aab875a31a401fa2988c10" + integrity sha512-FVx/XzR2DtCozKNDBjHJCHIgkC12rNg/ruAeoYWjLeeKfSKgwhh+lDLDhuCkuRG/fsup8py8dKBTlHdvUFX32A== optionalDependencies: - fsevents "~2.1.2" + fsevents "~2.3.1" rsvp@^4.8.4: version "4.8.5" @@ -6068,10 +6073,10 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== -ts-jest@^26.4.4: - version "26.4.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.4.tgz#61f13fb21ab400853c532270e52cc0ed7e502c49" - integrity sha512-3lFWKbLxJm34QxyVNNCgXX1u4o/RV0myvA2y2Bxm46iGIjKlaY0own9gIckbjZJPn+WaJEnfPPJ20HHGpoq4yg== +ts-jest@^26.5.0: + version "26.5.0" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.5.0.tgz#3e3417d91bc40178a6716d7dacc5b0505835aa21" + integrity sha512-Ya4IQgvIFNa2Mgq52KaO8yBw2W8tWp61Ecl66VjF0f5JaV8u50nGoptHVILOPGoI7SDnShmEqnYQEmyHdQ+56g== dependencies: "@types/jest" "26.x" bs-logger "0.x" @@ -6079,7 +6084,7 @@ ts-jest@^26.4.4: fast-json-stable-stringify "2.x" jest-util "^26.1.0" json5 "2.x" - lodash.memoize "4.x" + lodash "4.x" make-error "1.x" mkdirp "1.x" semver "7.x" @@ -6163,10 +6168,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typedoc-default-themes@^0.12.5: - version "0.12.5" - resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.5.tgz#063725a3eb407593ab07e4f110e5cf33b3892616" - integrity sha512-JQ2O9laZ/EhfWUWYp/8EyuShYhtXLhIa6DU8eZNUfaurMhEgKdffbadKNv6HMmTfOxAcgiePg06OCxNX8EyP3g== +typedoc-default-themes@^0.12.7: + version "0.12.7" + resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.12.7.tgz#d44f68d40a3e90a19b5ea7be4cc6ed949afe768d" + integrity sha512-0XAuGEqID+gon1+fhi4LycOEFM+5Mvm2PjwaiVZNAzU7pn3G2DEpsoXnFOPlLDnHY6ZW0BY0nO7ur9fHOFkBLQ== typedoc-plugin-nojekyll@^1.0.1: version "1.0.1" @@ -6175,22 +6180,22 @@ typedoc-plugin-nojekyll@^1.0.1: dependencies: fs-extra "^6.0.1" -typedoc@^0.20.19: - version "0.20.19" - resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.20.19.tgz#4871f659bc03a545c572066329273f1b30fb1cba" - integrity sha512-9FjQ1xQGtxpXm8R5QKvU8wFBaaYe8RW3NzrhGWB8RigbOALwG+4ywJ/EyArPGWXvmXYB7I8h2YHzeyFvZ2s0ow== +typedoc@^0.20.20: + version "0.20.20" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.20.20.tgz#0f0915fb73e7371fc2cf8c74b6a3207dcf5c3dda" + integrity sha512-qXB40ttDGaqv6q6UIiAVqOpX/GlXoBur0lB4g9fePoYjfwa6OsPkoYufLtsjEaBB0EokShR2aIoI5GX4RB83cw== dependencies: colors "^1.4.0" - fs-extra "^9.0.1" + fs-extra "^9.1.0" handlebars "^4.7.6" lodash "^4.17.20" lunr "^2.3.9" - marked "^1.2.5" + marked "^1.2.8" minimatch "^3.0.0" progress "^2.0.3" shelljs "^0.8.4" shiki "^0.2.7" - typedoc-default-themes "^0.12.5" + typedoc-default-themes "^0.12.7" typescript@^4.1.3: version "4.1.3"