Skip to content

Commit 9e6da71

Browse files
committed
docs: update READMEs
1 parent 1a3ed41 commit 9e6da71

File tree

10 files changed

+42
-10
lines changed

10 files changed

+42
-10
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This repository contains several helpful packages for NestJS that I have develop
1818
| [AMQP-Transport](./packages/amqp-transport/README.md) | A NestJS microservice adapter around [AMQPlib] supporting exchanges. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-amqp-transport.svg?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-amqp-transport) |
1919
| [Async-Local-Storage](./packages/async-local-storage/README.md) | A NestJS module to track context with [AsyncLocalStorage]. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-async-local-storage?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-async-local-storage) |
2020
| [Cluster](./packages/cluster/README.md) | A class to manage workers' lifecycle in a (Node.js) [cluster]. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-cluster?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-cluster) |
21+
| [ESLint-Rules](./packages/eslint-rules/README.md) | A set of ESLint rules for NestJS applications. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-eslint-rules?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-eslint-rules) |
2122
| [File-Storage](./packages/file-storage/README.md) | A NestJS module supporting [FS], [S3] and [GCP] strategies. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-file-storage?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-file-storage) |
2223
| [Lock](./packages/lock/README.md) | A NestJS module to provide a distributed lock for your application. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-lock?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-lock) |
2324
| [Fastify-Upload](./packages/fastify-upload/README.md) | A NestJS module to provide file upload support for Fastify. | [![npm](https://img.shields.io/npm/v/@getlarge/nestjs-tools-fastify-upload?style=flat)](https://npmjs.org/package/@getlarge/nestjs-tools-fastify-upload) |

packages/amqp-transport/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ A custom AMQP strategy for Nest microservice transport, which extends NestJS AMQ
1212

1313
By enabling exchanges you can broadcast messages to multiple queues, and by asserting reply queue you can ensure that reply queue with static name exists.
1414

15+
## Installation
16+
17+
```bash
18+
npm install --save @getlarge/nestjs-tools-amqp-transport
19+
```
20+
1521
## Example
1622

1723
The integration tests contain an [example consumer](./test/dummy-consumer.controller.mock.ts) and [example producer](./test/dummy-producer.service.mock.ts) that demonstrate how to use this library.

packages/async-local-storage/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Installation
99

1010
```bash
11-
$ npm install --save @getlarge/nestjs-tools-async-local-storage
11+
npm install --save @getlarge/nestjs-tools-async-local-storage
1212
```
1313

1414
## Usage

packages/cluster/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `ClusterService` class is a wrapper around the native `cluster` module and p
1111
## Installation
1212

1313
```bash
14-
$ npm install --save @getlarge/nestjs-tools-cluster
14+
npm install --save @getlarge/nestjs-tools-cluster
1515
```
1616

1717
## Example

packages/eslint-rules/README.md

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
11
# eslint-rules
22

3-
This library was generated with [Nx](https://nx.dev).
3+
[![npm][npm-image]][npm-url]
44

5-
## Running unit tests
5+
[npm-image]: https://img.shields.io/npm/v/@getlarge/nestjs-tools-eslint-rules.svg?style=flat
6+
[npm-url]: https://npmjs.org/package/@getlarge/nestjs-tools-eslint-rules
67

7-
Run `nx test eslint-rules` to execute the unit tests via [Jest](https://jestjs.io).
8+
This set of ESLint rules is provided to enforce a consistent patterns and practices across all NestJS projects.
9+
10+
## Installation
11+
12+
```bash
13+
npm install --save @getlarge/nestjs-tools-eslint-rules
14+
```
15+
16+
## Usage
17+
18+
### return-class-instance
19+
20+
This rule enforces that all public Service methods return a class instance of the same return type.
21+
The purpose of this rule is to ensure you return class instances instead of plain objects, which is essentials when using the [`ClassSerializerInterceptor`](https://docs.nestjs.com/techniques/serialization#class-serializer-interceptor).
22+
23+
```json
24+
{
25+
"rules": {
26+
"@getlarge/nestjs-tools-eslint-rules/return-class-instance": "error",
27+
}
28+
}
29+
```

packages/eslint-rules/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"access": "public"
1818
},
1919
"dependencies": {},
20+
"peerDependencies": {
21+
"eslint": "7 || 8 || 9"
22+
},
2023
"type": "commonjs",
2124
"main": "./src/index.js",
2225
"typings": "./src/index.d.ts"

packages/eslint-rules/src/lib/return-class-instance.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import { ESLintUtils } from '@typescript-eslint/utils';
1919

2020
// NOTE: The rule will be available in ESLint configs as "@nx/workspace/return-class-instance"
21-
export const RULE_NAME = 'return-class-instance';
21+
export const RULE_NAME = '@getlarge/nestjs-tools-eslint-rules/return-class-instance';
2222

2323
const getTypeNameFromReturnType = (rawReturnType: string) => {
2424
return rawReturnType.replaceAll(/Promise<([^<>]*)>/g, '$1').replace(': ', '');

packages/fastify-upload/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Read [this issue](https://github.com/getlarge/nestjs-tools/issues/71) to underst
1515
## Installation
1616

1717
```bash
18-
$ npm install --save @getlarge/nestjs-tools-fastify-upload
18+
npm install --save @getlarge/nestjs-tools-fastify-upload
1919
```
2020

2121
## Usage

packages/file-storage/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Supoorted backends:
1616
## Installation
1717

1818
```bash
19-
$ npm install --save @getlarge/nestjs-tools-file-storage
19+
npm install --save @getlarge/nestjs-tools-file-storage
2020
```
2121

2222
## Example
@@ -122,7 +122,7 @@ The recommended approach is to setup [Application Default Credentials](https://c
122122

123123
If, after upgrading, you get the following error:
124124

125-
```
125+
```sh
126126
/usr/local/bin/node[57897]: ../src/node_http_parser.cc:517:static void node::(anonymous namespace)::Parser::Execute(const FunctionCallbackInfo<v8::Value> &): Assertion `parser->current_buffer_.IsEmpty()' failed.
127127
```
128128

packages/lock/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It is based on [Redlock](https://www.npmjs.com/package/redlock) module.
1111
## Installation
1212

1313
```bash
14-
$ npm install --save @getlarge/nestjs-tools-lock
14+
npm install --save @getlarge/nestjs-tools-lock
1515
```
1616

1717
## Usage

0 commit comments

Comments
 (0)