0.1.7 • Published 12 months ago

nestjs-mongoose-schematics v0.1.7

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

nestjs-mongoose-schematics

🚧 Work in progress 🦺

This is an opinionated NestJS schematics for generating Mongoose models, DTOs, controllers, services, and repositories.

Usage

# Install the schematics
npm i --save-dev nestjs-mongoose-schematics

# Generate a new resource (controller + service + repository)
nest g -c nestjs-mongoose-schematics resource

Todo list for the alpha release

  • Basic entity with Mongoose Schema
  • Basic DTO with class validators annotations
  • Better controllers and services
  • Install NPM dependencies
  • Configure Mongoose module
  • Configure Mongoose feature
  • Use id instead of _id in responses
  • Create repository class
  • Swagger annotations
  • Install global pipe ValidationPipe in main.ts
  • Install Swagger UI in main.ts
  • Unit tests with automock
  • Unit test factories with Fishery

Todo list for the beta release

  • Support nested objects
  • Support references (relations)
  • Support soft deletes

Development

Create a new NestJS project, which will be ignored by the .gitignore file.

# Link the local development build of the schematics
cd nestjs-mongoose-schematics
npm install
npm build
npm link

# Create new example application inside the current directory
nest new example -p npm
cd example
npm i @nestjs/mongoose mongoose
npm link nestjs-mongoose-schematics

Run the schematics:

nest g -c nestjs-mongoose-schematics resource --debug
0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago