@rxap/plugin-nestjs
TypeScript icon, indicating that this package has built-in type declarations

20.1.4 • Public • Published

This npm package provides generators and executors for NestJS applications within an Nx workspace. It helps streamline the setup of NestJS projects with features like Swagger, Sentry, health indicators, and standardized configurations. It also includes executors for generating package.json files and Swagger documentation.

npm version commitizen friendly styled with prettier Libraries.io dependency status for latest release, scoped npm package npm NPM

Installation

Add the package to your workspace:

yarn add @rxap/plugin-nestjs

Execute the init generator:

yarn nx g @rxap/plugin-nestjs:init

Guides

Application

Standalone

Use the nx generate to create a new application:

NAME=app
nx g @nx/nest:application \
  --name=service-$NAME \
  --directory service/$NAME \
  --projectNameAndRootFormat as-provided \
  --tags service,nest

Initialize the application:

nx g @rxap/plugin-nestjs:init-application \
  --project service-$NAME \
  --cleanup \
  --generateMain \
  --overwrite

Standalone Microservice

Use the nx generate to create a new standalone microservice:

nx g @rxap/plugin-nestjs:frontend-microservice --name $NAME

Frontend Microservice

Run the following command to create a new frontend microservice:

nx g @rxap/plugin-nestjs:frontend-microservice --feature $FEATURE --frontend $PROJECT

Feature Microservice

Run the following command to create a new feature microservice:

nx g @rxap/plugin-nestjs:feature-microservice --feature $FEATURE --frontend $PROJECT

Generators

init

init generator

nx g @rxap/plugin-nestjs:init
Option Type Default Description
project string
projects array
skipFormat boolean false
overwrite boolean false Whether to overwrite existing files
skipProjects boolean false Whether to skip executing project specific initialization

init-library

init-library generator

nx g @rxap/plugin-nestjs:init-library
Option Type Default Description
project string
projects array
overwrite boolean false Whether to overwrite existing files
skipFormat boolean false
skipProjects boolean false Whether to skip executing project specific initialization
targets object

init-application

init-application generator

nx g @rxap/plugin-nestjs:init-application
Option Type Default Description
project string
projects array
sentry boolean true Whether this service should use sentry
skipFormat boolean false
swagger boolean true Whether this service should use swagger
swaggerLive boolean false Whether this service should start a swagger live server
generateMain boolean false Whether the main file should be generated
healthIndicator boolean true Whether this service should use a health indicator
healthIndicatorList array A list of health indicators
validator boolean true Whether this service use the ValidationPipe
platform string express
port number The default port where the server is listens
apiPrefix
pluginBuildInfoOptions object
pluginDockerOptions object
sentryDsn string Default sentry dsn
overwrite boolean false Whether to overwrite existing files
jwt boolean false Whether the application should use jwt
openApi boolean false Whether the application should use openApi as client
skipProjects boolean false Whether to skip executing project specific initialization
apiConfigurationFile string The api configuration file to use
standalone boolean false Whether the nest service should be standalone
typeorm string none
bootstrap string monolithic
transport string none The transport to use for microservices communication
minio boolean false Whether the application should use minio
openai boolean false Whether the application should use openai

swagger

swagger generator

nx g @rxap/plugin-nestjs:swagger
Option Type Default Description
project string The name of the project.
overwrite boolean
standalone boolean false Whether the nest service should be standalone

sentry

sentry generator

nx g @rxap/plugin-nestjs:sentry
Option Type Default Description
project string The name of the project.
dsn string Default sentry dsn
required boolean Whether or not the sentry dsn should be required to start the application
overwrite boolean false Whether to overwrite existing files

validator

validator generator

nx g @rxap/plugin-nestjs:validator
Option Type Default Description
project string The name of the project.
overwrite boolean

open-api

open-api generator

nx g @rxap/plugin-nestjs:open-api
Option Type Default Description
project string
overwrite boolean

jwt

jwt generator

nx g @rxap/plugin-nestjs:jwt
Option Type Default Description
project string
overwrite boolean

health-indicator

health-indicator generator

nx g @rxap/plugin-nestjs:health-indicator
Option Type Default Description
name string The name of the health indicator class
project string The name of the project.
overwrite boolean

health-indicator-init

health-indicator-init generator

nx g @rxap/plugin-nestjs:health-indicator-init
Option Type Default Description
project string The name of the project.
overwrite boolean

microservice

microservice generator

nx g @rxap/plugin-nestjs:microservice
Option Type Default Description
name string The name of microservice
directory string The directory to create the microservice in
sentry boolean true Whether this service should use sentry
skipFormat boolean false
swagger boolean true Whether this service should use swagger
swaggerLive boolean false Whether this service should start a swagger live server
generateMain boolean Whether the main file should be generated
healthIndicator boolean true Whether this service should use a health indicator
healthIndicatorList array A list of health indicators
validator boolean true Whether this service use the ValidationPipe
platform string express
port number The default port where the server is listens
apiPrefix
sentryDsn string Default sentry dsn
overwrite boolean false Whether to overwrite existing files
jwt boolean false Whether the application should use jwt
openApi boolean false Whether the application should use openApi as client
apiConfigurationFile string The api configuration file to use
standalone boolean false Whether the nest service should be standalone

feature-microservice

feature-microservice generator

nx g @rxap/plugin-nestjs:feature-microservice
Option Type Default Description
feature string The feature of the frontend project
sentry boolean true Whether this service should use sentry
skipFormat boolean false
swagger boolean true Whether this service should use swagger
swaggerLive boolean false Whether this service should start a swagger live server
generateMain boolean Whether the main file should be generated
healthIndicator boolean true Whether this service should use a health indicator
healthIndicatorList array A list of health indicators
validator boolean true Whether this service use the ValidationPipe
platform string express
port number The default port where the server is listens
sentryDsn string Default sentry dsn
overwrite boolean false Whether to overwrite existing files
jwt boolean false Whether the application should use jwt
openApi boolean false Whether the application should use openApi as client
apiConfigurationFile string The api configuration file to use
standalone boolean false Whether the nest service should be standalone

frontend-microservice

frontend-microservice generator

nx g @rxap/plugin-nestjs:frontend-microservice
Option Type Default Description
frontend string The name of frontend project
feature string The feature of the frontend project
sentry boolean true Whether this service should use sentry
skipFormat boolean false
swagger boolean true Whether this service should use swagger
swaggerLive boolean false Whether this service should start a swagger live server
generateMain boolean Whether the main file should be generated
healthIndicator boolean true Whether this service should use a health indicator
healthIndicatorList array A list of health indicators
validator boolean true Whether this service use the ValidationPipe
platform string express
port number The default port where the server is listens
sentryDsn string Default sentry dsn
overwrite boolean false Whether to overwrite existing files
jwt boolean false Whether the application should use jwt
openApi boolean false Whether the application should use openApi as client
apiConfigurationFile string The api configuration file to use
standalone boolean false Whether the nest service should be standalone

Executors

package-json

package-json executor

Option Type Default Description
dependencies array
includeLocalProjects boolean false Include local projects in the package.json file, if they have a package.json file

swagger-generate

swagger-generate executor

Option Type Default Description
buildTarget string

Package Sidebar

Install

npm i @rxap/plugin-nestjs

Weekly Downloads

250

Version

20.1.4

License

GPL-3.0-or-later

Unpacked Size

364 kB

Total Files

210

Last publish

Collaborators

  • badry.muenker
  • mmuenker