diff --git a/README.md b/README.md index 7e0bb97..569abc2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ import { GetMapping } from '@litstack/core/dist/http/mappings'; @LitComponent() export class AppComponent { - private message = 'Hello world!'; + private message = 'Hello World!'; @GetMapping({ path: '' // GET / is routed to onHello @@ -56,6 +56,8 @@ export class AppComponent { Test your components [using supertest methods](https://github.com/visionmedia/supertest) and the Litstack TestBed: ```typescript +import { TestBed, LitComponentTest } from '@litstack/core/dist/testing'; + describe('AppComponent', () => { let component: LitComponentTest; @@ -72,15 +74,16 @@ describe('AppComponent', () => { it('should return a welcome message', (done) => { - component.get('/') - .expect(200) - .expect((res) => { - expect(res.body.message).to.equal('Hello World!'); - }) - .end((err, res) => { - if (err) return done(err); - done(); - }); + component + .get('/') + .expect(200) + .expect((res) => { + expect(res.body.message).to.equal('Hello World!'); + }) + .end((err, res) => { + if (err) return done(err); + done(); + }); }); }); ``` diff --git a/lib/compiler/classes/compiler.class.ts b/lib/compiler/classes/compiler.class.ts index c9cbced..f3a70de 100644 --- a/lib/compiler/classes/compiler.class.ts +++ b/lib/compiler/classes/compiler.class.ts @@ -4,10 +4,12 @@ import express = require('express'); import BodyParser = require('body-parser'); -import { Application } from 'express'; +import { Application, RequestHandler } from 'express'; + import { CoreCompiler, ILitComponent, ILitModule } from '../utils/compiler.utils'; import { HttpServer } from '../../http/utils/http.utils'; +import { RequestMethod } from '../../http/enums/request-method.enum'; import { HttpResponse } from '../../http/classes/response.class'; import { Injector } from './injector.class'; @@ -47,8 +49,6 @@ export class ServiceCompiler extends CoreCompiler { */ private listen(port: string | number): void { - port = process.env.PORT || port; - this.server = this.app.listen(port, this.greet(port)); } @@ -118,8 +118,10 @@ export class ServiceCompiler extends CoreCompiler { * @param {ILitComponent} aComponent * @param {string} name */ - private getHandler(aComponent: ILitComponent, name: string): Function { - return (req: any, res: any) => { + private getHandler(aComponent: ILitComponent, name: string): RequestHandler { + return (req: express.Request, + res: express.Response, + next: express.NextFunction): RequestHandler => { // include metadata to send with response const meta: Object = Injector.getAll( @@ -127,10 +129,10 @@ export class ServiceCompiler extends CoreCompiler { name ); - aComponent[name](req, new HttpResponse(res, meta)); + return aComponent[name](req, new HttpResponse(res, meta)); }; } - + /** * @function addRoute * @param {string} method @@ -145,7 +147,7 @@ export class ServiceCompiler extends CoreCompiler { * POST /some/route * adds handler aComponent.someMethod */ - private addRoute(method: string, path: string, aComponent: ILitComponent, name: string): void { + private addRoute(method: RequestMethod, path: string, aComponent: ILitComponent, name: string): void { this.app[method]('/' + path, this.getHandler(aComponent, name)); } @@ -167,7 +169,7 @@ export class ServiceCompiler extends CoreCompiler { // get a new instance of the component const aComponent: ILitComponent = Injector.resolve(component); - const reqMethod: string = Injector.get(aComponent, 'method', null, method); + const reqMethod: RequestMethod = Injector.get(aComponent, 'method', null, method); // check if method is elligible for route and add if(reqMethod) { @@ -193,9 +195,9 @@ export class ServiceCompiler extends CoreCompiler { */ private addExportedComponents(path: string, includes: ILitModule[]): void { includes.forEach( - (Component: ILitComponent) => { + (Component: ILitComponent): void => { this.getMethodList(Component).forEach( - (method: string) => this.addRouteFromMethod(Component, method, path) + (method: string): void => this.addRouteFromMethod(Component, method, path) ); } ); @@ -210,7 +212,7 @@ export class ServiceCompiler extends CoreCompiler { * logs: Application running on port 1000 */ private greet(port: string | number): Function { - return () => { + return (): void => { this.console.log("Application running on port " + port); } } diff --git a/lib/compiler/decorators/component.decorator.ts b/lib/compiler/decorators/component.decorator.ts index 93365b4..8d5b332 100644 --- a/lib/compiler/decorators/component.decorator.ts +++ b/lib/compiler/decorators/component.decorator.ts @@ -10,7 +10,7 @@ import { Injector } from "./../classes/injector.class"; * @constructor */ export const LitComponent = () : GenericClassDecorator> => { - return (target: Type) => { + return (target: Type): void => { Injector.set(target); }; }; \ No newline at end of file diff --git a/lib/compiler/decorators/module.decorator.spec.ts b/lib/compiler/decorators/module.decorator.spec.ts index b8c5cb7..4124a95 100644 --- a/lib/compiler/decorators/module.decorator.spec.ts +++ b/lib/compiler/decorators/module.decorator.spec.ts @@ -6,10 +6,9 @@ import { LitModule } from '../..'; describe('Class: Injector', () => { it('should allow passing exports to modules', () => { + @LitModule({ - exports: [ - 'test' - ] + exports: [] }) class TestModule { diff --git a/lib/compiler/decorators/module.decorator.ts b/lib/compiler/decorators/module.decorator.ts index a39674a..1faf5fd 100644 --- a/lib/compiler/decorators/module.decorator.ts +++ b/lib/compiler/decorators/module.decorator.ts @@ -1,22 +1,26 @@ +/** + * module.decorator + */ +import { ILitComponent, ILitModule } from '../utils/compiler.utils'; +import { GenericClassDecorator, Type } from "../../utils/core.util"; +import { Injector } from "./../classes/injector.class"; + /** * @TODO move this into its own file! */ export interface LitModuleConfig { - path?: string; - imports?: any[]; - exports?: any[]; + path?: string; + imports?: ILitModule[]; + exports?: ILitComponent[]; } -import { GenericClassDecorator, Type } from "../../utils/core.util"; -import { Injector } from "./../classes/injector.class"; - /** * Classes decorated with the `@LitModule` decorator are stored within the injector and can be resolved by it. * @returns {GenericClassDecorator>} * @constructor */ export const LitModule = (config: LitModuleConfig = {}) : GenericClassDecorator> => { - return (target: Type) => { + return (target: Type): void => { config.path = config.path || ''; config.imports = config.imports || []; diff --git a/lib/compiler/decorators/service.decorator.ts b/lib/compiler/decorators/service.decorator.ts index 24fa9e8..2299174 100644 --- a/lib/compiler/decorators/service.decorator.ts +++ b/lib/compiler/decorators/service.decorator.ts @@ -10,7 +10,7 @@ import { Injector } from "./../classes/injector.class"; * @constructor */ export const LitService = () : GenericClassDecorator> => { - return (target: Type) => { + return (target: Type): void => { Injector.set(target); }; }; \ No newline at end of file diff --git a/lib/http/classes/response.class.spec.ts b/lib/http/classes/response.class.spec.ts index 4f497f1..d9d0f28 100644 --- a/lib/http/classes/response.class.spec.ts +++ b/lib/http/classes/response.class.spec.ts @@ -1,119 +1,104 @@ import { expect } from 'chai'; -import 'mocha'; import { HttpResponse } from './response.class'; +import { TestBed, LitComponentTest } from '../../testing'; +import { LitComponent } from '../..'; +import { GetMapping } from '../mappings'; +import { HttpRequest } from '..'; describe('Class: HttpResponse', () => { - let httpResponse: HttpResponse; - - // define the class - const MockRes = function(this: any) { - this.statusVal = null; - this.jsonVal = null; - this.headers = []; - }; - - MockRes.prototype.json = function(json) { - this.jsonVal = json; - return this; - }; - - MockRes.prototype.set = function(key, val) { - this.headers.push({ - key: key, - value: val - }); - return this; - }; - - MockRes.prototype.status = function(status) { - this.statusVal = status; - return this; - }; - - beforeEach(() => { - httpResponse = new HttpResponse(new MockRes()); - }); - - it('should set a produces header', () => { - - const testHeaderVal: string = 'test-value'; - const expectedHeader: { key: string, value: string } = { - key: 'Content-Type', - value: testHeaderVal - }; + let component: LitComponentTest; - httpResponse = new HttpResponse(new MockRes(), { - produces: testHeaderVal - }); + afterEach(() => { - // sending a success response - // should set the produces header - httpResponse.success({}); - - expect( - JSON.stringify(httpResponse.rawRes.headers[0]) - ).to.equal( - JSON.stringify(expectedHeader) - ); + TestBed.stop(); }); - it('should handle a successful response', () => { - - const testBody = { - message: 'test' - }; - - httpResponse.success(testBody); - - expect(httpResponse.rawRes['jsonVal']).to.equal(testBody); - expect(httpResponse.rawRes['statusVal']).to.equal(200); + it('should default success to 200', (done) => { + + @LitComponent() + class TestComponent { + + @GetMapping() + customSuccess(req, res: HttpResponse) { + res.success({}); + } + } + + component = TestBed.start(TestComponent); + component + .get('/') + .expect(200) + .end((err, res) => { + if (err) return done(err); + done(); + }); }); - it('should handle a created response', () => { - - const testBody = { - message: 'test' - }; - - httpResponse.created(testBody); - - expect(httpResponse.rawRes['jsonVal']).to.equal(testBody); - expect(httpResponse.rawRes['statusVal']).to.equal(201); + it('should return 201 for a created response', (done) => { + + @LitComponent() + class TestComponent { + + @GetMapping() + customError(req, res: HttpResponse) { + res.created([]); + } + } + + component = TestBed.start(TestComponent); + component + .get('/') + .expect(201) + .end((err, res) => { + if (err) return done(err); + done(); + }); }); - it('should handle an error with a custom status', () => { - - const testBody = { - message: 'test error' - }; - - const testStatus: number = 403; - - httpResponse.errored(testStatus, testBody); - - expect(httpResponse.rawRes['jsonVal']).to.equal(testBody); - expect(httpResponse.rawRes['statusVal']).to.equal(testStatus); - }); - - it('should default an error body to {}', () => { - - httpResponse.errored(); - - expect(JSON.stringify(httpResponse.rawRes['jsonVal'])).to.equal(JSON.stringify({})); - expect(httpResponse.rawRes['statusVal']).to.equal(500); + it('should default errors to 500', (done) => { + + @LitComponent() + class TestComponent { + + @GetMapping() + customSuccess(req, res: HttpResponse) { + res.errored(); + } + } + + component = TestBed.start(TestComponent); + component + .get('/') + .expect(500) + .end((err, res) => { + if (err) return done(err); + done(); + }); }); - it('should default an error to status 500', () => { - - const testBody = { - message: 'test error' - }; - - httpResponse.errored(null, testBody); - - expect(httpResponse.rawRes['jsonVal']).to.equal(testBody); - expect(httpResponse.rawRes['statusVal']).to.equal(500); + it('should allow setting custom error code and message', (done) => { + + @LitComponent() + class TestComponent { + + @GetMapping() + customSuccess(req: HttpRequest, res: HttpResponse) { + res.errored(401, {}); + } + } + + component = TestBed.start(TestComponent); + component + .get('/') + .expect(401) + .expect((res: HttpRequest) => { + expect(res.body.toString()).to.equal({}.toString()); + }) + .end((err, res) => { + if (err) return done(err); + done(); + }); }); }); \ No newline at end of file diff --git a/lib/http/classes/response.class.ts b/lib/http/classes/response.class.ts index 8bc7d21..af426c3 100644 --- a/lib/http/classes/response.class.ts +++ b/lib/http/classes/response.class.ts @@ -2,15 +2,23 @@ * response.class * * The HTTP response class is a wrapper for the - * http response object.s + * http response object */ + +import express = require('express'); + import { Response } from '../models/response.model'; import { Injector } from '../../compiler/classes/injector.class'; +// @TODO MOVE THIS TO ITS OWN FILE!!!! +export interface metaConfig { + produces?: string; +} + export class HttpResponse { - constructor(public rawRes: any, - public meta: any = {}) { + constructor(public response: express.Response, + private meta: metaConfig) { } setProduces(): void { @@ -20,7 +28,7 @@ export class HttpResponse { } setHeaders(key: string, val: string): void { - this.rawRes.set(key, val); + this.response.set(key, val); } /** @@ -38,7 +46,7 @@ export class HttpResponse { // set the produces header if one exists this.setProduces(); - this.rawRes.status(status).json(obj); + this.response.status(status).json(obj); } /** @@ -66,6 +74,6 @@ export class HttpResponse { * { message: 'The resource was not found on this server' } */ errored(status: number | null = null, messageObj: Object = {}): void { - this.rawRes.status(status || 500).json(messageObj); + this.response.status(status || 500).json(messageObj); } } \ No newline at end of file diff --git a/lib/http/decorators/mapping.decorator.ts b/lib/http/decorators/mapping.decorator.ts index 59c9c22..924568e 100644 --- a/lib/http/decorators/mapping.decorator.ts +++ b/lib/http/decorators/mapping.decorator.ts @@ -6,14 +6,14 @@ import { GenericClassDecorator, Type } from "../../utils/core.util"; import { Injector } from "../../compiler/classes/injector.class"; import { RequestMapping } from '../models/request-mapping.model'; - +import { RequestMethod } from '../enums/request-method.enum'; /** * Create generic request mapping method */ - const GenericMapping = (type: 'get' | 'put' | 'post' | 'patch' | 'delete'): Function => { + const GenericMapping = (type: RequestMethod): Function => { return (config: RequestMapping = {}) : Function => { - return (target: Type, propertyKey: string, descriptor: PropertyDescriptor) => { + return (target: Type, propertyKey: string, descriptor: PropertyDescriptor): void => { config.method = type; @@ -22,8 +22,8 @@ import { RequestMapping } from '../models/request-mapping.model'; }; }; -export const GetMapping = GenericMapping('get'); -export const PostMapping = GenericMapping('post'); -export const PutMapping = GenericMapping('post'); -export const PatchMapping = GenericMapping('patch'); -export const DeleteMapping = GenericMapping('delete'); \ No newline at end of file +export const GetMapping = GenericMapping(RequestMethod.GET); +export const PostMapping = GenericMapping(RequestMethod.POST); +export const PutMapping = GenericMapping(RequestMethod.PUT); +export const PatchMapping = GenericMapping(RequestMethod.PATCH); +export const DeleteMapping = GenericMapping(RequestMethod.DELETE); \ No newline at end of file diff --git a/lib/http/enums/request-method.enum.ts b/lib/http/enums/request-method.enum.ts new file mode 100644 index 0000000..82a3db9 --- /dev/null +++ b/lib/http/enums/request-method.enum.ts @@ -0,0 +1,10 @@ +/** + * request-method.enum + */ +export enum RequestMethod { + GET = 'get', + PUT = 'put', + POST = 'post', + PATCH = 'patch', + DELETE = 'delete' +} \ No newline at end of file diff --git a/lib/http/models/request.model.ts b/lib/http/models/request.model.ts index 424d250..4797fd2 100644 --- a/lib/http/models/request.model.ts +++ b/lib/http/models/request.model.ts @@ -1,8 +1,12 @@ +/** + * request.model + */ +import express = require('express'); + /** * This type is to emulate the supported types * wrapping around an express request */ -export interface HttpRequest { - params: any; - query: any; +export interface HttpRequest extends express.Request { + // .. } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 620ded3..927f8ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@litstack/core", - "version": "0.2.0", + "version": "0.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -69,9 +69,9 @@ "dev": true }, "@types/node": { - "version": "10.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.0.8.tgz", - "integrity": "sha512-MFFKFv2X4iZy/NFl1m1E8uwE1CR96SGwJjgHma09PLtqOWoj3nqeJHMG+P/EuJGVLvC2I6MdQRQsr4TcRduIow==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.1.1.tgz", + "integrity": "sha512-n7wxy8r2tjVcrzZoKJlyZmi1C1VhXGHAGhDEO1iqp7fbsTSsDF3dVA50KFsPg77EXqzNJqbzcna8Mi4m7a1lyw==", "dev": true }, "@types/serve-static": { @@ -204,20 +204,27 @@ } }, "body-parser": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", - "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", "requires": { "bytes": "3.0.0", "content-type": "~1.0.4", "debug": "2.6.9", - "depd": "~1.1.1", - "http-errors": "~1.6.2", - "iconv-lite": "0.4.19", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", "on-finished": "~2.3.0", - "qs": "6.5.1", - "raw-body": "2.3.2", - "type-is": "~1.6.15" + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" + }, + "dependencies": { + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + } } }, "boom": { @@ -545,6 +552,62 @@ "vary": "~1.1.2" }, "dependencies": { + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.1", + "http-errors": "~1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "~2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "~1.6.15" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": ">= 1.3.1 < 2" + } + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + } + } + }, "statuses": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", @@ -737,9 +800,12 @@ } }, "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } }, "inflight": { "version": "1.0.6", @@ -949,9 +1015,9 @@ "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, "nyc": { - "version": "11.7.3", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.7.3.tgz", - "integrity": "sha512-40EtXYqklVP8nFtXtw6tziHV/FBfP2e0HENZc2kivMyzmOdkrp7ljKqpdjS8ubYWdzUMWlMnPDkbNMQeVd2Q5A==", + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.8.0.tgz", + "integrity": "sha512-PUFq1PSsx5OinSk5g5aaZygcDdI3QQT5XUlbR9QRMihtMS6w0Gm8xj4BxmKeeAlpQXC5M2DIhH16Y+KejceivQ==", "dev": true, "requires": { "archy": "^1.0.0", @@ -3660,37 +3726,14 @@ "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" }, "raw-body": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", - "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", "requires": { "bytes": "3.0.0", - "http-errors": "1.6.2", - "iconv-lite": "0.4.19", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", "unpipe": "1.0.0" - }, - "dependencies": { - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": ">= 1.3.1 < 2" - } - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" - } } }, "readable-stream": { @@ -3755,6 +3798,11 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, "send": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", diff --git a/package.json b/package.json index 50949f0..0fe6adc 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "@litstack/core", - "version": "0.2.1", - "description": "## Vision", + "version": "0.2.2", + "description": "Typescript REST Framework", "main": "dist/index.js", "types": "dist/index.d.ts", "dependencies": { - "body-parser": "^1.18.2", + "body-parser": "^1.18.3", "express": "^4.16.3", "reflect-metadata": "^0.1.12", "rxjs": "^6.1.0", @@ -15,12 +15,12 @@ "@types/chai": "^4.1.3", "@types/express": "^4.11.1", "@types/mocha": "^5.2.0", - "@types/node": "^10.0.8", + "@types/node": "^10.1.1", "@types/supertest": "^2.0.4", "chai": "^4.1.2", "coveralls": "^3.0.1", "mocha": "^5.1.1", - "nyc": "^11.7.3", + "nyc": "^11.8.0", "source-map-support": "^0.5.6", "ts-node": "^6.0.3", "typescript": "^2.8.3" diff --git a/test/mocha.opts b/test/mocha.opts index f295e1b..9bb54e0 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,5 +1,4 @@ --require ts-node/register --require source-map-support/register --full-trace ---bail **/*.spec.ts \ No newline at end of file