nestjs / nest-cli

CLI tool for Nest applications 🍹
https://nestjs.com
Other
1.97k stars 394 forks source link

[FEATURE] Add alias to nest g component / module / controller and etc #41

Closed pumano closed 6 years ago

pumano commented 6 years ago

It's will be helpful to add aliases for generating: component : nest g c Cat module : nest g m Cat controller : nest g ct Cat pipe: nest g p Cat middleware : nest g md Cat guard: nest g g Cat - it's not implemented (will be good to add it) gateway: nest g gt Cat

thomrick commented 6 years ago

Hey @pumano The idea is good but it does not respect CLI tool command schema like angular-cli. I don't think about adding these aliases.

pumano commented 6 years ago

That idea come from angular-cli. I use ng g c Super for generate SuperComponent

pumano commented 6 years ago

@kamilmysliwiec how do you think about it?

thomrick commented 6 years ago

Don't be shy ! Contribute and make a pull request ;-)

thomrick commented 6 years ago

Please upgrade to 4.0.0 or 5.0.0 depends on the Nestjs major version you want to use

use these several aliases:

const SCHEMATICS = [
  { value: 'class', alias: 'cl' },
  { value: 'controller', alias: 'co' },
  { value: 'decorator', alias: 'd' },
  { value: 'exception', alias: 'e' },
  { value: 'filter', alias: 'f' },
  { value: 'gateway', alias: 'ga' },
  { value: 'guard', alias: 'gu' },
  { value: 'interceptor', alias: 'i' },
  { value: 'middleware', alias: 'mi' },
  { value: 'module', alias: 'mo' },
  { value: 'pipe', alias: 'p' },
  { value: 'service', alias: 's' }
];

maybe need to be updated