fastify-decorators

Set of Typescript decorators to build Fastify server with controllers, services and hooks

MIT License

Downloads
26.2K
Stars
281
Committers
8

Bot releases are hidden (Show)

fastify-decorators -

Published by L2jLiga almost 4 years ago

Added

  • FastifyInstanceWithController interface for testing (#93)
fastify-decorators -

Published by L2jLiga almost 4 years ago

Added

  • configureControllerTest decorate FastifyInstance with controller property

Changed

  • Huge documentation rework
fastify-decorators -

Published by L2jLiga almost 4 years ago

Fixed

  • FastifyInstance not available for injection in tests
fastify-decorators -

Published by L2jLiga almost 4 years ago

Added

  • Hooks and error handlers support for stateless controllers (ControllerType.REQUEST)
  • Support for async services testing

Fixed

  • Hooks override in RequestHandler when hook with same name defined multiple times
  • Invalid RequestHandler constructor call when it has hooks
  • RequestHandler / Controller options mutation
  • Bootstrap failure when async services injected with @Inject
fastify-decorators -

Published by L2jLiga almost 4 years ago

Fixed

  • Warning when install due to unsatisfied peer dependency - fastify-plugin
fastify-decorators -

Published by L2jLiga almost 4 years ago

Added

  • support for services that need an async setup (#58)
fastify-decorators -

Published by L2jLiga almost 4 years ago

Fixed

  • Bootstrap controllers properly
  • Remove a global flag from mask if presents
fastify-decorators -

Published by L2jLiga about 4 years ago

Changed

  • Use fastify-plugin helper for bootstrap
  • Use import type from TypeScript 3.8 (for TS < 3.8 users do .d.ts downlevel)
fastify-decorators -

Published by L2jLiga about 4 years ago

Fixed

  • Avoid redundant wrapping when configuring mocks for testing
fastify-decorators -

Published by L2jLiga about 4 years ago

Fixed

  • Request handlers decorators (GET, POST, PUT etc) ignore second argument:
    class Ctrl {
      @GET('/', { schema: { body: { type: 'string' } } }) // fastify options were ignored
      get() {}
    }
    
fastify-decorators -

Published by L2jLiga about 4 years ago

Added

  • @ErrorHandler support for request handlers
  • @Hook support for request handlers

Changed

  • Do not register empty error handlers
fastify-decorators -

Published by L2jLiga about 4 years ago

Fixed

  • Cannot read property 'get' of undefined when using configureControllerTest on class with dependencies provided via @Inject decorator.
fastify-decorators -

Published by L2jLiga about 4 years ago

Added

  • More strict check for @Controller decorator

Fixed

  • Possible call stack size exceeded when using autobootstrap
fastify-decorators - v3.0.0

Published by L2jLiga over 4 years ago

Added

  • @ErrorHandler decorator for error handling within controllers

Changed

  • BREAKING: move to Fastify 3

Fixed

  • package.json was missed in fastify-decorators/testing
fastify-decorators - v3.0.0-1

Published by L2jLiga over 4 years ago

Fixed

  • package.json was missed in fastify-decorators/testing
  • wrong url in documentation
fastify-decorators - v2.0.1

Published by L2jLiga over 4 years ago

Fixed

  • package.json was missed in fastify-decorators/testing
  • configureControllerTest does not work properly due fastify#2344
fastify-decorators - v3.0.0-0

Published by L2jLiga over 4 years ago

Added

  • @ErrorHandler decorator for error handling within controllers

Changed

  • BREAKING: move to Fastify 3
fastify-decorators - v2.0.0

Published by L2jLiga over 4 years ago

Added

  • Dependency injection
  • APIs and documentation for testing
  • New bootstrap options
    • directory, mask - common replacement for old bootsrap options
    • controllers - used to specify list of controllers to bootstrap
  • Overloads to controller and requests handlers, now they can accept string instead of configuration object
  • Controller can accept configuration in two different ways
    • As a single object describing controller configuration
    • As a string with route
  • Request handlers can accept configuration in three different ways
    • As a single object describing controller configuration
    • As a string with route
    • As a string with route and route options
  • Plugin for JetBrains IDE (WebStorm, IDEA, ...)
  • Option to skip broken modules from attempts to bootstrap

Changed

  • BREAKING CHANGE: symbols not exported anymore
  • BREAKING CHANGE: minimal supported version of node is 10.14
  • Throw human-friendly error when errors happened due initialization
  • Specify module type in package.json

Fixed

  • Correctly handle all arguments passed to handler (#9)
  • Incorrect links in the README.md when publish on NPM
  • Typos in documentation

Removed

  • controllersDirectory, controllersMask, handlersDirectory and handlersMask bootstrap options
  • AbstractController in favor of Dependency Injection
  • hooks initialization in REQUESTS controller type
fastify-decorators -

Published by L2jLiga over 4 years ago

Added

  • Option to specify list of controllers to bootstrap
fastify-decorators -

Published by L2jLiga over 4 years ago

Added

  • User friendly error when trying to bootstrap invalid module
  • Option to skip broken modules to prevent crash when trying to bootstrap invalid module
  • APIs and documentation for testing

Fixed

  • Several typos in documentation and comments
Package Rankings
Top 2.96% on Npmjs.org
Badges
Extracted from project README's
Fastify decorators npm version npm License: MIT Node.js CI codecov
Related Projects