2.0.4 • Published 3 years ago

generator-anyms-ms v2.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Install Yoeman Globally

  • First you must have Yeoman installed globally
     ```
       npm install -g yo
     ```

To link generators locally -

  • To link the generators locally use command
     ```
       npm link
     ```

To check available generators -

  • To check the available generators use command
     ```
       yo --generators
     ```

To generate new Micro-service

  • This command will generate all the basic files needed for the boilerplate code
  • To generate new micro-service use command
     ```
       yo softobiz-ms app
     ```
  • Enter the necessary information when prompted

To generate Rest-API

  • This command will generate all the files you need to create Rest-API
  • To generate Rest-API use command
     ```
       yo softobiz-ms:rest <name> [options]
     ```

    Example:

    yo softobiz-ms:rest Product

Dependency Flow-

  • domain
  • model
  • mapper
  • irepository
  • sql-repositories
  • dto
  • error
  • command
  • query
  • controller
  • use-cases-module

Generate Domain Layer

  • Domain layer includes Aggregate-root, Entity and Value Objects.
  • Follow the same naming convention for all cli-commands.

Generate new aggregate

  • To generate aggregate use command

    ```
      yo softobiz-ms:aggregate <name> [options]
    ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse
    -p--parent# The optional sub folder inside domain folder in which the template needs to be generated

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:aggregate Product

Generate new entity

  • To generate entity use command

    ```
      yo softobiz-ms:entity <name> [options]
    ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse
    -p--parent# The optional sub folder inside domain folder in which the template needs to be generated

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:entity Product
    yo softobiz-ms:entity images -p Product

Generate new value-object

  • To generate value-object use command

     ```
       yo softobiz-ms:valueObject <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse
    -p--parent# The optional sub folder inside domain folder in which the template needs to be generated

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:valueObject Product
    yo softobiz-ms:valueObject dimension -p Product

Infrastrucutre Layer

  • This layer includes models, mappers, irepositories, sql-repositories.
  • Follow the above order to create infrastructure layer commands.
  • Follow the same naming convention for all cli-commands.

Generate new model

  • To generate a new model use command

     ```
       yo softobiz-ms:model <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:model Product

Generate new mapper

  • To generate a new mapper use command

     ```
       yo softobiz-ms:mapper <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:mapper Product

Generate new irepository

  • To generate a new irepository use command

     ```
       yo softobiz-ms:irepository <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:irepository Product

Generate new sql-repositories

  • To generate a new sql-repositories use command

     ```
       yo softobiz-ms:sql-repositories <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:sql-repositories Product

Application Layer

  • This layer includes dto, error, commands, query, controller, use-cases-module.
  • Follow the same naming convention for all cli-commands.

Generate new Dto

  • To generate a new dto use command

     ```
       yo softobiz-ms:dto <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:dto Product 

Generate new Error file

  • To generate a new error-file use command

     ```
       yo softobiz-ms:error <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:error Product 

Generate new command

  • To generate a new command use-

     ```
       yo softobiz-ms:command <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse
    -c--command# The optional sub command inside commands folder in which the template needs to be generated

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:command Product 
    yo softobiz-ms:command update -c Product 

Generate new query

  • To generate a new query use command-

     ```
       yo softobiz-ms:query <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse
    -q--query# The optional sub query inside queries folder in which the template needs to be generated

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:query Product 
    yo softobiz-ms:query getAll --q Product 

Generate new controller

  • To generate a new controller use command

     ```
       yo softobiz-ms:controller <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:controller Product 

Generate new use-cases-module

  • To generate a new use-cases-module use command

     ```
       yo softobiz-ms:use-cases-module <name> [options]
     ```

    Options:

    AliasOptionDescriptionDefault
    -h--help# Print the generator's options and usage
    --skip-cache# Do not remember prompt answersfalse
    --skip-install# Do not automatically install dependenciesfalse
    --force-install# Fail on install dependencies errorfalse

    Arguments:

    Arg NameDescriptionTypeRequired
    nameThe name of the object that needs to be createdStringtrue

    Example:

    yo softobiz-ms:use-cases-module Product 
2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago