Skip to content

Latest commit

 

History

History
90 lines (71 loc) · 2.14 KB

README.md

File metadata and controls

90 lines (71 loc) · 2.14 KB

Ember Flat to Nested

CI

Transforms a flat colocated component structure to a nested colocated component structure.

  • Works for apps and addons (v1, v2 and in-repo addons)
  • Supports reverting to a flat colocated component structure
  • Ignores component files that already comply to the desired component structure
  • Takes into account CSS module files (in case you are using ember-css-modules)

NOTE: Use ember-component-template-colocation-migrator if you want to transform a classic component structure to a flat or nested colocated component structure.

✅ Compatibility

  • Node.js v18 or above

👨‍💻 Usage

Flat to Nested

cd your/app-or-addon/path
npx github:bertdeblock/ember-flat-to-nested

Before

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

After

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

Nested to Flat

cd your/app-or-addon/path
npx github:bertdeblock/ember-flat-to-nested --revert

Before

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

After

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