Skip to content

Commit 93bdb62

Browse files
merge: resolve conflicts
2 parents 773d062 + db94dc5 commit 93bdb62

30 files changed

Lines changed: 102 additions & 94 deletions

CONTRIBUTING.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
We would love for you to contribute to Nest and help make it even better than it is
44
today! As a contributor, here are the guidelines we would like you to follow:
55

6-
* [Code of Conduct](#coc)
6+
<!--* [Code of Conduct](#coc)-->
77
* [Question or Problem?](#question)
88
* [Issues and Bugs](#issue)
99
* [Feature Requests](#feature)
@@ -76,10 +76,15 @@ You can file new issues by filling out our [new issue form](https://github.com/n
7676

7777
Before you submit your Pull Request (PR) consider the following guidelines:
7878

79+
<!--
80+
To the first point
81+
82+
1. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
83+
We cannot accept code without this.
84+
-->
85+
7986
1. Search [GitHub](https://github.com/nestjs/nest/pulls) for an open or closed PR
8087
that relates to your submission. You don't want to duplicate effort.
81-
<!-- 1. Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
82-
We cannot accept code without this. -->
8388
1. Fork the nestjs/nest repo.
8489
1. Make your changes in a new git branch:
8590

@@ -195,10 +200,11 @@ $ npm run lint
195200
196201
To ensure consistency throughout the source code, keep these rules in mind as you are working:
197202
198-
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
199-
<!--
203+
<!--
200204
// We're working on auto-documentation.
201205
* All public API methods **must be documented**. (Details TBC). -->
206+
207+
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
202208
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at
203209
**100 characters**. An automated formatter is available, see
204210
[DEVELOPER.md](docs/DEVELOPER.md#clang-format).
@@ -272,8 +278,8 @@ There are currently a few exceptions to the "use package name" rule:
272278
* **packaging**: used for changes that change the npm package layout in all of our packages, e.g. public path changes, package.json changes done to all packages, d.ts file/format changes, changes to bundles, etc.
273279
* **changelog**: used for updating the release notes in CHANGELOG.md
274280
* **sample/#**: for the example apps directory, replacing # with the example app number
275-
<!-- * **aio**: used for docs-app (angular.io) related changes within the /aio directory of the repo -->
276281
* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)
282+
<!-- * **aio**: used for docs-app (angular.io) related changes within the /aio directory of the repo -->
277283
278284
### Subject
279285

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"packages": [
44
"packages/*"
55
],
6-
"version": "5.4.0"
6+
"version": "5.4.1"
77
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nestjs",
3-
"version": "5.4.0",
3+
"version": "5.4.1",
44
"description": "Modern, fast, powerful node.js web framework",
55
"scripts": {
66
"coverage": "nyc report --reporter=text-lcov | coveralls",

packages/common/Readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
1515
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
1616
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
17-
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#7" alt="Coverage" /></a>
17+
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#8" alt="Coverage" /></a>
1818
<a href="https://gitter.im/nestjs/nestjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://badges.gitter.im/nestjs/nestjs.svg" alt="Gitter" /></a>
1919
<a href="https://opencollective.com/nest#backer"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
2020
<a href="https://opencollective.com/nest#sponsor"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
@@ -53,12 +53,12 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
5353
<a href="http://xtremis.com/"><img src="https://nestjs.com/img/logo-xtremis.svg" width="220" /></a>
5454

5555
#### Silver Sponsors
56-
57-
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /></a>
56+
<a href="https://neoteric.eu/"><img src="https://nestjs.com/img/neoteric-cut.png" width="120" /></a> &nbsp;
57+
<a href="http://gojob.com"><img src="http://nestjs.com/img/gojob-logo.png" valign="bottom" height="95" /></a> &nbsp; <a href="https://www.swingdev.io"><img src="https://nestjs.com/img/swingdev-logo.svg#1" width="150" /> </a>
5858

5959
#### Sponsors
6060

61-
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> &nbsp; <a href="http://gojob.com"><img src="https://gojob.com/w/wp-content/uploads/2017/02/cropped-Logo-web-home.png" height="40" /> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a> &nbsp; <a href="https://genuinebee.com/"><img src="https://nestjs.com/img/genuinebee.svg" height="38" /></a> &nbsp; <a href="http://architectnow.net/"><img src="https://nestjs.com/img/architectnow.png" height="24" /></a> &nbsp; <a href="https://quander.io/"><img src="https://nestjs.com/img/quander.png" height="28" /></a>
61+
<a href="https://scal.io"><img src="https://nestjs.com/img/scalio-logo.svg" width="110" /></a> &nbsp; <a href="http://angularity.io"><img src="http://angularity.io/media/logo.svg" height="30" /></a> &nbsp; <!--<a href="https://keycdn.com"><img src="https://nestjs.com/img/keycdn.svg" height="30" /></a> &nbsp;--> <a href="https://hostpresto.com"><img src="https://nestjs.com/img/hostpresto.png" height="30" /></a> &nbsp; <a href="https://genuinebee.com/"><img src="https://nestjs.com/img/genuinebee.svg" height="38" /></a> &nbsp; <a href="http://architectnow.net/"><img src="https://nestjs.com/img/architectnow.png" height="24" /></a> &nbsp; <a href="https://quander.io/"><img src="https://nestjs.com/img/quander.png" height="28" /></a>
6262

6363

6464
## Backers
Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11
import { Observable, of } from 'rxjs';
22
import { tap } from 'rxjs/operators';
33
import { Inject, Injectable, Optional } from '../../decorators';
4-
import {
5-
ExecutionContext,
6-
HttpServer,
7-
NestInterceptor,
8-
} from '../../interfaces';
4+
import { ExecutionContext, NestInterceptor } from '../../interfaces';
95
import { CACHE_KEY_METADATA, CACHE_MANAGER } from '../cache.constants';
106

11-
// NOTE (external)
12-
// We need to deduplicate them here due to the circular dependency
13-
// between core and common packages
14-
const HTTP_SERVER_REF = 'HTTP_SERVER_REF';
7+
const APPLICATION_REFERENCE_HOST = 'ApplicationReferenceHost';
158
const REFLECTOR = 'Reflector';
169

1710
@Injectable()
1811
export class CacheInterceptor implements NestInterceptor {
19-
protected readonly isHttpApp: boolean;
12+
@Optional()
13+
@Inject(APPLICATION_REFERENCE_HOST)
14+
protected readonly applicationRefHost: any;
2015

2116
constructor(
22-
@Optional()
23-
@Inject(HTTP_SERVER_REF)
24-
protected readonly httpServer: HttpServer,
2517
@Inject(CACHE_MANAGER) protected readonly cacheManager: any,
2618
@Inject(REFLECTOR) protected readonly reflector: any,
27-
) {
28-
this.isHttpApp = httpServer && !!httpServer.getRequestMethod;
29-
}
19+
) {}
3020

3121
async intercept(
3222
context: ExecutionContext,
@@ -50,13 +40,16 @@ export class CacheInterceptor implements NestInterceptor {
5040
}
5141

5242
trackBy(context: ExecutionContext): string | undefined {
53-
if (!this.isHttpApp) {
43+
const httpServer = this.applicationRefHost.applicationRef;
44+
const isHttpApp = httpServer && !!httpServer.getRequestMethod;
45+
46+
if (!isHttpApp) {
5447
return this.reflector.get(CACHE_KEY_METADATA, context.getHandler());
5548
}
5649
const request = context.getArgByIndex(0);
57-
if (this.httpServer.getRequestMethod(request) !== 'GET') {
50+
if (httpServer.getRequestMethod(request) !== 'GET') {
5851
return undefined;
5952
}
60-
return this.httpServer.getRequestUrl(request);
53+
return httpServer.getRequestUrl(request);
6154
}
6255
}

packages/common/files/interceptors/file-fields.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ export function FileFieldsInterceptor(
1919
localOptions?: MulterOptions,
2020
): Type<NestInterceptor> {
2121
class MixinInterceptor implements NestInterceptor {
22-
readonly upload: MulterInstance;
22+
protected multer: MulterInstance;
2323

2424
constructor(
2525
@Optional()
2626
@Inject(MULTER_MODULE_OPTIONS)
2727
options: MulterModuleOptions = {},
2828
) {
29-
this.upload = multer({
29+
this.multer = multer({
3030
...options,
3131
...localOptions,
3232
});
@@ -39,7 +39,7 @@ export function FileFieldsInterceptor(
3939
const ctx = context.switchToHttp();
4040

4141
await new Promise((resolve, reject) =>
42-
this.upload.fields(uploadFields)(
42+
this.multer.fields(uploadFields)(
4343
ctx.getRequest(),
4444
ctx.getResponse(),
4545
(err: any) => {

packages/common/files/interceptors/file.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ export function FileInterceptor(
1616
localOptions?: MulterOptions,
1717
): Type<NestInterceptor> {
1818
class MixinInterceptor implements NestInterceptor {
19-
readonly upload: MulterInstance;
19+
protected multer: MulterInstance;
2020

2121
constructor(
2222
@Optional()
2323
@Inject(MULTER_MODULE_OPTIONS)
2424
options: MulterModuleOptions = {},
2525
) {
26-
this.upload = multer({
26+
this.multer = multer({
2727
...options,
2828
...localOptions,
2929
});
@@ -36,7 +36,7 @@ export function FileInterceptor(
3636
const ctx = context.switchToHttp();
3737

3838
await new Promise((resolve, reject) =>
39-
this.upload.single(fieldName)(
39+
this.multer.single(fieldName)(
4040
ctx.getRequest(),
4141
ctx.getResponse(),
4242
(err: any) => {

packages/common/files/interceptors/files.interceptor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ export function FilesInterceptor(
1717
localOptions?: MulterOptions,
1818
): Type<NestInterceptor> {
1919
class MixinInterceptor implements NestInterceptor {
20-
readonly upload: MulterInstance;
20+
protected multer: MulterInstance;
2121

2222
constructor(
2323
@Optional()
2424
@Inject(MULTER_MODULE_OPTIONS)
2525
options: MulterModuleOptions = {},
2626
) {
27-
this.upload = multer({
27+
this.multer = multer({
2828
...options,
2929
...localOptions,
3030
});
@@ -37,7 +37,7 @@ export function FilesInterceptor(
3737
const ctx = context.switchToHttp();
3838

3939
await new Promise((resolve, reject) =>
40-
this.upload.array(fieldName, maxCount)(
40+
this.multer.array(fieldName, maxCount)(
4141
ctx.getRequest(),
4242
ctx.getResponse(),
4343
(err: any) => {

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nestjs/common",
3-
"version": "5.4.0",
3+
"version": "5.4.1",
44
"description": "Nest - modern, fast, powerful node.js web framework (@common)",
55
"author": "Kamil Mysliwiec",
66
"repository": {

0 commit comments

Comments
 (0)