nest-cli icon indicating copy to clipboard operation
nest-cli copied to clipboard

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

Open pumano opened this issue 8 years ago • 5 comments

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

pumano avatar Dec 06 '17 18:12 pumano

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.

thomrick avatar Dec 09 '17 12:12 thomrick

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

pumano avatar Dec 09 '17 17:12 pumano

@kamilmysliwiec how do you think about it?

pumano avatar Jan 25 '18 15:01 pumano

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

thomrick avatar Jan 25 '18 15:01 thomrick

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

thomrick avatar Apr 17 '18 20:04 thomrick