{"id":15015856,"url":"https://github.com/ijlee2/ember-codemod-remove-inject-as-service","last_synced_at":"2026-04-02T19:03:18.098Z","repository":{"id":235484384,"uuid":"790606126","full_name":"ijlee2/ember-codemod-remove-inject-as-service","owner":"ijlee2","description":"Codemod to remove `inject as service`","archived":false,"fork":false,"pushed_at":"2026-03-30T13:38:46.000Z","size":372,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-30T15:26:27.583Z","etag":null,"topics":["codemod","ember","ember-codemod","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-23T07:33:57.000Z","updated_at":"2026-03-30T13:38:39.000Z","dependencies_parsed_at":"2026-01-28T15:03:28.209Z","dependency_job_id":null,"html_url":"https://github.com/ijlee2/ember-codemod-remove-inject-as-service","commit_stats":null,"previous_names":["ijlee2/ember-codemod-remove-inject-as-service"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/ijlee2/ember-codemod-remove-inject-as-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-remove-inject-as-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-remove-inject-as-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-remove-inject-as-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-remove-inject-as-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijlee2","download_url":"https://codeload.github.com/ijlee2/ember-codemod-remove-inject-as-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlee2%2Fember-codemod-remove-inject-as-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","ember-codemod","emberjs"],"created_at":"2024-09-24T19:48:03.608Z","updated_at":"2026-04-02T19:03:18.083Z","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-remove-inject-as-service/actions/workflows/ci.yml/badge.svg)](https://github.com/ijlee2/ember-codemod-remove-inject-as-service/actions/workflows/ci.yml)\n\n# ember-codemod-remove-inject-as-service\n\n_Codemod to remove `inject as service`_\u003csup\u003e1\u003c/sup\u003e\n\n1. [Features](#features)\n1. [Usage](#usage)\n    - [Arguments](#arguments)\n    - [Limitations](#limitations)\n1. [Compatibility](#compatibility)\n1. [Contributing](#contributing)\n1. [License](#license)\n\n\u003csup\u003e1. `@ember/service` provides `service` since [Ember 4.1](https://blog.emberjs.com/ember-4-1-released/). `inject`, which became an alias to `service`, is [planned to be deprecated in v6](https://rfcs.emberjs.com/id/1001-deprecate-named-inject).\u003c/sup\u003e\n\n\n## Features\n\nThe codemod helps you standardize how you inject services:\n\n- Replace `inject` with `service`\u003csup\u003e1\u003c/sup\u003e\n- Replace `!` with `declare` in TS files\u003csup\u003e2\u003c/sup\u003e\n- Remove `private` and `readonly` keywords in TS files\u003csup\u003e2\u003c/sup\u003e\n\nIt preserves your code whenever possible.\n\n\u003csup\u003e1. Replaces `inject as ...` and `service as ...`, too.\u003c/sup\u003e\n\n\u003csup\u003e2. Matches [the style shown in the Ember Guides](https://guides.emberjs.com/v5.8.0/typescript/core-concepts/services/#toc_using-services).\u003c/sup\u003e\n\n\n## Usage\n\nStep 1. Quickly migrate.\n\n```sh\ncd \u003cpath/to/your/project\u003e\npnpx ember-codemod-remove-inject-as-service \u003carguments\u003e\n```\n\nStep 2. Fix formatting issues.\n\n- Optional: Do a find-and-replace-all in TS files, if you want to place `@service` and `declare` on the same line whenever possible.\n\n    - Find: `@service(\\(.*\\))?[\\n\\s]+declare`\n    - Replace: `@service$1 declare`\n\n- Run `lint:js:fix` (i.e. autofix from `eslint` and `prettier`).\n\n\n\n### Arguments\n\nYou must pass `--type` to indicate what type of project you have.\n\n```sh\npnpx ember-codemod-remove-inject-as-service --type app\npnpx ember-codemod-remove-inject-as-service --type v1-addon\npnpx ember-codemod-remove-inject-as-service --type v2-addon\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eOptional: Specify the project root\u003c/summary\u003e\n\nPass `--root` to run the codemod somewhere else (i.e. not in the current directory).\n\n```sh\npnpx ember-codemod-remove-inject-as-service --root \u003cpath/to/your/project\u003e\n```\n\n\u003c/details\u003e\n\n\n### Limitations\n\nThe codemod is designed to cover typical cases. It is not designed to cover one-off cases.\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-remove-inject-as-service.js --root \u003cpath/to/your/project\u003e\n```\n\n\n## Compatibility\n\n- Node.js v22 or above\n\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\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-remove-inject-as-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijlee2%2Fember-codemod-remove-inject-as-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlee2%2Fember-codemod-remove-inject-as-service/lists"}