{"id":15015875,"url":"https://github.com/ijlee2/ember-codemod-pod-to-octane","last_synced_at":"2025-04-12T09:31:43.676Z","repository":{"id":48242344,"uuid":"516610033","full_name":"ijlee2/ember-codemod-pod-to-octane","owner":"ijlee2","description":"Codemod to un-pod Ember apps, addons, and engines","archived":false,"fork":false,"pushed_at":"2025-03-24T07:57:52.000Z","size":894,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T07:01:56.646Z","etag":null,"topics":["codemod","ember-codemod","ember-octane","emberjs"],"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":"2022-07-22T04:31:17.000Z","updated_at":"2025-03-24T07:57:36.000Z","dependencies_parsed_at":"2023-02-15T10:15:34.140Z","dependency_job_id":"1ee69df3-35d9-4c7a-82e7-064564ba66ca","html_url":"https://github.com/ijlee2/ember-codemod-pod-to-octane","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":"0.41666666666666663","last_synced_commit":"5c4c7edbef607bda0fba784c297e5b9115eab82d"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-pod-to-octane","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-pod-to-octane/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-pod-to-octane/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-pod-to-octane/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijlee2","download_url":"https://codeload.github.com/ijlee2/ember-codemod-pod-to-octane/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248546091,"owners_count":21122253,"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-codemod","ember-octane","emberjs"],"created_at":"2024-09-24T19:48:04.980Z","updated_at":"2025-04-12T09:31:43.202Z","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-pod-to-octane/actions/workflows/ci.yml/badge.svg)](https://github.com/ijlee2/ember-codemod-pod-to-octane/actions/workflows/ci.yml)\n\n# ember-codemod-pod-to-octane\n\n_Codemod to un-pod Ember apps, addons, and engines_\n\n\n## Features\n\n- Preserves your code whenever possible\n- Supports [`ember-css-modules`](https://github.com/salsify/ember-css-modules)\n\n\n## Usage\n\nStep 1. Quickly return to [default Octane](https://cli.emberjs.com/release/advanced-use/project-layouts/#classiclayout).\u003csup\u003e1\u003c/sup\u003e\n\n```sh\ncd \u003cpath/to/your/project\u003e\nnpx ember-codemod-pod-to-octane \u003carguments\u003e\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e By default, Octane assumes the **flat component structure**. So does this codemod to help different Ember projects converge to one layout. If you want the **nested component structure** (also supported by Octane), you can run [`ember-flat-to-nested`](https://github.com/bertdeblock/ember-flat-to-nested) afterwards.\n\nStep 2. Remove `podModulePrefix` from `config/environment.js` and `usePods` from `.ember-cli`.\n\nStep 3. Update references originating from, as well as pointing to, the moved files. These can include `import` statement, `composes` property from `ember-css-modules`, etc.\n\n\u003e [!TIP]\n\u003e\n\u003e Linters can help you find the files that need to be updated.\n\u003e\n\u003e ```sh\n\u003e # With eslint-plugin-import\n\u003e [lint:js] /my-v1-addon/addon/index.ts\n\u003e [lint:js]   1:49  error  Unable to resolve path to module './components/navigation-menu/component'  import/no-unresolved\n\u003e \n\u003e # With typescript\n\u003e [lint:types] addon/index.ts:1:49 - error TS2307: Cannot find module './components/navigation-menu/component' or its corresponding type declarations.\n\u003e [lint:types] \n\u003e [lint:types] 1 export { default as NavigationMenu } from './components/navigation-menu/component';\n\u003e ```\n\n\n### Arguments\n\nYou must pass `--type` to indicate what type of project you have.\n\n```sh\n# For classic apps\nnpx ember-codemod-pod-to-octane --type app\n\n# For v1 addons (including engines)\nnpx ember-codemod-pod-to-octane --type v1-addon\n```\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Do a test run\u003c/summary\u003e\n\nPass `--test` to preview how the codemod will move files.\n\n```sh\nnpx ember-codemod-pod-to-octane --test\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-pod-to-octane --root \u003cpath/to/your/project\u003e\n```\n\nNote, you can use `--root` to un-pod the demo app of an Ember addon.\n\n```sh\n# If the current directory is the addon root\nnpx ember-codemod-pod-to-octane --type app --root tests/dummy\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Specify the pod path\u003c/summary\u003e\n\nPass `--pod-path` if `podModulePrefix` has been set in `config/environment.js`. \"Subtract\" `modulePrefix` from `podModulePrefix` to get the pod path.\n\n```sh\n# If modulePrefix is 'my-app' and podModulePrefix is 'my-app/pods'\nnpx ember-codemod-pod-to-octane --pod-path pods\n```\n\n\u003c/details\u003e\n\n\n### Limitations\n\nThe codemod is designed to cover typical uses of an Ember app, addon, and engine. It is not designed to cover one-off cases.\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eApps\u003c/summary\u003e\n\nTo account for a bug (found when Ember CLI is combined with Ember Data), the codemod doesn't consider unit tests for adapters, models, and serializers. You will need to manually move the test files.\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eAddons\u003c/summary\u003e\n\nThe codemod doesn't consider things related to Ember Data (i.e. adapters, models, and serializers).\n\n\u003c/details\u003e\n\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-pod-to-octane.js --root \u003cpath/to/your/project\u003e\n```\n\n\u003e [!TIP]\n\u003e\n\u003e You might clone the repo to migrate the project one component or one route at a time. For example, to migrate only the `\u003cNavigationMenu\u003e` component (and its subcomponents, if they exist), update the related file(s) in the `src` folder like this:\n\u003e\n\u003e ```diff\n\u003e export function mapComponentClasses(options: Options): FilePathMapEntries {\n\u003e   const { podPath, projectRoot } = options;\n\u003e \n\u003e   const podDir = join('app', podPath, 'components');\n\u003e \n\u003e -   const filePaths = findFiles(`${podDir}/**/component.{d.ts,js,ts}`, {\n\u003e +   const filePaths = findFiles(`${podDir}/navigation-menu/**/component.{d.ts,js,ts}`, {\n\u003e \n\u003e   // ...\n\u003e }\n\u003e ```\n\u003e\n\u003e That is, look for `findFiles(`, then insert the component or route name between `podDir` and `**`.\n\n\n## Compatibility\n\n- Node.js v18 or above\n\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\nIf you have an open-sourced app or addon 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## 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-pod-to-octane","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijlee2%2Fember-codemod-pod-to-octane","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlee2%2Fember-codemod-pod-to-octane/lists"}