Socket
Book a DemoInstallSign in
Socket

@wroud/di-tools-codemod

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wroud/di-tools-codemod

@wroud/di-tools-codemod is a codemod utility that automates the migration of your codebase from Inversify to @wroud/di. It streamlines the transformation process, allowing for effortless and customizable transitions through configuration support.

latest
Source
npmnpm
Version
0.3.4
Version published
Maintainers
1
Created
Source

@wroud/di-tools-codemod

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.

Features

  • Automated Migration: Converts your existing Inversify code to use @wroud/di.
  • Configuration Support: Allows customization through a di-tools-codemod.json configuration file.

Installation

npm

npm install @wroud/di-tools-codemod

Install via yarn

yarn add @wroud/di-tools-codemod

Usage

To use the codemod, run the following command in your terminal:

yarn di-tools-codemod ./packages/*/src/**/*.{ts,tsx}

Configuration

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
}

Example

Before

import { injectable } from "inversify";

@injectable()
export class NotificationService {
  constructor(
    private readonly a: A,
    private readonly b: B,
    private readonly c: C,
  ) {}
}

After

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,
  ) {}
}

Changelog

All notable changes to this project will be documented in the CHANGELOG file.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Keywords

codemod

FAQs

Package last updated on 28 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts