{"id":15015867,"url":"https://github.com/ijlee2/ember-codemod-v1-to-v2","last_synced_at":"2025-10-23T20:49:56.577Z","repository":{"id":65320283,"uuid":"586250732","full_name":"ijlee2/ember-codemod-v1-to-v2","owner":"ijlee2","description":"Codemod to convert Ember addons to v2 addon format","archived":false,"fork":false,"pushed_at":"2024-09-05T08:56:15.000Z","size":1113,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-15T09:36:14.895Z","etag":null,"topics":["codemod","ember-addon","ember-codemod","emberjs","embroider"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ijlee2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-07T13:32:44.000Z","updated_at":"2024-09-05T08:55:38.000Z","dependencies_parsed_at":"2024-04-26T07:31:36.277Z","dependency_job_id":"b1cbc01f-2400-47aa-a227-04510bbac967","html_url":"https://github.com/ijlee2/ember-codemod-v1-to-v2","commit_stats":{"total_commits":164,"total_committers":2,"mean_commits":82.0,"dds":"0.0060975609756097615","last_synced_commit":"70c5d589072a42d0297dd19a7ca3e9e24ae0386b"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-v1-to-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-v1-to-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-v1-to-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-v1-to-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijlee2","download_url":"https://codeload.github.com/ijlee2/ember-codemod-v1-to-v2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230121507,"owners_count":18176472,"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":["codemod","ember-addon","ember-codemod","emberjs","embroider"],"created_at":"2024-09-24T19:48:04.399Z","updated_at":"2025-10-23T20:49:51.541Z","avatar_url":"https://github.com/ijlee2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![This project uses GitHub Actions for continuous integration.](https://github.com/ijlee2/ember-codemod-v1-to-v2/actions/workflows/ci.yml/badge.svg)](https://github.com/ijlee2/ember-codemod-v1-to-v2/actions/workflows/ci.yml)\n\n# ember-codemod-v1-to-v2\n\n_Codemod to convert Ember addons to v2 addon format_\n\n\n## Features\n\n- Follows closely [`@embroider/addon-blueprint`](https://github.com/embroider-build/addon-blueprint)\n- Preserves your code whenever possible\n- Supports [`ember-cli-typescript`](https://docs.ember-cli-typescript.com/) and [`glint`](https://typed-ember.gitbook.io/glint/)\n- Focuses on maintainability and extensibility\n\n\n## Usage\n\nFor examples, see [`ember-container-query`](https://github.com/ijlee2/ember-container-query/pull/151/commits) and [`ember-render-helpers`](https://github.com/buschtoens/ember-render-helpers/pull/447/commits).\n\nStep 1. Quickly migrate to [v2 format](https://github.com/embroider-build/embroider/blob/v7.1.3-%40embroider/addon-dev/docs/addon-author-guide.md).\n\n```sh\ncd \u003cpath/to/your/project\u003e\nnpx ember-codemod-v1-to-v2 \u003carguments\u003e\n```\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e Before you run `ember-codemod-v1-to-v2`, I recommend that you address existing tech debts (one at a time). That is, treat the v2 migration as its own thing.\n\u003e\n\u003e Here are examples of what you may want to work on first:\n\u003e\n\u003e - [Meet prerequisites for v2 addon](https://github.com/embroider-build/embroider/blob/v7.1.3-%40embroider/addon-dev/docs/porting-addons-to-v2.md#part-3-prerequisites-for-v2-addon).\n\u003e - [Un-pod v1 addon](https://github.com/ijlee2/ember-codemod-pod-to-octane).\n\u003e - Update dependencies.\n\u003e - Switch `npm` or `yarn` to `pnpm`.\n\nStep 2. Review the addon package.\n\n- [x] Update configuration files.\u003csup\u003e1\u003c/sup\u003e\n- [x] Install missing dependencies.\n- [x] Relative import paths must specify the file extension `.js` or `.ts`.\n- [x] Colocate stylesheets (if any). Let each component import the relevant stylesheet in the backing class.\n- [x] Confirm that you can run all scripts in `package.json`.\n\nStep 3. Review the test-app package.\n\n- [x] Update configuration files.\u003csup\u003e1\u003c/sup\u003e\n- [x] Rename the remaining instances of `dummy` to `test-app`.\n- [x] Confirm that you can run all scripts in `package.json`.\n\nStep 4. Review the workspace root including CI/CD.\n\n\u003csup\u003e1. Files such as `eslint.config.mjs`, `.gitignore`, `babel.config.json` (addon only), `config/environment.js` (test-app only), `ember-cli-build.js` (test-app only), `package.json`, `rollup.config.mjs` (addon only), `tsconfig.json`, etc.\u003c/sup\u003e\n\n\n### Arguments\n\nIn most cases, I recommend running the codemod without any arguments (i.e. allow the default values). This is to help different Ember projects converge to one layout.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Specify the addon location\u003c/summary\u003e\n\nBy default, the package name decides where the addon package lives. Pass `--addon-location` to override the logic. This may be useful if you have a workspace with many addons.\n\n```sh\nnpx ember-codemod-v1-to-v2 --addon-location packages/ui/button\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Specify the project root\u003c/summary\u003e\n\nPass `--root` to run the codemod on a project somewhere else (i.e. not in the current directory).\n\n```sh\nnpx ember-codemod-v1-to-v2 --root \u003cpath/to/your/project\u003e\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Specify the test-app location\u003c/summary\u003e\n\nBy default, the test-app package lives in the folder `test-app`. Pass `--test-app-location` to override the logic.\n\n```sh\nnpx ember-codemod-v1-to-v2 --test-app-location docs-app\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Specify the test-app name\u003c/summary\u003e\n\nBy default, the test-app package is named `test-app`. Pass `--test-app-name` to override the logic. This may be useful if you have a workspace with many addons.\n\n```sh\nnpx ember-codemod-v1-to-v2 --test-app-name test-app-for-ui-button\n```\n\n\u003c/details\u003e\n\n\n### Limitations\n\nThe codemod is designed to cover typical uses of an Ember addon. It is not designed to cover one-off cases (e.g. caused by a custom build).\n\nTo better meet your needs, consider cloning the repo and running the codemod locally.\n\n```sh\ncd \u003cpath/to/cloned/repo\u003e\n\n# Compile TypeScript\npnpm build\n\n# Run codemod\n./dist/bin/ember-codemod-v1-to-v2.js --root \u003cpath/to/your/project\u003e\n```\n\nYou can also look at another codemod called [`ember-addon-migrator`](https://github.com/NullVoxPopuli/ember-addon-migrator).\n\n\n## Compatibility\n\n- Node.js v20 or above\n\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\nIf you have an open-sourced addon (v1 or v2) that I can use as a reference, reach out to me on [Discord](https://discord.gg/emberjs) at `ijlee2`. Please star this project so that I can gauge its importance to you and the Ember community. ⭐\n\n\n## Credits\n\nThe codemod steps were based on [Migrating an Ember addon to the next-gen v2 format](https://www.kaliber5.de/de/blog/v2-addon_en) and [Guide: Porting an Addon to v2](https://github.com/embroider-build/embroider/blob/v7.1.3-%40embroider/addon-dev/docs/porting-addons-to-v2.md). The blueprints were derived from [`@embroider/addon-blueprint`](https://github.com/embroider-build/addon-blueprint).\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlee2%2Fember-codemod-v1-to-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijlee2%2Fember-codemod-v1-to-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlee2%2Fember-codemod-v1-to-v2/lists"}