1.2.0 • Published 3 years ago

ember-component-template-colocation-migrator v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

ember-component-template-colocation

This codemod will co-locate component JS and HBS as described in the Component Templates Co-location RFC.

Examples

Usage

To run the migrator on your app:

cd your/project/path
npx github:ember-codemods/ember-component-template-colocation-migrator

Flat component structure

By default, the migrator changes the classic component structure to the flat component structure.

your-project-name
├── app
│   └── components
│       ├── foo-bar
│       │   ├── baz.hbs
│       │   └── baz.js
│       ├── foo-bar.hbs
│       └── foo-bar.js
│   ...

Nested component structure

If you want to change from classic to nested, you can add the -ns flag:

cd your/project/path
npx github:ember-codemods/ember-component-template-colocation-migrator -ns

The nested component structure looks like:

your-project-name
├── app
│   └── components
│       └── foo-bar
│           ├── baz
│           │   ├── index.hbs
│           │   └── index.js
│           ├── index.hbs
│           └── index.js
│   ...

Running Tests

The tests were inspired by ember-module-migrator.

If you are contributing to this codemod, please check that all tests pass by running,

yarn test