strapi / codemods

A set of scripts to help migrate Strapi plugins (and in some cases Strapi applications) from v3 to v4
43 stars 13 forks source link
hacktoberfest hacktoberfest2022

@strapi/codemods

@strapi/codemods

CLI to help you migrate your Strapi applications & plugins from v3 to v4.

Features

Getting started

🖐 Requirements

Before running any commands, be sure you have initialized a git repository, the working tree is clean, you've pushed your code to GitHub, and you are on a new branch.

🕹 Usage

Migrate

Usage with prompt

npx @strapi/codemods migrate

The prompt will ask you:

Bypass the prompt

To bypass the prompts use one of the following commands:

npx @strapi/codemods migrate:application <path>
npx @strapi/codemods migrate:plugin <path> [pathForV4Plugin]

Note: if no pathForV4Plugin is provided it will be created at <path>-v4

npx @strapi/codemods migrate:dependencies <path>

Transform

:warning: This command will modify your source code. Be sure you have initialized a git repository, the working tree is clean, you've pushed your code to GitHub, and you are on a new branch.

npx @strapi/codemods transform

The prompt will ask two questions:

Enjoy 🎉