mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Compare commits
23 Commits
v5.3.10
...
BrunnerLiv
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c92bf72ef | ||
|
|
89d84d214f | ||
|
|
f8ffc2d064 | ||
|
|
d453e9bc65 | ||
|
|
3a74c790bf | ||
|
|
958da96733 | ||
|
|
1acae78302 | ||
|
|
f01d60021c | ||
|
|
945eff5274 | ||
|
|
9e8eff09bf | ||
|
|
cce8c45f6f | ||
|
|
ac5a556a3c | ||
|
|
ac295e68f6 | ||
|
|
31c2b87a6a | ||
|
|
6193f506c2 | ||
|
|
34f72ce4a7 | ||
|
|
63947cd3c0 | ||
|
|
14cc3edb10 | ||
|
|
65bb7e7c34 | ||
|
|
8604f25a20 | ||
|
|
57faedcc98 | ||
|
|
515151660b | ||
|
|
7f124f9d92 |
@@ -8,6 +8,7 @@ today! As a contributor, here are the guidelines we would like you to follow:
|
||||
- [Issues and Bugs](#issue)
|
||||
- [Feature Requests](#feature)
|
||||
- [Submission Guidelines](#submit)
|
||||
- [Development Setup](#development)
|
||||
- [Coding Rules](#rules)
|
||||
- [Commit Message Guidelines](#commit)
|
||||
<!-- - [Signing the CLA](#cla) -->
|
||||
@@ -143,6 +144,41 @@ from the main (upstream) repository:
|
||||
```shell
|
||||
git pull --ff upstream master
|
||||
```
|
||||
|
||||
## <a name="development"></a> Development Setup
|
||||
|
||||
You will need Node.js version 8.9.0+.
|
||||
|
||||
1. After cloning the repo, run:
|
||||
```bash
|
||||
$ npm i # (or yarn install)
|
||||
```
|
||||
|
||||
2. In order to prepare your environment run `prepare.sh` shell script:
|
||||
```bash
|
||||
$ sh scripts/prepare.sh
|
||||
```
|
||||
|
||||
That will compile fresh packages and afterward, move them to all `sample` directories as well as integration tests.
|
||||
|
||||
### Commonly used NPM scripts
|
||||
|
||||
```bash
|
||||
# build all packages and move to "sample" and "integration" directories
|
||||
# if cross-packages breaking changes were performed you may face irrelevant errors
|
||||
# in order to verify the build, you can run this command again then
|
||||
$ npm run build
|
||||
|
||||
# run the full unit tests suite
|
||||
$ npm run test
|
||||
|
||||
# run integration tests
|
||||
# docker is required(!)
|
||||
$ sh scripts/run-integration.sh
|
||||
|
||||
# run linter
|
||||
$ npm run lint
|
||||
```
|
||||
|
||||
## <a name="rules"></a> Coding Rules
|
||||
To ensure consistency throughout the source code, keep these rules in mind as you are working:
|
||||
@@ -184,11 +220,7 @@ Samples: (even more [samples](https://github.com/nestjs/nest/commits/master))
|
||||
|
||||
```
|
||||
docs(changelog) update change log to beta.5
|
||||
```
|
||||
```
|
||||
bugfix(core) need to depend on latest rxjs and zone.js
|
||||
|
||||
The version in our package.json gets copied to the one we publish, and users need the latest of these.
|
||||
```
|
||||
|
||||
### Revert
|
||||
|
||||
@@ -58,7 +58,7 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
|
||||
|
||||
#### Sponsors
|
||||
|
||||
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="40" /> <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> --> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a> <a href="https://genuinebee.com/"><img src="https://nestjs.com/img/genuinebee.svg" height="34" /></a>
|
||||
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="40" /> <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> --> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a> <a href="https://genuinebee.com/"><img src="https://nestjs.com/img/genuinebee.svg" height="38" /></a> <a href="http://architectnow.net/"><img src="https://nestjs.com/img/architectnow.png" height="24" /></a> <a href="https://quander.io/"><img src="https://nestjs.com/img/quander.png" height="28" /></a>
|
||||
|
||||
|
||||
## Backers
|
||||
|
||||
2
bundle/common/cache/cache.module.js
vendored
2
bundle/common/cache/cache.module.js
vendored
@@ -45,7 +45,7 @@ let CacheModule = CacheModule_1 = class CacheModule {
|
||||
}
|
||||
return {
|
||||
provide: cache_constants_1.CACHE_MODULE_OPTIONS,
|
||||
useFactory: async (optionsFactory) => await optionsFactory.createCacheOptions(),
|
||||
useFactory: async (optionsFactory) => optionsFactory.createCacheOptions(),
|
||||
inject: [options.useExisting || options.useClass],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ let MulterModule = MulterModule_1 = class MulterModule {
|
||||
}
|
||||
return {
|
||||
provide: files_constants_1.MULTER_MODULE_OPTIONS,
|
||||
useFactory: async (optionsFactory) => await optionsFactory.createMulterOptions(),
|
||||
useFactory: async (optionsFactory) => optionsFactory.createMulterOptions(),
|
||||
inject: [options.useExisting || options.useClass],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
"body-parser": "1.18.3",
|
||||
"cors": "2.8.4",
|
||||
"express": "4.16.3",
|
||||
"fast-safe-stringify": "1.2.0",
|
||||
"iterare": "0.0.8",
|
||||
"object-hash": "1.3.0",
|
||||
"optional": "0.1.4",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncClassApplicationModule } from './../src/async-options-class.module';
|
||||
import { AsyncClassApplicationModule } from '../src/async-options-class.module';
|
||||
|
||||
describe('GraphQL (async class)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncExistingApplicationModule } from './../src/async-options-existing.module';
|
||||
import { AsyncExistingApplicationModule } from '../src/async-options-existing.module';
|
||||
|
||||
describe('GraphQL (async existing)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncApplicationModule } from './../src/async-options.module';
|
||||
import { AsyncApplicationModule } from '../src/async-options.module';
|
||||
|
||||
describe('GraphQL (async configuration)', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('GraphQL', () => {
|
||||
let app: INestApplication;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication, HttpStatus } from '@nestjs/common';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ErrorsController } from '../src/errors/errors.controller';
|
||||
|
||||
describe('Error messages', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (express instance)', () => {
|
||||
let server;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { INestFastifyApplication } from '@nestjs/common/interfaces/nest-fastify-
|
||||
import { FastifyAdapter } from '@nestjs/core/adapters/fastify-adapter';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { expect } from 'chai';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (fastify adapter)', () => {
|
||||
let app: INestApplication & INestFastifyApplication;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication, Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (default adapter)', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication, Injectable } from '@nestjs/common';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
import { APP_INTERCEPTOR } from '@nestjs/core';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as request from 'supertest';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Hello world (default adapter)', () => {
|
||||
let server;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { expect } from 'chai';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import { CircularModule } from '../src/circular-structure-dynamic-module/circular.module';
|
||||
import { InputService } from '../src/circular-structure-dynamic-module/input.service';
|
||||
|
||||
describe('Circular structure for dynamic modules', () => {
|
||||
it('should resolve circular structure with dynamic modules', async () => {
|
||||
const builder = Test.createTestingModule({
|
||||
imports: [CircularModule.forRoot()],
|
||||
});
|
||||
const testingModule = await builder.compile();
|
||||
const inputService = testingModule.get<InputService>(InputService);
|
||||
|
||||
expect(inputService).to.be.instanceof(InputService);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
import { DynamicModule } from '@nestjs/common';
|
||||
import { InputService } from './input.service';
|
||||
|
||||
export class CircularModule {
|
||||
static forRoot(): DynamicModule {
|
||||
const a = {
|
||||
module: CircularModule,
|
||||
providers: [
|
||||
InputService,
|
||||
],
|
||||
b: null,
|
||||
};
|
||||
a.b = a;
|
||||
return a;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class InputService {
|
||||
}
|
||||
@@ -21,7 +21,7 @@ describe('GRPC transport', () => {
|
||||
transport: Transport.GRPC,
|
||||
options: {
|
||||
package: 'math',
|
||||
protoPath: join(__dirname, './../src/grpc/math.proto'),
|
||||
protoPath: join(__dirname, '../src/grpc/math.proto'),
|
||||
},
|
||||
});
|
||||
await app.startAllMicroservicesAsync();
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Transport } from '@nestjs/microservices';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as express from 'express';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('RPC transport', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('Mongoose', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncOptionsClassModule } from './../src/async-class-options.module';
|
||||
import { AsyncOptionsClassModule } from '../src/async-class-options.module';
|
||||
|
||||
describe('TypeOrm (async configuration)', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncOptionsExistingModule } from './../src/async-existing-options.module';
|
||||
import { AsyncOptionsExistingModule } from '../src/async-existing-options.module';
|
||||
|
||||
describe('TypeOrm (async configuration)', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncOptionsFactoryModule } from './../src/async-options.module';
|
||||
import { AsyncOptionsFactoryModule } from '../src/async-options.module';
|
||||
|
||||
describe('TypeOrm (async configuration)', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { AsyncApplicationModule } from './../src/app-async.module';
|
||||
import { AsyncApplicationModule } from '../src/app-async.module';
|
||||
|
||||
describe('TypeOrm (async configuration)', () => {
|
||||
let server;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { INestApplication } from '@nestjs/common';
|
||||
import { Test } from '@nestjs/testing';
|
||||
import * as request from 'supertest';
|
||||
import { ApplicationModule } from './../src/app.module';
|
||||
import { ApplicationModule } from '../src/app.module';
|
||||
|
||||
describe('TypeOrm', () => {
|
||||
let server;
|
||||
|
||||
214
package-lock.json
generated
214
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nestjs",
|
||||
"version": "5.3.6",
|
||||
"version": "5.3.10",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -122,9 +122,9 @@
|
||||
}
|
||||
},
|
||||
"@nestjs/core": {
|
||||
"version": "5.3.7",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-5.3.7.tgz",
|
||||
"integrity": "sha512-95Psilwq0vVek7t8CWu6T5EI0OzdKer7uvoqA9+2rm6EAgorSr2UHpMzaC2hAAVcXAmIp3pWSCmTrHmAcY7JmA==",
|
||||
"version": "5.3.10",
|
||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-5.3.10.tgz",
|
||||
"integrity": "sha512-yTsWEA7nj0Gubs2HrvCM64MRfvI/GgiXDukKvqRE5eiawjhVuENWX4yvB505LCH6vHOC9i9eWYgiZkTsbl2w0A==",
|
||||
"requires": {
|
||||
"@nuxtjs/opencollective": "0.1.0",
|
||||
"body-parser": "1.18.3",
|
||||
@@ -146,14 +146,6 @@
|
||||
"negotiator": "0.6.1"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"requires": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"depd": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
||||
@@ -5210,24 +5202,28 @@
|
||||
"dependencies": {
|
||||
"abbrev": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||
"dev": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
|
||||
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"are-we-there-yet": {
|
||||
"version": "1.1.4",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
|
||||
"integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5237,12 +5233,14 @@
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
@@ -5251,34 +5249,40 @@
|
||||
},
|
||||
"chownr": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz",
|
||||
"integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"dev": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
|
||||
"dev": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"debug": {
|
||||
"version": "2.6.9",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5287,25 +5291,29 @@
|
||||
},
|
||||
"deep-extend": {
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz",
|
||||
"integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"delegates": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
||||
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"detect-libc": {
|
||||
"version": "1.0.3",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
|
||||
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"fs-minipass": {
|
||||
"version": "1.2.5",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz",
|
||||
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5314,13 +5322,15 @@
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"gauge": {
|
||||
"version": "2.7.4",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5336,7 +5346,8 @@
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5350,13 +5361,15 @@
|
||||
},
|
||||
"has-unicode": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.21",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz",
|
||||
"integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5365,7 +5378,8 @@
|
||||
},
|
||||
"ignore-walk": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz",
|
||||
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5374,7 +5388,8 @@
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5384,18 +5399,21 @@
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
||||
"dev": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
|
||||
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
@@ -5403,13 +5421,15 @@
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
@@ -5417,12 +5437,14 @@
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"dev": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.2.4",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz",
|
||||
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.1",
|
||||
@@ -5431,7 +5453,8 @@
|
||||
},
|
||||
"minizlib": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz",
|
||||
"integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5440,7 +5463,8 @@
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
@@ -5448,7 +5472,8 @@
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
@@ -5461,7 +5486,8 @@
|
||||
},
|
||||
"needle": {
|
||||
"version": "2.2.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/needle/-/needle-2.2.0.tgz",
|
||||
"integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5472,7 +5498,8 @@
|
||||
},
|
||||
"node-pre-gyp": {
|
||||
"version": "0.10.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz",
|
||||
"integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5490,7 +5517,8 @@
|
||||
},
|
||||
"nopt": {
|
||||
"version": "4.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
|
||||
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5500,13 +5528,15 @@
|
||||
},
|
||||
"npm-bundled": {
|
||||
"version": "1.0.3",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz",
|
||||
"integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"npm-packlist": {
|
||||
"version": "1.1.10",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz",
|
||||
"integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5516,7 +5546,8 @@
|
||||
},
|
||||
"npmlog": {
|
||||
"version": "4.1.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
|
||||
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5528,18 +5559,21 @@
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
|
||||
"dev": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
@@ -5547,19 +5581,22 @@
|
||||
},
|
||||
"os-homedir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"osenv": {
|
||||
"version": "0.1.5",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
|
||||
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5569,19 +5606,22 @@
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"rc": {
|
||||
"version": "1.2.7",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz",
|
||||
"integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5593,7 +5633,8 @@
|
||||
"dependencies": {
|
||||
"minimist": {
|
||||
"version": "1.2.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
}
|
||||
@@ -5601,7 +5642,8 @@
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.6",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5616,7 +5658,8 @@
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.6.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
|
||||
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5625,42 +5668,49 @@
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
||||
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
|
||||
"dev": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"sax": {
|
||||
"version": "1.2.4",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.5.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
@@ -5670,7 +5720,8 @@
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5679,7 +5730,8 @@
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
@@ -5687,13 +5739,15 @@
|
||||
},
|
||||
"strip-json-comments": {
|
||||
"version": "2.0.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"tar": {
|
||||
"version": "4.4.1",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz",
|
||||
"integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5708,13 +5762,15 @@
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"wide-align": {
|
||||
"version": "1.1.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz",
|
||||
"integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -5723,12 +5779,14 @@
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.2",
|
||||
"bundled": true,
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz",
|
||||
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
55
package.json
55
package.json
@@ -1,36 +1,27 @@
|
||||
{
|
||||
"name": "nestjs",
|
||||
"version": "5.3.8",
|
||||
"version": "5.3.10",
|
||||
"description": "Modern, fast, powerful node.js web framework",
|
||||
"scripts": {
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"precommit": "lint-staged",
|
||||
"test":
|
||||
"nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec",
|
||||
"integration-test":
|
||||
"mocha integration/**/*.spec.ts --reporter spec --require ts-node/register",
|
||||
"lint":
|
||||
"tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
|
||||
"format":
|
||||
"prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
|
||||
"test": "nyc --require ts-node/register mocha packages/**/*.spec.ts --reporter spec",
|
||||
"integration-test": "mocha integration/**/*.spec.ts --reporter spec --require ts-node/register",
|
||||
"lint": "tslint -p tsconfig.json -c tslint.json \"packages/**/*.ts\" -e \"*.spec.ts\"",
|
||||
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
|
||||
"build": "gulp build && gulp move",
|
||||
"build:lib": "gulp build --dist bundle",
|
||||
"postinstall": "opencollective",
|
||||
"copy-docs": "gulp copy-docs",
|
||||
"prepare": "npm run build:lib && npm run copy-docs",
|
||||
"prepare:npm": "npm run build:lib && npm run copy-docs",
|
||||
"prepare:rc": "npm run build:lib && npm run copy-docs",
|
||||
"prepare:next": "npm run build:lib && npm run copy-docs",
|
||||
"prepare:beta": "npm run build:lib && npm run copy-docs",
|
||||
"publish":
|
||||
"npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:rc":
|
||||
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:next":
|
||||
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:beta":
|
||||
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:test":
|
||||
"npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
|
||||
"publish": "npm run prepare && ./node_modules/.bin/lerna publish --exact -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:rc": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=rc -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:next": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=next --skip-git -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:beta": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=beta -m \"chore(@nestjs) publish %s release\"",
|
||||
"publish:test": "npm run prepare && ./node_modules/.bin/lerna publish --npm-tag=test --skip-git -m \"chore(@nestjs) publish %s release\""
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.9.0"
|
||||
@@ -44,7 +35,7 @@
|
||||
"dependencies": {
|
||||
"@grpc/proto-loader": "^0.3.0",
|
||||
"@nestjs/common": "5.1.0",
|
||||
"@nestjs/core": "^5.3.8",
|
||||
"@nestjs/core": "^5.3.10",
|
||||
"@nestjs/microservices": "5.1.0",
|
||||
"@nestjs/testing": "5.1.0",
|
||||
"@nestjs/websockets": "5.1.0",
|
||||
@@ -139,7 +130,9 @@
|
||||
}
|
||||
},
|
||||
"nyc": {
|
||||
"include": ["packages/**/*.ts"],
|
||||
"include": [
|
||||
"packages/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules/",
|
||||
"packages/**/*.spec.ts",
|
||||
@@ -158,13 +151,23 @@
|
||||
"packages/common/serializer/**/*",
|
||||
"packages/common/services/logger.service.ts"
|
||||
],
|
||||
"extension": [".ts"],
|
||||
"require": ["ts-node/register"],
|
||||
"reporter": ["text-summary", "html"],
|
||||
"extension": [
|
||||
".ts"
|
||||
],
|
||||
"require": [
|
||||
"ts-node/register"
|
||||
],
|
||||
"reporter": [
|
||||
"text-summary",
|
||||
"html"
|
||||
],
|
||||
"sourceMap": true,
|
||||
"instrument": true
|
||||
},
|
||||
"lint-staged": {
|
||||
"packages/**/*.{ts,json}": ["npm run format", "git add"]
|
||||
"packages/**/*.{ts,json}": [
|
||||
"npm run format",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
3
packages/common/cache/cache.module.ts
vendored
3
packages/common/cache/cache.module.ts
vendored
@@ -55,8 +55,7 @@ export class CacheModule {
|
||||
}
|
||||
return {
|
||||
provide: CACHE_MODULE_OPTIONS,
|
||||
useFactory: async (optionsFactory: CacheOptionsFactory) =>
|
||||
await optionsFactory.createCacheOptions(),
|
||||
useFactory: async (optionsFactory: CacheOptionsFactory) => optionsFactory.createCacheOptions(),
|
||||
inject: [options.useExisting || options.useClass],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,8 +52,7 @@ export class MulterModule {
|
||||
}
|
||||
return {
|
||||
provide: MULTER_MODULE_OPTIONS,
|
||||
useFactory: async (optionsFactory: MulterOptionsFactory) =>
|
||||
await optionsFactory.createMulterOptions(),
|
||||
useFactory: async (optionsFactory: MulterOptionsFactory) => optionsFactory.createMulterOptions(),
|
||||
inject: [options.useExisting || options.useClass],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import axios, { AxiosRequestConfig } from 'axios';
|
||||
import Axios, { AxiosRequestConfig } from 'axios';
|
||||
import { Module } from '../decorators/modules/module.decorator';
|
||||
import { DynamicModule } from '../interfaces';
|
||||
import { randomStringGenerator } from '../utils/random-string-generator.util';
|
||||
@@ -10,7 +10,7 @@ import { HttpService } from './http.service';
|
||||
HttpService,
|
||||
{
|
||||
provide: AXIOS_INSTANCE_TOKEN,
|
||||
useValue: axios,
|
||||
useValue: Axios,
|
||||
},
|
||||
],
|
||||
exports: [HttpService],
|
||||
@@ -22,7 +22,7 @@ export class HttpModule {
|
||||
providers: [
|
||||
{
|
||||
provide: AXIOS_INSTANCE_TOKEN,
|
||||
useValue: axios.create(config),
|
||||
useValue: Axios.create(config),
|
||||
},
|
||||
{
|
||||
provide: HTTP_MODULE_ID,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import Axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { defer, Observable } from 'rxjs';
|
||||
import { Inject } from '../decorators';
|
||||
import { AXIOS_INSTANCE_TOKEN } from './http.constants';
|
||||
@@ -6,7 +6,7 @@ import { AXIOS_INSTANCE_TOKEN } from './http.constants';
|
||||
export class HttpService {
|
||||
constructor(
|
||||
@Inject(AXIOS_INSTANCE_TOKEN)
|
||||
private readonly instance: AxiosInstance = axios,
|
||||
private readonly instance: AxiosInstance = Axios,
|
||||
) {}
|
||||
|
||||
request<T = any>(config: AxiosRequestConfig): Observable<AxiosResponse<T>> {
|
||||
|
||||
@@ -87,16 +87,16 @@ export class ExpressAdapter implements HttpServer {
|
||||
return response.set(name, value);
|
||||
}
|
||||
|
||||
getHttpServer() {
|
||||
return this.httpServer;
|
||||
getHttpServer<T = any>(): T {
|
||||
return this.httpServer as any as T;
|
||||
}
|
||||
|
||||
setHttpServer(httpServer) {
|
||||
this.httpServer = httpServer;
|
||||
}
|
||||
|
||||
getInstance() {
|
||||
return this.instance;
|
||||
getInstance<T = any>(): T {
|
||||
return this.instance as any as T;
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
@@ -80,12 +80,12 @@ export class FastifyAdapter {
|
||||
return this.instance.setNotFoundHandler(handler);
|
||||
}
|
||||
|
||||
getHttpServer() {
|
||||
return this.instance.server;
|
||||
getHttpServer<T = any>(): T {
|
||||
return this.instance.server as any as T;
|
||||
}
|
||||
|
||||
getInstance() {
|
||||
return this.instance;
|
||||
getInstance<T = any>(): T {
|
||||
return this.instance as any as T;
|
||||
}
|
||||
|
||||
register(...args) {
|
||||
|
||||
@@ -6,7 +6,7 @@ export declare class Error {
|
||||
}
|
||||
|
||||
export class RuntimeException extends Error {
|
||||
constructor(private msg = ``) {
|
||||
constructor(private readonly msg = ``) {
|
||||
super(msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ export class ExternalContextCreator {
|
||||
callback,
|
||||
handler(initialArgs, ...args),
|
||||
);
|
||||
return await this.transformToResult(result);
|
||||
return this.transformToResult(result);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ export class ExternalContextCreator {
|
||||
{ metatype, type, data },
|
||||
transforms: Transform<any>[],
|
||||
): Promise<any> {
|
||||
return await this.pipesConsumer.apply(
|
||||
return this.pipesConsumer.apply(
|
||||
value,
|
||||
{ metatype, type, data },
|
||||
transforms,
|
||||
@@ -214,7 +214,7 @@ export class ExternalContextCreator {
|
||||
|
||||
public async transformToResult(resultOrDeffered) {
|
||||
if (resultOrDeffered && isFunction(resultOrDeffered.subscribe)) {
|
||||
return await resultOrDeffered.toPromise();
|
||||
return resultOrDeffered.toPromise();
|
||||
}
|
||||
return resultOrDeffered;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,9 @@ export class Injector {
|
||||
) {
|
||||
const { metatype } = wrapper;
|
||||
const currentMetatype = collection.get(metatype.name);
|
||||
if (currentMetatype.instance !== null) return;
|
||||
|
||||
if (currentMetatype.instance !== null) {
|
||||
return;
|
||||
}
|
||||
await this.resolveConstructorParams(
|
||||
wrapper as any,
|
||||
module,
|
||||
@@ -87,12 +88,13 @@ export class Injector {
|
||||
{ metatype, name }: InstanceWrapper<T>,
|
||||
collection: Map<string, InstanceWrapper<T>>,
|
||||
) {
|
||||
if (!collection) return null;
|
||||
|
||||
const target = collection.get(name);
|
||||
if (target.isResolved || !isNil(target.inject) || !metatype.prototype)
|
||||
if (!collection) {
|
||||
return null;
|
||||
|
||||
}
|
||||
const target = collection.get(name);
|
||||
if (target.isResolved || !isNil(target.inject) || !metatype.prototype) {
|
||||
return null;
|
||||
}
|
||||
collection.set(name, {
|
||||
...collection.get(name),
|
||||
instance: Object.create(metatype.prototype),
|
||||
@@ -122,35 +124,24 @@ export class Injector {
|
||||
module: Module,
|
||||
) {
|
||||
if (wrapper.isPending) {
|
||||
return await wrapper.done$;
|
||||
return wrapper.done$;
|
||||
}
|
||||
const done = this.applyDoneHook(wrapper);
|
||||
const { metatype, name, inject } = wrapper;
|
||||
const currentMetatype = collection.get(name);
|
||||
if (isUndefined(currentMetatype)) {
|
||||
const { name, inject } = wrapper;
|
||||
|
||||
const targetMetatype = collection.get(name);
|
||||
if (isUndefined(targetMetatype)) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
if (currentMetatype.isResolved) {
|
||||
if (targetMetatype.isResolved) {
|
||||
return void 0;
|
||||
}
|
||||
|
||||
await this.resolveConstructorParams<T>(
|
||||
wrapper,
|
||||
module,
|
||||
inject,
|
||||
async instances => {
|
||||
if (isNil(inject)) {
|
||||
currentMetatype.instance = Object.assign(
|
||||
currentMetatype.instance,
|
||||
new metatype(...instances),
|
||||
);
|
||||
} else {
|
||||
const factoryResult = currentMetatype.metatype(...instances);
|
||||
currentMetatype.instance = await factoryResult;
|
||||
}
|
||||
currentMetatype.isResolved = true;
|
||||
done();
|
||||
},
|
||||
async instances =>
|
||||
this.instantiateClass(instances, wrapper, targetMetatype, done),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -220,7 +211,7 @@ export class Injector {
|
||||
throw new UndefinedDependencyException(wrapper.name, dependencyContext);
|
||||
}
|
||||
const token = this.resolveParamToken(wrapper, param);
|
||||
return await this.resolveComponentInstance<T>(
|
||||
return this.resolveComponentInstance<T>(
|
||||
module,
|
||||
isFunction(token) ? (token as Type<any>).name : token,
|
||||
dependencyContext,
|
||||
@@ -269,17 +260,11 @@ export class Injector {
|
||||
) {
|
||||
const { name } = dependencyContext;
|
||||
const scanInExports = () =>
|
||||
this.lookupComponentInExports(
|
||||
components,
|
||||
dependencyContext,
|
||||
module,
|
||||
wrapper,
|
||||
);
|
||||
return components.has(name) ? components.get(name) : await scanInExports();
|
||||
this.lookupComponentInExports(dependencyContext, module, wrapper);
|
||||
return components.has(name) ? components.get(name) : scanInExports();
|
||||
}
|
||||
|
||||
public async lookupComponentInExports<T = any>(
|
||||
components: Map<string, any>,
|
||||
dependencyContext: InjectorDependencyContext,
|
||||
module: Module,
|
||||
wrapper: InstanceWrapper<T>,
|
||||
@@ -328,4 +313,26 @@ export class Injector {
|
||||
}
|
||||
return componentRef;
|
||||
}
|
||||
|
||||
public async instantiateClass(
|
||||
instances: any[],
|
||||
wrapper: InstanceWrapper<any>,
|
||||
targetMetatype: InstanceWrapper<any>,
|
||||
done: Function,
|
||||
) {
|
||||
const { metatype, inject } = wrapper;
|
||||
if (isNil(inject)) {
|
||||
targetMetatype.instance = Object.assign(
|
||||
targetMetatype.instance,
|
||||
new metatype(...instances),
|
||||
);
|
||||
} else {
|
||||
const factoryResult = ((targetMetatype.metatype as any) as Function)(
|
||||
...instances,
|
||||
);
|
||||
targetMetatype.instance = await factoryResult;
|
||||
}
|
||||
targetMetatype.isResolved = true;
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,7 @@ export class InstanceLoader {
|
||||
private async createInstancesOfComponents(module: Module) {
|
||||
await Promise.all(
|
||||
[...module.components.values()].map(
|
||||
async wrapper =>
|
||||
await this.injector.loadInstanceOfComponent(wrapper, module),
|
||||
async wrapper => this.injector.loadInstanceOfComponent(wrapper, module),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -67,8 +66,7 @@ export class InstanceLoader {
|
||||
private async createInstancesOfRoutes(module: Module) {
|
||||
await Promise.all(
|
||||
[...module.routes.values()].map(
|
||||
async wrapper =>
|
||||
await this.injector.loadInstanceOfRoute(wrapper, module),
|
||||
async wrapper => this.injector.loadInstanceOfRoute(wrapper, module),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -85,8 +83,7 @@ export class InstanceLoader {
|
||||
private async createInstancesOfInjectables(module: Module) {
|
||||
await Promise.all(
|
||||
[...module.injectables.values()].map(
|
||||
async wrapper =>
|
||||
await this.injector.loadInstanceOfInjectable(wrapper, module),
|
||||
async wrapper => this.injector.loadInstanceOfInjectable(wrapper, module),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { DynamicModule } from '@nestjs/common';
|
||||
import { SHARED_MODULE_METADATA } from '@nestjs/common/constants';
|
||||
import { Type } from '@nestjs/common/interfaces/type.interface';
|
||||
import * as hash from 'object-hash';
|
||||
import safeStringify from 'fast-safe-stringify';
|
||||
|
||||
export class ModuleTokenFactory {
|
||||
public create(
|
||||
@@ -22,7 +23,9 @@ export class ModuleTokenFactory {
|
||||
public getDynamicMetadataToken(
|
||||
dynamicModuleMetadata: Partial<DynamicModule> | undefined,
|
||||
): string {
|
||||
return dynamicModuleMetadata ? JSON.stringify(dynamicModuleMetadata) : '';
|
||||
// Uses safeStringify instead of JSON.stringify
|
||||
// to support circular dynamic modules
|
||||
return dynamicModuleMetadata ? safeStringify(dynamicModuleMetadata) : '';
|
||||
}
|
||||
|
||||
public getModuleName(metatype: Type<any>): string {
|
||||
|
||||
@@ -42,11 +42,11 @@ export type ComponentMetatype =
|
||||
|
||||
export class Module {
|
||||
private readonly _id: string;
|
||||
private _relatedModules = new Set<Module>();
|
||||
private _components = new Map<any, InstanceWrapper<Injectable>>();
|
||||
private _injectables = new Map<any, InstanceWrapper<Injectable>>();
|
||||
private _routes = new Map<string, InstanceWrapper<Controller>>();
|
||||
private _exports = new Set<string>();
|
||||
private readonly _relatedModules = new Set<Module>();
|
||||
private readonly _components = new Map<any, InstanceWrapper<Injectable>>();
|
||||
private readonly _injectables = new Map<any, InstanceWrapper<Injectable>>();
|
||||
private readonly _routes = new Map<string, InstanceWrapper<Controller>>();
|
||||
private readonly _exports = new Set<string>();
|
||||
|
||||
constructor(
|
||||
private readonly _metatype: Type<any>,
|
||||
|
||||
@@ -14,7 +14,7 @@ export class InterceptorsConsumer {
|
||||
next: () => Promise<any>,
|
||||
): Promise<any> {
|
||||
if (isEmpty(interceptors)) {
|
||||
return await await next();
|
||||
return next();
|
||||
}
|
||||
const context = this.createContext(args, instance, callback);
|
||||
const start$ = defer(() => this.transformDeffered(next));
|
||||
@@ -27,11 +27,10 @@ export class InterceptorsConsumer {
|
||||
};
|
||||
*/
|
||||
const result$ = await interceptors.reduce(
|
||||
async (stream$, interceptor) =>
|
||||
await interceptor.intercept(context, await stream$),
|
||||
async (stream$, interceptor) => interceptor.intercept(context, await stream$),
|
||||
Promise.resolve(start$),
|
||||
);
|
||||
return await result$.toPromise();
|
||||
return result$.toPromise();
|
||||
}
|
||||
|
||||
public createContext(
|
||||
|
||||
@@ -37,7 +37,7 @@ export class MiddlewareBuilder implements MiddlewareConsumer {
|
||||
return [].concat(middleware).map(bindArgs);
|
||||
}
|
||||
|
||||
private static ConfigProxy = class implements MiddlewareConfigProxy {
|
||||
private static readonly ConfigProxy = class implements MiddlewareConfigProxy {
|
||||
private contextParameters = null;
|
||||
private excludedRoutes: RouteInfo[] = [];
|
||||
private readonly includedRoutes: any[];
|
||||
|
||||
@@ -11,8 +11,7 @@ export class MiddlewareResolver {
|
||||
const middleware = this.middlewareContainer.getMiddleware(moduleName);
|
||||
await Promise.all(
|
||||
[...middleware.values()].map(
|
||||
async wrapper =>
|
||||
await this.resolveMiddlewareInstance(wrapper, middleware, module),
|
||||
async wrapper => this.resolveMiddlewareInstance(wrapper, middleware, module),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ export const filterMiddleware = middleware => {
|
||||
return []
|
||||
.concat(middleware)
|
||||
.filter(isFunction)
|
||||
.map(ware => mapToClass(ware));
|
||||
.map(mapToClass);
|
||||
};
|
||||
|
||||
export const mapToClass = middleware => {
|
||||
|
||||
@@ -91,7 +91,7 @@ export class NestApplicationContext extends ModuleRef
|
||||
.map(([key, { instance }]) => instance)
|
||||
.filter(instance => !isNil(instance))
|
||||
.filter(this.hasOnModuleInitHook)
|
||||
.map(async instance => await (instance as OnModuleInit).onModuleInit()),
|
||||
.map(async instance => (instance as OnModuleInit).onModuleInit()),
|
||||
);
|
||||
if (moduleClassInstance && this.hasOnModuleInitHook(moduleClassInstance)) {
|
||||
await (moduleClassInstance as OnModuleInit).onModuleInit();
|
||||
@@ -121,10 +121,7 @@ export class NestApplicationContext extends ModuleRef
|
||||
.map(([key, { instance }]) => instance)
|
||||
.filter(instance => !isNil(instance))
|
||||
.filter(this.hasOnModuleDestroyHook)
|
||||
.map(
|
||||
async instance =>
|
||||
await (instance as OnModuleDestroy).onModuleDestroy(),
|
||||
),
|
||||
.map(async instance => (instance as OnModuleDestroy).onModuleDestroy()),
|
||||
);
|
||||
if (
|
||||
moduleClassInstance &&
|
||||
@@ -155,9 +152,8 @@ export class NestApplicationContext extends ModuleRef
|
||||
.map(([key, { instance }]) => instance)
|
||||
.filter(instance => !isNil(instance))
|
||||
.filter(this.hasOnAppBotstrapHook)
|
||||
.map(
|
||||
async instance =>
|
||||
await (instance as OnApplicationBootstrap).onApplicationBootstrap(),
|
||||
.map(async instance =>
|
||||
(instance as OnApplicationBootstrap).onApplicationBootstrap(),
|
||||
),
|
||||
);
|
||||
if (moduleClassInstance && this.hasOnAppBotstrapHook(moduleClassInstance)) {
|
||||
|
||||
@@ -117,7 +117,7 @@ export class NestFactoryStatic {
|
||||
const context = this.createNestInstance<NestApplicationContext>(
|
||||
new NestApplicationContext(container, [], root),
|
||||
);
|
||||
return await context.init();
|
||||
return context.init();
|
||||
}
|
||||
|
||||
private createNestInstance<T>(instance: T): T {
|
||||
|
||||
@@ -10,7 +10,7 @@ export class PipesConsumer {
|
||||
transforms: Transform<any>[],
|
||||
) {
|
||||
const token = this.paramsTokenFactory.exchangeEnumForString(type);
|
||||
return await this.applyPipes(
|
||||
return this.applyPipes(
|
||||
value,
|
||||
{ metatype, type: token, data },
|
||||
transforms,
|
||||
@@ -22,7 +22,7 @@ export class PipesConsumer {
|
||||
{ metatype, type, data }: { metatype; type?; data? },
|
||||
transforms: Transform<any>[],
|
||||
) {
|
||||
return await transforms.reduce(async (defferedValue, fn) => {
|
||||
return transforms.reduce(async (defferedValue, fn) => {
|
||||
const val = await defferedValue;
|
||||
const result = fn(val, { metatype, type, data });
|
||||
return result;
|
||||
|
||||
@@ -186,7 +186,7 @@ export class RouterExecutionContext {
|
||||
type === RouteParamtypes.PARAM ||
|
||||
isString(type)
|
||||
) {
|
||||
return await this.pipesConsumer.apply(
|
||||
return this.pipesConsumer.apply(
|
||||
value,
|
||||
{ metatype, type, data },
|
||||
transforms,
|
||||
|
||||
@@ -21,7 +21,7 @@ export class RouterResponseController {
|
||||
|
||||
public async transformToResult(resultOrDeffered) {
|
||||
if (resultOrDeffered && isFunction(resultOrDeffered.subscribe)) {
|
||||
return await resultOrDeffered.toPromise();
|
||||
return resultOrDeffered.toPromise();
|
||||
}
|
||||
return resultOrDeffered;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class DependenciesScanner {
|
||||
|
||||
public async storeModule(module: any, scope: Type<any>[]) {
|
||||
if (module && module.forwardRef) {
|
||||
return await this.container.addModule(module.forwardRef(), scope);
|
||||
return this.container.addModule(module.forwardRef(), scope);
|
||||
}
|
||||
await this.container.addModule(module, scope);
|
||||
}
|
||||
@@ -256,7 +256,7 @@ export class DependenciesScanner {
|
||||
throw new CircularDependencyException(context);
|
||||
}
|
||||
if (related && related.forwardRef) {
|
||||
return await this.container.addRelatedModule(related.forwardRef(), token);
|
||||
return this.container.addRelatedModule(related.forwardRef(), token);
|
||||
}
|
||||
await this.container.addRelatedModule(related, token);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { expect } from 'chai';
|
||||
import * as hash from 'object-hash';
|
||||
import { SingleScope } from '../../../common';
|
||||
import { ModuleTokenFactory } from '../../injector/module-token-factory';
|
||||
import safeStringify from 'fast-safe-stringify';
|
||||
|
||||
describe('ModuleTokenFactory', () => {
|
||||
let factory: ModuleTokenFactory;
|
||||
@@ -46,7 +47,7 @@ describe('ModuleTokenFactory', () => {
|
||||
expect(token).to.be.deep.eq(
|
||||
hash({
|
||||
module: Module.name,
|
||||
dynamic: JSON.stringify({
|
||||
dynamic: safeStringify({
|
||||
components: [{}],
|
||||
}),
|
||||
scope: [Module.name],
|
||||
|
||||
@@ -74,16 +74,16 @@ describe('InterceptorsConsumer', () => {
|
||||
const val = 3;
|
||||
const next = async () => val;
|
||||
expect(
|
||||
await await consumer.transformDeffered(next).toPromise(),
|
||||
await consumer.transformDeffered(next).toPromise(),
|
||||
).to.be.eql(val);
|
||||
});
|
||||
});
|
||||
describe('when next() result is Promise', () => {
|
||||
it('should return Observable', async () => {
|
||||
const val = 3;
|
||||
const next = () => Promise.resolve(val);
|
||||
const next = async () => val;
|
||||
expect(
|
||||
await await consumer.transformDeffered(next).toPromise(),
|
||||
await consumer.transformDeffered(next).toPromise(),
|
||||
).to.be.eql(val);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ export abstract class ClientProxy {
|
||||
if (isNil(pattern) || isNil(data)) {
|
||||
return _throw(new InvalidMessageException());
|
||||
}
|
||||
return defer(async () => await this.connect()).pipe(
|
||||
return defer(async () => this.connect()).pipe(
|
||||
mergeMap(
|
||||
() =>
|
||||
new Observable((observer: Observer<TResult>) => {
|
||||
|
||||
@@ -26,7 +26,7 @@ export class ClientRedis extends ClientProxy {
|
||||
protected pubClient: RedisClient;
|
||||
protected subClient: RedisClient;
|
||||
protected connection: Promise<any>;
|
||||
private isExplicitlyTerminated = false;
|
||||
protected isExplicitlyTerminated = false;
|
||||
|
||||
constructor(protected readonly options: ClientOptions['options']) {
|
||||
super();
|
||||
@@ -48,6 +48,7 @@ export class ClientRedis extends ClientProxy {
|
||||
this.pubClient && this.pubClient.quit();
|
||||
this.subClient && this.subClient.quit();
|
||||
this.pubClient = this.subClient = null;
|
||||
this.isExplicitlyTerminated = true;
|
||||
}
|
||||
|
||||
public connect(): Promise<any> {
|
||||
|
||||
@@ -56,7 +56,7 @@ export class RpcContextCreator {
|
||||
return this.rpcProxy.create(async (...args) => {
|
||||
fnCanActivate && (await fnCanActivate(args));
|
||||
|
||||
return await this.interceptorsConsumer.intercept(
|
||||
return this.interceptorsConsumer.intercept(
|
||||
interceptors,
|
||||
args,
|
||||
instance,
|
||||
|
||||
@@ -120,7 +120,7 @@ export class NestMicroservice extends NestApplicationContext
|
||||
}
|
||||
|
||||
public async listenAsync(): Promise<any> {
|
||||
return await new Promise(resolve => this.listen(resolve));
|
||||
return new Promise(resolve => this.listen(resolve));
|
||||
}
|
||||
|
||||
public async close(): Promise<any> {
|
||||
|
||||
@@ -58,8 +58,7 @@ export class ServerMqtt extends Server implements CustomTransportStrategy {
|
||||
}
|
||||
|
||||
public getMessageHandler(pub: MqttClient): any {
|
||||
return async (channel, buffer) =>
|
||||
await this.handleMessage(channel, buffer, pub);
|
||||
return async (channel, buffer) => this.handleMessage(channel, buffer, pub);
|
||||
}
|
||||
|
||||
public async handleMessage(
|
||||
|
||||
@@ -64,8 +64,7 @@ export class ServerNats extends Server implements CustomTransportStrategy {
|
||||
}
|
||||
|
||||
public getMessageHandler(channel: string, client: Client) {
|
||||
return async (buffer, replyTo: string) =>
|
||||
await this.handleMessage(channel, buffer, client, replyTo);
|
||||
return async (buffer, replyTo: string) => this.handleMessage(channel, buffer, client, replyTo);
|
||||
}
|
||||
|
||||
public async handleMessage(
|
||||
|
||||
@@ -72,8 +72,7 @@ export class ServerRedis extends Server implements CustomTransportStrategy {
|
||||
}
|
||||
|
||||
public getMessageHandler(pub: RedisClient) {
|
||||
return async (channel, buffer) =>
|
||||
await this.handleMessage(channel, buffer, pub);
|
||||
return async (channel, buffer) => this.handleMessage(channel, buffer, pub);
|
||||
}
|
||||
|
||||
public async handleMessage(channel, buffer: string | any, pub: RedisClient) {
|
||||
|
||||
@@ -42,7 +42,7 @@ export class ServerTCP extends Server implements CustomTransportStrategy {
|
||||
const readSocket = this.getSocketInstance(socket);
|
||||
readSocket.on(
|
||||
MESSAGE_EVENT,
|
||||
async msg => await this.handleMessage(readSocket, msg),
|
||||
async msg => this.handleMessage(readSocket, msg),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export class WsContextCreator {
|
||||
return this.wsProxy.create(async (...args) => {
|
||||
fnCanActivate && (await fnCanActivate(args));
|
||||
|
||||
return await this.interceptorsConsumer.intercept(
|
||||
return this.interceptorsConsumer.intercept(
|
||||
interceptors,
|
||||
args,
|
||||
instance,
|
||||
|
||||
@@ -73,7 +73,7 @@ export class SocketModule {
|
||||
const servers = this.socketsContainer.getAllServers();
|
||||
await Promise.all(
|
||||
iterate(servers.values()).map(
|
||||
async ({ server }) => server && (await adapter.close(server)),
|
||||
async ({ server }) => server && adapter.close(server),
|
||||
),
|
||||
);
|
||||
this.socketsContainer.clear();
|
||||
|
||||
@@ -2,7 +2,8 @@ projects:
|
||||
database:
|
||||
schemaPath: src/prisma/prisma-types.graphql
|
||||
extensions:
|
||||
prisma: database/prisma.yml
|
||||
endpoints:
|
||||
default: https://eu1.prisma.sh/public-agatepuma-476/my-app/dev
|
||||
codegen:
|
||||
- generator: prisma-binding
|
||||
language: typescript
|
||||
|
||||
247
sample/22-graphql-prisma/graphql.schema.d.ts
vendored
247
sample/22-graphql-prisma/graphql.schema.d.ts
vendored
@@ -1,247 +0,0 @@
|
||||
export enum Episode {
|
||||
NEWHOPE = 'NEWHOPE',
|
||||
EMPIRE = 'EMPIRE',
|
||||
JEDI = 'JEDI',
|
||||
}
|
||||
|
||||
export enum MutationType {
|
||||
CREATED = 'CREATED',
|
||||
UPDATED = 'UPDATED',
|
||||
DELETED = 'DELETED',
|
||||
}
|
||||
|
||||
export enum PostOrderByInput {
|
||||
id_ASC = 'id_ASC',
|
||||
id_DESC = 'id_DESC',
|
||||
isPublished_ASC = 'isPublished_ASC',
|
||||
isPublished_DESC = 'isPublished_DESC',
|
||||
title_ASC = 'title_ASC',
|
||||
title_DESC = 'title_DESC',
|
||||
text_ASC = 'text_ASC',
|
||||
text_DESC = 'text_DESC',
|
||||
updatedAt_ASC = 'updatedAt_ASC',
|
||||
updatedAt_DESC = 'updatedAt_DESC',
|
||||
createdAt_ASC = 'createdAt_ASC',
|
||||
createdAt_DESC = 'createdAt_DESC',
|
||||
}
|
||||
|
||||
export class CreateCatInput {
|
||||
name?: Date;
|
||||
}
|
||||
|
||||
export class PostCreateInput {
|
||||
isPublished?: boolean;
|
||||
title: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export class PostSubscriptionWhereInput {
|
||||
AND: PostSubscriptionWhereInput[];
|
||||
OR: PostSubscriptionWhereInput[];
|
||||
NOT: PostSubscriptionWhereInput[];
|
||||
mutation_in: MutationType[];
|
||||
updatedFields_contains?: string;
|
||||
updatedFields_contains_every: string[];
|
||||
updatedFields_contains_some: string[];
|
||||
node?: PostWhereInput;
|
||||
}
|
||||
|
||||
export class PostUpdateInput {
|
||||
isPublished?: boolean;
|
||||
title?: string;
|
||||
text?: string;
|
||||
}
|
||||
|
||||
export class PostWhereInput {
|
||||
AND: PostWhereInput[];
|
||||
OR: PostWhereInput[];
|
||||
NOT: PostWhereInput[];
|
||||
id?: string;
|
||||
id_not?: string;
|
||||
id_in: string[];
|
||||
id_not_in: string[];
|
||||
id_lt?: string;
|
||||
id_lte?: string;
|
||||
id_gt?: string;
|
||||
id_gte?: string;
|
||||
id_contains?: string;
|
||||
id_not_contains?: string;
|
||||
id_starts_with?: string;
|
||||
id_not_starts_with?: string;
|
||||
id_ends_with?: string;
|
||||
id_not_ends_with?: string;
|
||||
isPublished?: boolean;
|
||||
isPublished_not?: boolean;
|
||||
title?: string;
|
||||
title_not?: string;
|
||||
title_in: string[];
|
||||
title_not_in: string[];
|
||||
title_lt?: string;
|
||||
title_lte?: string;
|
||||
title_gt?: string;
|
||||
title_gte?: string;
|
||||
title_contains?: string;
|
||||
title_not_contains?: string;
|
||||
title_starts_with?: string;
|
||||
title_not_starts_with?: string;
|
||||
title_ends_with?: string;
|
||||
title_not_ends_with?: string;
|
||||
text?: string;
|
||||
text_not?: string;
|
||||
text_in: string[];
|
||||
text_not_in: string[];
|
||||
text_lt?: string;
|
||||
text_lte?: string;
|
||||
text_gt?: string;
|
||||
text_gte?: string;
|
||||
text_contains?: string;
|
||||
text_not_contains?: string;
|
||||
text_starts_with?: string;
|
||||
text_not_starts_with?: string;
|
||||
text_ends_with?: string;
|
||||
text_not_ends_with?: string;
|
||||
}
|
||||
|
||||
export class PostWhereUniqueInput {
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export interface Character {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface ICat {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface Node {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export class AggregatePost {
|
||||
count: number;
|
||||
}
|
||||
|
||||
export class BatchPayload {
|
||||
count: Long;
|
||||
}
|
||||
|
||||
export class Cat implements ICat {
|
||||
id?: number;
|
||||
name?: string;
|
||||
age?: number;
|
||||
}
|
||||
|
||||
export class Droid implements Character {
|
||||
id: string;
|
||||
name: string;
|
||||
primaryFunction?: string;
|
||||
}
|
||||
|
||||
export class Human implements Character {
|
||||
id: string;
|
||||
name: string;
|
||||
totalCredits?: number;
|
||||
}
|
||||
|
||||
export class IMutation {
|
||||
createCat(cat?: CreateCatInput): Cat | Promise<Cat>;
|
||||
createPost(data: PostCreateInput): Post | Promise<Post>;
|
||||
updatePost(
|
||||
data: PostUpdateInput,
|
||||
where: PostWhereUniqueInput,
|
||||
): Post | Promise<Post>;
|
||||
deletePost(where: PostWhereUniqueInput): Post | Promise<Post>;
|
||||
upsertPost(
|
||||
where: PostWhereUniqueInput,
|
||||
create: PostCreateInput,
|
||||
update: PostUpdateInput,
|
||||
): Post | Promise<Post>;
|
||||
updateManyPosts(
|
||||
data: PostUpdateInput,
|
||||
where?: PostWhereInput,
|
||||
): BatchPayload | Promise<BatchPayload>;
|
||||
deleteManyPosts(where?: PostWhereInput): BatchPayload | Promise<BatchPayload>;
|
||||
}
|
||||
|
||||
export class PageInfo {
|
||||
hasNextPage: boolean;
|
||||
hasPreviousPage: boolean;
|
||||
startCursor?: string;
|
||||
endCursor?: string;
|
||||
}
|
||||
|
||||
export class Post {
|
||||
id: string;
|
||||
isPublished: boolean;
|
||||
title: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export class PostConnection {
|
||||
pageInfo: PageInfo;
|
||||
edges?: PostEdge[];
|
||||
aggregate: AggregatePost;
|
||||
}
|
||||
|
||||
export class PostEdge {
|
||||
node: Post;
|
||||
cursor: string;
|
||||
}
|
||||
|
||||
export class PostPreviousValues {
|
||||
id: string;
|
||||
isPublished: boolean;
|
||||
title: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
export class PostSubscriptionPayload {
|
||||
mutation: MutationType;
|
||||
node?: Post;
|
||||
updatedFields: string[];
|
||||
previousValues?: PostPreviousValues;
|
||||
}
|
||||
|
||||
export class IQuery {
|
||||
getCats(): Cat[] | Promise<Cat[]>;
|
||||
cat(id: string): Cat | Promise<Cat>;
|
||||
posts(
|
||||
where?: PostWhereInput,
|
||||
orderBy?: PostOrderByInput,
|
||||
skip?: number,
|
||||
after?: string,
|
||||
before?: string,
|
||||
first?: number,
|
||||
last?: number,
|
||||
): Post[] | Promise<Post[]>;
|
||||
post(where: PostWhereUniqueInput): Post | Promise<Post>;
|
||||
postsConnection(
|
||||
where?: PostWhereInput,
|
||||
orderBy?: PostOrderByInput,
|
||||
skip?: number,
|
||||
after?: string,
|
||||
before?: string,
|
||||
first?: number,
|
||||
last?: number,
|
||||
): PostConnection | Promise<PostConnection>;
|
||||
node(id: string): Node | Promise<Node>;
|
||||
}
|
||||
|
||||
export class ISubscription {
|
||||
catCreated(): Cat | Promise<Cat>;
|
||||
post(
|
||||
where?: PostSubscriptionWhereInput,
|
||||
): PostSubscriptionPayload | Promise<PostSubscriptionPayload>;
|
||||
}
|
||||
|
||||
export class User {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type Date = any;
|
||||
export type Long = any;
|
||||
export type SearchResult = Droid | Human;
|
||||
@@ -12,21 +12,20 @@
|
||||
"start:prod": "node dist/main.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/common": "5.3.7",
|
||||
"@nestjs/core": "5.3.7",
|
||||
"@nestjs/graphql": "5.3.1",
|
||||
"apollo-server-express": "2.0.6",
|
||||
"@nestjs/common": "5.3.9",
|
||||
"@nestjs/core": "5.3.10",
|
||||
"@nestjs/graphql": "5.4.0",
|
||||
"apollo-server-express": "2.1.0",
|
||||
"graphql": "0.13.2",
|
||||
"graphql-tools": "3.1.1",
|
||||
"prisma": "1.16.2",
|
||||
"prisma-binding": "2.1.5",
|
||||
"graphql-tools": "4.0.0",
|
||||
"prisma-binding": "2.1.6",
|
||||
"reflect-metadata": "0.1.12",
|
||||
"rxjs": "6.3.2",
|
||||
"typescript": "3.0.3"
|
||||
"rxjs": "6.3.3",
|
||||
"typescript": "3.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "1.18.4",
|
||||
"prettier": "1.14.2",
|
||||
"prettier": "1.14.3",
|
||||
"ts-node": "7.0.1",
|
||||
"tsconfig-paths": "3.6.0",
|
||||
"tslint": "5.11.0"
|
||||
|
||||
@@ -168,9 +168,4 @@ export abstract class ISubscription {
|
||||
abstract post(where?: PostSubscriptionWhereInput): PostSubscriptionPayload | Promise<PostSubscriptionPayload>;
|
||||
}
|
||||
|
||||
export class User {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type Long = any;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
8
scripts/prepare.sh
Normal file
8
scripts/prepare.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
# 1. Install all dependencies
|
||||
for D in integration/*; do [ -d "${D}" ] && npm i; done
|
||||
|
||||
# 2. Build fresh packages and move them to sample and integration directories
|
||||
npm run build &>/dev/null
|
||||
|
||||
# 3. Start docker containers to perform integration tests
|
||||
cd integration && docker-compose up -d
|
||||
8
scripts/run-integration.sh
Normal file
8
scripts/run-integration.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
# 1. Build fresh packages and move them integration dit
|
||||
npm run build &>/dev/null
|
||||
|
||||
# 2. Start docker containers to perform integration tests
|
||||
cd integration && docker-compose up -d
|
||||
|
||||
# 3. Run integration tests
|
||||
npm run integration-test
|
||||
3
scripts/test.sh
Normal file
3
scripts/test.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
# Run both unit and integration tests
|
||||
npm run test
|
||||
npm run integration-test
|
||||
@@ -50,7 +50,10 @@
|
||||
],
|
||||
"one-variable-per-declaration": [
|
||||
false
|
||||
]
|
||||
],
|
||||
"no-return-await": true,
|
||||
"match-default-export-name": true,
|
||||
"prefer-readonly": true
|
||||
},
|
||||
"rulesDirectory": []
|
||||
}
|
||||
Reference in New Issue
Block a user