# ember-codemod-v1-to-v2

> Codemod to convert Ember addons to v2 addon format

Latest version **4.2.4** (published 2026-08-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-codemod-v1-to-v2
pnpm add ember-codemod-v1-to-v2
yarn add ember-codemod-v1-to-v2
bun add ember-codemod-v1-to-v2
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 4.2.4 |
| Published | 2026-08-25 |
| First published | 2023-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Isaac J. Lee |
| Maintainers | ijlee2 |
| Keywords | codemod, ember-codemod, ember-octane, ember-polaris, ember-v2-addon, emberjs, embroider |

## Links

- npm: https://www.npmjs.com/package/ember-codemod-v1-to-v2
- Repository: https://github.com/ijlee2/ember-codemod-v1-to-v2
- npm.io page: https://npm.io/package/ember-codemod-v1-to-v2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 4.2.4 (latest) — 2026-08-25
- 4.2.3 — 2026-08-11
- 4.2.2 — 2026-07-07
- 4.2.1 — 2026-06-25
- 4.2.0 — 2026-05-11
- 4.1.2 — 2026-04-30
- 4.1.1 — 2026-03-30
- 4.1.0 — 2026-03-16
- 4.0.0 — 2026-02-23
- 3.0.3 — 2026-02-04
- 3.0.2 — 2026-01-28
- 3.0.1 — 2025-12-29
- 3.0.0 — 2025-12-11
- 2.2.1 — 2025-12-09
- 2.2.0 — 2025-12-05
- … 58 more at https://npm.io/package/ember-codemod-v1-to-v2/versions

## 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)

# ember-codemod-v1-to-v2

_Codemod to convert Ember addons to v2 addon format_


## Usage

For 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).

Step 1. Quickly migrate to [v2 format](https://github.com/embroider-build/embroider/blob/v7.1.3-%40embroider/addon-dev/docs/addon-author-guide.md).

```sh
cd <path/to/your/project>
pnpx ember-codemod-v1-to-v2 <arguments>
```

> [!IMPORTANT]
>
> 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.
>
> Here are examples of what you may want to work on first:
>
> - [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).
> - [Un-pod v1 addon](https://github.com/ijlee2/ember-codemod-pod-to-octane).
> - [Convert templates to strict mode](https://github.com/ijlee2/ember-codemod-add-template-tags).
> - Update dependencies.
> - Switch `npm` or `yarn` to `pnpm`.

Step 2. Review the addon package.

- [x] Update configuration files.<sup>1</sup>
- [x] Install missing dependencies.
- [x] Relative import paths must specify the file extension `.js` or `.ts`.
- [x] Colocate stylesheets (if any). Let each component import the relevant stylesheet in the backing class.
- [x] Confirm that you can run all scripts in `package.json`.

Step 3. Review the test-app package.

- [x] Update configuration files.<sup>1</sup>
- [x] Rename the remaining instances of `dummy` to `test-app`.
- [x] Confirm that you can run all scripts in `package.json`.

Step 4. Review the workspace root including CI/CD.

<sup>1. Files such as `eslint.config.mjs`, `.gitignore`, `babel.config.cjs` (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.</sup>


### Arguments

In 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.

<details>

<summary>Optional: Specify the addon location</summary>

By 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.

```sh
pnpx ember-codemod-v1-to-v2 --addon-location packages/ui/button
```

</details>


<details>

<summary>Optional: Specify the project root</summary>

Pass `--root` to run the codemod on a project somewhere else (i.e. not in the current directory).

```sh
pnpx ember-codemod-v1-to-v2 --root <path/to/your/project>
```

</details>


<details>

<summary>Optional: Specify the test-app location</summary>

By default, the test-app package lives in the folder `test-app`. Pass `--test-app-location` to override the logic.

```sh
pnpx ember-codemod-v1-to-v2 --test-app-location docs-app
```

</details>


<details>

<summary>Optional: Specify the test-app name</summary>

By 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.

```sh
pnpx ember-codemod-v1-to-v2 --test-app-name test-app-for-ui-button
```

</details>


### Limitations

The 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).

To better meet your needs, consider cloning the repo and running the codemod locally.

```sh
cd <path/to/cloned/repo>

# Compile TypeScript
pnpm build

# Run codemod
./dist/bin/ember-codemod-v1-to-v2.js --root <path/to/your/project>
```

If you'd rather start over, you can use [`create-v2-addon-repo`](https://github.com/ijlee2/create-v2-addon-repo).


## Compatibility

- Node.js v22 or above


## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.


## Credits

The 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).


## License

This project is licensed under the [MIT License](LICENSE.md).

---
_Source: https://npm.io/package/ember-codemod-v1-to-v2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
