{"id":15015749,"url":"https://github.com/ignacemaes/ember-codemod-template-tag","last_synced_at":"2025-04-12T09:32:31.229Z","repository":{"id":204327000,"uuid":"711441600","full_name":"IgnaceMaes/ember-codemod-template-tag","owner":"IgnaceMaes","description":"Codemod to convert Glimmer components to the \u003ctemplate\u003e tag authoring format in .gjs and .gts","archived":false,"fork":false,"pushed_at":"2024-07-19T14:59:11.000Z","size":132,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T05:08:04.734Z","etag":null,"topics":["codemod","ember","gjs","gts"],"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/IgnaceMaes.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-10-29T09:32:38.000Z","updated_at":"2024-07-19T14:58:48.000Z","dependencies_parsed_at":"2024-07-19T16:50:12.994Z","dependency_job_id":"1d401da6-099d-4db5-bc43-26b00234ebd1","html_url":"https://github.com/IgnaceMaes/ember-codemod-template-tag","commit_stats":{"total_commits":59,"total_committers":3,"mean_commits":"19.666666666666668","dds":0.05084745762711862,"last_synced_commit":"6a4c40190de20fb995ee97fa30b1f46851107245"},"previous_names":["ignacemaes/ember-codemod-template-tag"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnaceMaes%2Fember-codemod-template-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnaceMaes%2Fember-codemod-template-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnaceMaes%2Fember-codemod-template-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IgnaceMaes%2Fember-codemod-template-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IgnaceMaes","download_url":"https://codeload.github.com/IgnaceMaes/ember-codemod-template-tag/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248546227,"owners_count":21122274,"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","gjs","gts"],"created_at":"2024-09-24T19:47:52.766Z","updated_at":"2025-04-12T09:32:30.902Z","avatar_url":"https://github.com/IgnaceMaes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![This project uses GitHub Actions for continuous integration.](https://github.com/IgnaceMaes/ember-codemod-template-tag/actions/workflows/ci.yml/badge.svg)](https://github.com/IgnaceMaes/ember-codemod-template-tag/actions/workflows/ci.yml)\n\n# ember-codemod-template-tag\n\nCodemod to convert Glimmer components to the `\u003ctemplate\u003e` tag authoring format in `.gjs` and `.gts`.\n\n\u003e [!WARNING]\n\u003e This codemod is not actively being worked on as there is now [an official codemod maintained within the Embroider project](https://github.com/embroider-build/embroider/pull/1842).\n\n\u003e [!NOTE]\n\u003e This codemod is far from feature complete. Currently it only handles converting `*-test.js` files which use the `hbs` helper.\n\n## Functionality\n\n### Features\n\n- Rewrites the `hbs` template helper to the `\u003ctemplate\u003e` tag\n- Adds imports for components and removes `hbs` import\n- Supports nested component paths (e.g. `Cards::CardHeader` will be used as `CardHeader`)\n- Adds imports for built-in helpers (`concat`, `array`, `fn`, `get`, `hash`)\n- Supports JavaScript and TypeScript\n\n### Example\n\nGiven a file `foo-test.js`:\n\n```sh\nnpx ember-codemod-template-tag --app-name example-app\n```\n\n```js\nimport { render } from '@ember/test-helpers';\nimport { hbs } from 'ember-cli-htmlbars';\nimport { module, test } from 'qunit';\nimport { setupRenderingTest } from 'example-app/tests/helpers/component-test';\n\nmodule('Integration | Component | foo', function (hooks) {\n  setupRenderingTest(hooks);\n\n  test('bar', async function (assert) {\n    await render(hbs`\u003cFoo::Bar @x={{array 1 2 3}} /\u003e`);\n  });\n});\n```\n\nThe codemod will rewrite this to `foo-test.gts`:\n\n```js\nimport { array } from '@ember/helper';\nimport Bar from 'example-app/components/foo/bar';\nimport { render } from '@ember/test-helpers';\nimport { module, test } from 'qunit';\nimport { setupRenderingTest } from 'example-app/tests/helpers/component-test';\n\nmodule('Integration | Component | foo', function (hooks) {\n  setupRenderingTest(hooks);\n\n  test('bar', async function (assert) {\n    await render(\u003ctemplate\u003e\u003cBar @x={{array 1 2 3}}/\u003e\u003c/template\u003e);\n  });\n});\n\n```\n\n\n## Usage\n\n\u003e **WARNING**\n\u003e As with most codemods, changes are made in place, meaning it will overwrite existing files. Make sure to run this codemod on a codebase that has been checked into version control to avoid losing progress.\n\n### Arguments\n\nYou must pass the app name as an argument to the codemod. This value is used to provide import statements:\n\n```sh\nnpx ember-codemod-template-tag --app-name \u003cyour-app-name\u003e\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\nnpx ember-codemod-template-tag --root \u003cpath/to/your/project\u003e\n```\n\n\u003c/details\u003e\n\n## Compatibility\n\n- Node.js v18 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%2Fignacemaes%2Fember-codemod-template-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fignacemaes%2Fember-codemod-template-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fignacemaes%2Fember-codemod-template-tag/lists"}