sapegin / mrm

Codemods for your project config files
https://mrm.js.org/
MIT License
1.61k stars 78 forks source link

Aliases from presets #204

Closed MattBodey closed 1 year ago

MattBodey commented 2 years ago

I'm unsure as to if this is a bug or a feature request, but I cannot work out if currently it is possible to provide aliases with a preset.

Expected behaviour:

I would expect that adding a config.json at the root of the preset would allow this alias to be called when specifying the preset

currently adding a config.json of

{
  "aliases": {
    "test": ["gitignore"]
  }
}

and then running

npx mrm --preset my-preset

returns a list of tasks, without the aliases

running npx mrm test --preset my-preset

returns

Cannot call task “test”.
Make sure your task module exports a function.

I'm currently working around this my providing a task that iterates over all the other tasks, but this feels like something that should be handled by config.