Welcome to @wroud/di-tools-codemod, a tool designed to help you migrate your codebase from Inversify to @wroud/di effortlessly. This codemod automates the transformation process, ensuring a smooth transition to @wroud/di.
- Automated Migration: Converts your existing Inversify code to use
@wroud/di. - Configuration Support: Allows customization through a
di-tools-codemod.jsonconfiguration file.
npm install @wroud/di-tools-codemodInstall via yarn
yarn add @wroud/di-tools-codemodTo use the codemod, run the following command in your terminal:
yarn di-tools-codemod ./packages/*/src/**/*.{ts,tsx}You can provide a di-tools-codemod.json configuration file in the same folder where you run the codemod to customize the migration process.
{
"transformer": {
"esm": false,
"copyright": ""
},
"supportedPackages": [
{
"name": "inversify",
"replace": "@wroud/di",
"injectableDecorator": "injectable",
"injectDecorator": "inject",
"multiInjectDecorator": "multiInject"
}
],
"generateModule": true
}import { injectable } from "inversify";
@injectable()
export class NotificationService {
constructor(
private readonly a: A,
private readonly b: B,
private readonly c: C,
) {}
}import { injectable } from "@wroud/di";
@injectable(() => [A, B, C])
export class NotificationService {
constructor(
private readonly a: A,
private readonly b: B,
private readonly c: C,
) {}
}All notable changes to this project will be documented in the CHANGELOG file.
This project is licensed under the MIT License. See the LICENSE file for details.