Skip to main content

v4 插件迁移指南

¥v4 plugin migration guide

本指南的目标是通过解决重大更改来启动 v3 插件并在 v4 上运行。

¥The goal of this guide is to get a v3 plugin up and running on v4 by resolving breaking changes.

✏️ 注意

本指南并不是 v4 插件 API 的详尽资源,这些 API 在 服务器 API管理面板 API 文档中进行了描述。

¥This guide is not an exhaustive resource for the v4 plugin APIs, which are described in the Server API and Admin Panel API documentations.

将插件从 Strapi v3.6.x 迁移到 v4.0.x 包括以下步骤:

¥Migrating a plugin from Strapi v3.6.x to v4.0.x consists in the following steps:

根据这些步骤,某些操作只能手动完成,而其他操作则可以通过修改代码的脚本(称为 codemod)自动执行。下表列出了迁移每个步骤的可用选项:

¥Depending on these steps, some actions can only be done manually while others can be performed automatically by scripts that modify the code, which are called codemods. The following table lists available options for each step of the migration:

行动迁移类型
更新文件夹结构Automaticmanual
迁移插件后端半自动
迁移插件前端手动的
启用插件手动的
🤓 Codemods 支持和社区贡献

如果你对代码模组有任何问题或想为该项目做出贡献,请 创建一个问题打开拉取请求

¥If you have any issues with the codemods or would like to contribute to the project please create an issue or open a pull request.