Giter VIP home page Giter VIP logo

nestjs-yalc's Introduction

Nestjs-yalc library

Nest-yalc stands for Nestjs - Yet Another Library Collection

Features

  • Support of the CrudGen filters for the GraphQL endpoints
  • Automatic runtime generation of CRUD endpoints using the NestJS dependency factory method
  • Parametrized the generation of: Resolver, Service, Dataloader, TypeORM repository based on ORM entities and DTOs.
  • Implemented JSON support for TypeORM entities by using decorators
  • Possibility to handle MySQL views (read) and their relative table (write) via the same repository
  • Custom decorators to extend the NestJS GraphQL library with features such as: field middleware, graphql-typeorm field mapping, nested field resolver with dataloader or join etc.
  • Helper methods for jest to be integrated in a monorepo solution
  • Utils classes and methods

Documentation

NPM package.json and Workspace

To handle scripts and dependencies between all the libraries of this collection we use a root package.json. At the moment it handles both the devDependencies needed to run the tests and the build process, as well as the dependencies of the libraries itself.

The npm workspace approach must be preferred by the way. It allows us to specify the dependencies and some scripts directly inside the package itself but still having the possibility of managing them from the root package.json. (see aws-sdk library for example)

Unit tests

The main package.json contain some scripts to run the unit test for all the libraries of this collection. It uses the jest projects feature in background configured by jest.config.ts by using a customized mechanism implemented in our @nest-yalc/jest library.

To run the tests with the coverage use npm run test:cov and then you can check the status of the tests by running npm run test:cov:serve Then you should be able to browse the coverage reports via: http://127.0.0.1:8080/lcov-report/

Pipeline

Currently our github pipeline checks that the linter and the tests are passing with 100% of coverage threshold

Directories and file names

the nestjs-yalc directory structure is flat to let it be integrated in other projects easily

  • tsconfig.*.json
    • tsconfig.json -> used by the compiler and the IDE
    • tsconfig.test.json -> used by jest
    • tsconfig.dev.json -> used by other dev tools such as eslint
  • test.js
  • examples/ ->
  • docs/ -> used for the the github pages markdown
  • [other_libraries]/

nestjs-yalc's People

Contributors

leogivo avatar nek97 avatar yehonal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.