
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.