Skip to content

bertdeblock/ember-flat-to-nested

Repository files navigation

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
│   ...

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published