Skip to content

Commit 5f735b1

Browse files
bugfix: deprecate missing @pipe() decorator, fix HttpModule
1 parent 4fad0ae commit 5f735b1

20 files changed

Lines changed: 70 additions & 46 deletions

File tree

bundle/.DS_Store

0 Bytes
Binary file not shown.

bundle/common/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
21+
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
2222
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
2323
</p>
2424
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)

bundle/core/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
21+
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
2222
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
2323
</p>
2424
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)

bundle/microservices/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
21+
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
2222
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
2323
</p>
2424
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)

bundle/testing/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
21+
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
2222
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
2323
</p>
2424
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)

bundle/websockets/Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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>
21-
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-dc3d53.svg"/></a>
21+
<a href="https://paypal.me/kamilmysliwiec"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
2222
<a href="https://twitter.com/nestframework"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
2323
</p>
2424
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)

packages/common/decorators/core/component.decorator.ts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,58 @@ export function Injectable(): ClassDecorator {
99
}
1010

1111
/**
12+
* @deprecated
1213
* Defines the Component. The component can inject dependencies through constructor.
1314
* Those dependencies have to belong to the same module.
1415
*/
1516
export function Component(): ClassDecorator {
16-
deprecate('The @Component() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.')
17+
deprecate(
18+
'The @Component() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
19+
);
1720
return (target: object) => {};
1821
}
1922

2023
/**
24+
* @deprecated
2125
* Defines the Pipe. The Pipe should implement the `PipeTransform` interface.
2226
*/
2327
export function Pipe(): ClassDecorator {
28+
deprecate(
29+
'The @Pipe() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
30+
);
2431
return (target: object) => {};
2532
}
2633

2734
/**
35+
* @deprecated
2836
* Defines the Guard. The Guard should implement the `CanActivate` interface.
2937
*/
3038
export function Guard(): ClassDecorator {
31-
deprecate('The @Guard() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.')
39+
deprecate(
40+
'The @Guard() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
41+
);
3242
return (target: object) => {};
3343
}
3444

3545
/**
46+
* @deprecated
3647
* Defines the Middleware. The Middleware should implement the `NestMiddleware` interface.
3748
*/
3849
export function Middleware(): ClassDecorator {
39-
deprecate('The @Middleware() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.')
50+
deprecate(
51+
'The @Middleware() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
52+
);
4053
return (target: object) => {};
4154
}
4255

4356
/**
57+
* @deprecated
4458
* Defines the Interceptor. The Interceptor should implement `HttpInterceptor`, `RpcInterceptor` or `WsInterceptor` interface.
4559
*/
4660
export function Interceptor(): ClassDecorator {
47-
deprecate('The @Interceptor() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.')
61+
deprecate(
62+
'The @Interceptor() decorator is deprecated and will be removed within next major release. Use @Injectable() instead.',
63+
);
4864
return (target: object) => {};
4965
}
5066

packages/common/http/http.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Module } from '../decorators/modules/module.decorator';
22
import { HttpService } from './http.service';
33

44
@Module({
5-
components: [HttpService],
5+
providers: [HttpService],
66
exports: [HttpService],
77
})
88
export class HttpModule {}

packages/common/pipes/parse-int.pipe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { BadRequestException } from '../exceptions/bad-request.exception';
22
import { PipeTransform } from '../interfaces/features/pipe-transform.interface';
3-
import { ArgumentMetadata, Pipe } from '../index';
3+
import { ArgumentMetadata, Injectable } from '../index';
44

5-
@Pipe()
5+
@Injectable()
66
export class ParseIntPipe implements PipeTransform<string> {
77
async transform(value: string, metadata: ArgumentMetadata): Promise<number> {
88
const isNumeric =

packages/common/pipes/validation.pipe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { classToPlain, plainToClass } from 'class-transformer';
33
import { PipeTransform } from '../interfaces/features/pipe-transform.interface';
44
import { ArgumentMetadata, BadRequestException } from '../index';
55
import { isNil } from '../utils/shared.utils';
6-
import { Pipe } from './../decorators/core/component.decorator';
6+
import { Injectable } from './../decorators/core/component.decorator';
77

88
export interface ValidationPipeOptions extends ValidatorOptions {
99
transform?: boolean;
1010
}
1111

12-
@Pipe()
12+
@Injectable()
1313
export class ValidationPipe implements PipeTransform<any> {
1414
private isTransformEnabled: boolean;
1515
private validatorOptions: ValidatorOptions;

0 commit comments

Comments
 (0)