![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
ember-codemod-template-tag
Advanced tools
Codemod to convert Glimmer components to the <template> tag authoring format in .gjs and .gts
Codemod to convert Glimmer components to the <template>
tag authoring format in .gjs
and .gts
.
NOTE This codemod is far from feature complete. Currently it only handles converting
*-test.js
files which use thehbs
helper. PRs welcome!
hbs
template helper to the <template>
taghbs
importCards::CardHeader
will be used as CardHeader
)concat
, array
, fn
, get
, hash
)Given a file foo-test.js
:
npx ember-codemod-template-tag --app-name example-app
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'example-app/tests/helpers/component-test';
module('Integration | Component | foo', function (hooks) {
setupRenderingTest(hooks);
test('bar', async function (assert) {
await render(hbs`<Foo @x={{array 1 2 3}} />`);
});
});
The codemod will rewrite this to:
import { array } from '@ember/helper';
import Foo from 'example-app/components/foo';
import { render } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'example-app/tests/helpers/component-test';
module('Integration | Component | foo', function (hooks) {
setupRenderingTest(hooks);
test('bar', async function (assert) {
await render(<template><Foo @x={{array 1 2 3}}/></template>);
});
});
WARNING 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.
You must pass the app name as an argument to the codemod. This value is used to provide import statements:
npx ember-codemod-template-tag --app-name <your-app-name>
Pass --root
to run the codemod somewhere else (i.e. not in the current directory).
npx ember-codemod-template-tag --root <path/to/your/project>
The codemod is designed to cover typical cases. It is not designed to cover one-off cases.
To better meet your needs, consider cloning the repo and running the codemod locally.
cd <path/to/cloned/repo>
# Compile TypeScript
pnpm build
# Run codemod
./dist/bin/ember-codemod-template-tag.js --root <path/to/your/project>
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Codemod to convert Glimmer components to the <template> tag authoring format in .gjs and .gts
The npm package ember-codemod-template-tag receives a total of 1 weekly downloads. As such, ember-codemod-template-tag popularity was classified as not popular.
We found that ember-codemod-template-tag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.