This is an AI generated report, use as a heuristic only:
Migration Summary for pkgs/slash-commands
This summary outlines the necessary changes to migrate pkgs/slash-commands to Inversify v7, based on the analysis from the provided history.
container.resolve
container.resolve is used in pkgs/slash-commands.
pkgs/slash-commands/src/services/SlashCommandService/index.ts
In getCommandRegistrationMeta, this.container.resolve is used:
const resolver = this.container.resolve(
arg.choicesResolver,
);
This should be changed to:
const resolver = this.container.get(
arg.choicesResolver,
{ autobind: true },
);
pkgs/slash-commands/src/services/SlashCommandFactory/SlashCommandFactory.ts
In complete, di.resolve is used:
const completer = di.resolve(argMeta.choicesCompleter!);
This should be changed to:
const completer = di.get(argMeta.choicesCompleter!, { autobind: true });
Custom metadata and middlewares
The Custom metadata and middlewares feature was removed in Inversify v7.
This change requires manual review of the codebase to determine if it was used. There is no reliable way to search for this feature automatically.
isBound-like Methods
isBoundNamed is used in pkgs/slash-commands.
pkgs/slash-commands/src/services/SlashCommandFactory/SlashArgInstaller.ts
In executeValidators, di.isBoundNamed and di.getAllNamed are used:
if (di.isBoundNamed(Validator, this.property)) {
const validators = di.getAllNamed(Validator, this.property);
for (const validator of validators) {
await validator.validate(value);
}
}
This should be changed to:
if (di.isBound(Validator, { name: this.property })) {
const validators = di.getAll(Validator, { name: this.property });
for (const validator of validators) {
await validator.validate(value);
}
}
Parent and Child Containers
createChild() is used in pkgs/slash-commands to create child containers.
pkgs/slash-commands/src/services/SlashCommandFactory/SlashCommandFactory.ts
In both createSubContainer and complete, createChild is used:
const di = this.parentContainer.createChild({
skipBaseClassChecks: true,
});
This should be changed to use the Container constructor:
const di = new Container({
parent: this.parentContainer,
skipBaseClassChecks: true,
});
Removed interfaces namespace
The interfaces namespace is used and should be removed.
pkgs/slash-commands/src/builtins/decorators/args/channel.ts
The interfaces namespace is imported but not used. The import can be removed.
import { interfaces } from "inversify";
pkgs/slash-commands/src/services/SlashCommandFactory/SlashCommandFactory.ts
interfaces is used to type a service identifier.
import type { Container, interfaces } from "inversify";
// ...
// bind the command class
di.bind(this.meta.target as interfaces.ServiceIdentifier).toSelf();
// ...
// resolve command instance
const inst = subContainer.get<SlashCommand>(
this.meta.target as interfaces.ServiceIdentifier<SlashCommand>,
);
The import should be changed to import type { Container, ServiceIdentifier } from "inversify"; and the usages updated accordingly.
This is an AI generated report, use as a heuristic only:
Migration Summary for pkgs/slash-commands
This summary outlines the necessary changes to migrate
pkgs/slash-commandsto Inversify v7, based on the analysis from the provided history.container.resolve
container.resolveis used inpkgs/slash-commands.pkgs/slash-commands/src/services/SlashCommandService/index.tsIn
getCommandRegistrationMeta,this.container.resolveis used:This should be changed to:
pkgs/slash-commands/src/services/SlashCommandFactory/SlashCommandFactory.tsIn
complete,di.resolveis used:This should be changed to:
Custom metadata and middlewares
The
Custom metadata and middlewaresfeature was removed in Inversify v7.This change requires manual review of the codebase to determine if it was used. There is no reliable way to search for this feature automatically.
isBound-like Methods
isBoundNamedis used inpkgs/slash-commands.pkgs/slash-commands/src/services/SlashCommandFactory/SlashArgInstaller.tsIn
executeValidators,di.isBoundNamedanddi.getAllNamedare used:This should be changed to:
Parent and Child Containers
createChild()is used inpkgs/slash-commandsto create child containers.pkgs/slash-commands/src/services/SlashCommandFactory/SlashCommandFactory.tsIn both
createSubContainerandcomplete,createChildis used:This should be changed to use the
Containerconstructor:Removed
interfacesnamespaceThe
interfacesnamespace is used and should be removed.pkgs/slash-commands/src/builtins/decorators/args/channel.tsThe
interfacesnamespace is imported but not used. The import can be removed.pkgs/slash-commands/src/services/SlashCommandFactory/SlashCommandFactory.tsinterfacesis used to type a service identifier.The import should be changed to
import type { Container, ServiceIdentifier } from "inversify";and the usages updated accordingly.