{"id":13472117,"url":"https://github.com/strapi/codemods","last_synced_at":"2025-03-26T15:31:20.931Z","repository":{"id":38313017,"uuid":"416827949","full_name":"strapi/codemods","owner":"strapi","description":"A set of scripts to help migrate Strapi plugins (and in some cases Strapi applications) from v3 to v4","archived":true,"fork":false,"pushed_at":"2023-11-02T15:52:50.000Z","size":694,"stargazers_count":43,"open_issues_count":6,"forks_count":13,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-03-20T17:04:07.357Z","etag":null,"topics":["hacktoberfest","hacktoberfest2022"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-10-13T16:57:08.000Z","updated_at":"2024-11-02T08:22:59.000Z","dependencies_parsed_at":"2024-01-23T21:35:21.579Z","dependency_job_id":null,"html_url":"https://github.com/strapi/codemods","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fcodemods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fcodemods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fcodemods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strapi%2Fcodemods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strapi","download_url":"https://codeload.github.com/strapi/codemods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245681292,"owners_count":20655165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","hacktoberfest2022"],"created_at":"2024-07-31T16:00:52.053Z","updated_at":"2025-03-26T15:31:20.432Z","avatar_url":"https://github.com/strapi.png","language":"JavaScript","funding_links":[],"categories":["Official Sources","hacktoberfest2022","Misc"],"sub_categories":["GitHub Repos","ant-design"],"readme":"![@strapi/codemods](./preview.png)\n\n# @strapi/codemods\n\n\u003e CLI to help you migrate your Strapi applications \u0026 plugins from v3 to v4.\n\n## Features\n\n- Migrate a Strapi application to v4\n- Migrate a Strapi plugin to v4\n- Migrate a Strapi application or a plugin's dependecies to v4\n\n## Getting started\n\n### 🖐 Requirements\n\nBefore 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.\n\n### 🕹 Usage\n\n#### Migrate\n\n_Usage with prompt_\n\n```bash\nnpx @strapi/codemods migrate\n```\n\nThe prompt will ask you:\n\n- What do you want to migrate?\n  - `Application` (migrate folder structure + dependencies)\n  - `Plugin` (migrate folder structure + dependencies)\n  - `Dependencies` (on migrate dependencies)\n- Where is the project located? (default: `./`).\n- _(plugin only)_ Where do you want to create the v4 plugin\n\n_Bypass the prompt_\n\nTo bypass the prompts use one of the following commands:\n\n- `Application` migration\n\n```bash\nnpx @strapi/codemods migrate:application \u003cpath\u003e\n```\n\n- `Plugin` migration\n\n```bash\nnpx @strapi/codemods migrate:plugin \u003cpath\u003e [pathForV4Plugin]\n```\n\n\u003e Note: if no `pathForV4Plugin` is provided it will be created at `\u003cpath\u003e-v4`\n\n- `Dependencies` migration\n\n```bash\nnpx @strapi/codemods migrate:dependencies \u003cpath\u003e\n```\n\n#### Transform\n\n: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._\n\n```bash\nnpx @strapi/codemods transform\n```\n\nThe prompt will ask two questions:\n\n- What kind of transformation you want to perform:\n\n  - `find` -\u003e `findMany`: Change `find` method to `findMany`\n\n  - `strapi-some-package` -\u003e `@strapi/some-package`: Update strapi scoped imports\n\n  - `.models` -\u003e `.contentTypes`: Change model getters to content types\n\n  - `strapi.plugins['some-plugin']` -\u003e `strapi.plugin('some-plugin')`: Update top level plugin getters\n\n  - `strapi.plugin('some-plugin').controllers['some-controller']` -\u003e `strapi.plugin('some-plugin').controller('some-controller')`: Use plugin getters\n\n  - Add arrow function for service export\n\n  - Add strapi to bootstrap function params\n\n- Where is the file(s) or folder to transform\n\nEnjoy 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrapi%2Fcodemods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrapi%2Fcodemods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrapi%2Fcodemods/lists"}