1.0.6 • Published 2 years ago
tobackend-cli v1.0.6
CLI for suni
Installation
npm install -g suni-cliGenerate service
Make sure you are under src/modules directory
cd <path-to-project>/src/modulesRun command
suni service --model <model-name> <service-name>For example:
suni service --model User user-serviceGenerate new model
Make sure you are under service directory
cd <path-to-project>/src/modules/<service-name>Run command
suni model <model-name> <type>There, type is one of sql, dynamo
For example:
suni model User sqlThis command should generate models/User.ts and providers/database/sequelize/models/UserModel.ts.
Generate new repository
Make sure you are under service directory
suni repo <model-name>For example:
suni repo UserThis command should generate repositories/interfaces/UserRepository.ts and repositories/UserRepositoryImpl.ts.
Generate single usecase
Make sure you are under service directory
suni usecase single <usecase-name>For example:
suni usecase single MyUseCaseThis command should generate useCases/interfaces/MyUseCase.ts and useCases/MyUseCaseImpl.ts.
Generate CLRUD usecases (Create, List, Retrieve, Update, Delete)
Make sure you are under service directory
suni usecase clrud <model-name>For example:
suni usecase clrud UserThis command should generate interfaces and implementations for creating/listing/retrieving/updating/deleting a model.