Skip to content

Commit e6c20ee

Browse files
committed
chore(): resolve conflicts
2 parents 19686b6 + 51735dc commit e6c20ee

File tree

254 files changed

+29396
-36045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+29396
-36045
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.16.0
1+
18.14.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(The MIT License)
22

3-
Copyright (c) 2017-2022 Kamil Myśliwiec <http://kamilmysliwiec.com>
3+
Copyright (c) 2017-2023 Kamil Myśliwiec <http://kamilmysliwiec.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

content/cli/libraries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Any functionality that is suitable for re-use is a candidate for being managed a
1919
To get started with creating a library, run the following command:
2020

2121
```bash
22-
nest g library my-library
22+
$ nest g library my-library
2323
```
2424

2525
When you run the command, the `library` schematic prompts you for a prefix (AKA alias) for the library:
@@ -78,7 +78,7 @@ As with application-type projects, libraries each have their own `tsconfig.lib.j
7878
You can build the library with the CLI command:
7979
8080
```bash
81-
nest build my-library
81+
$ nest build my-library
8282
```
8383
8484
#### Using libraries

content/cli/workspaces.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To enable monorepo mode, you start with a _standard mode_ structure, and add **p
2626
If we run:
2727

2828
```bash
29-
nest new my-project
29+
$ nest new my-project
3030
```
3131

3232
We've constructed a _standard mode_ structure, with a folder structure that looks like this:
@@ -49,8 +49,8 @@ We've constructed a _standard mode_ structure, with a folder structure that look
4949
We can convert this to a monorepo mode structure as follows:
5050

5151
```bash
52-
cd my-project
53-
nest generate app my-app
52+
$ cd my-project
53+
$ nest generate app my-app
5454
```
5555

5656
At this point, `nest` converts the existing structure to a **monorepo mode** structure. This results in a few important changes. The folder structure now looks like this:

content/controllers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ getDocs(@Query('version') version) {
268268

269269
Routes with static paths won't work when you need to accept **dynamic data** as part of the request (e.g., `GET /cats/1` to get cat with id `1`). In order to define routes with parameters, we can add route parameter **tokens** in the path of the route to capture the dynamic value at that position in the request URL. The route parameter token in the `@Get()` decorator example below demonstrates this usage. Route parameters declared in this way can be accessed using the `@Param()` decorator, which should be added to the method signature.
270270

271+
> info **Hint** Routes with parameters should be declared after any static paths. This prevents the parameterized paths from intercepting traffic destined for the static paths.
272+
271273
```typescript
272274
@@filename()
273275
@Get(':id')

content/discover/who-uses.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@
269269
"https://bewith.io",
270270
"https://swetrix.com",
271271
"https://swyftlogistics.com",
272-
"https://evershop.io"
272+
"https://evershop.io",
273+
"https://e-design.ca",
274+
"https://growthmill.com"
273275
]
274-
}
276+
}

content/exception-filters.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Out of the box, this action is performed by a built-in **global exception filter
1515
}
1616
```
1717

18-
> info **Hint** The global exception filter partially supports the `http-errors` library. Basically, any thrown exception containing the `statusCode` and `message` property will be properly populated and send back as a response (instead of the default `InternalServerErrorException` for unrecognized exceptions).
18+
> info **Hint** The global exception filter partially supports the `http-errors` library. Basically, any thrown exception containing the `statusCode` and `message` properties will be properly populated and sent back as a response (instead of the default `InternalServerErrorException` for unrecognized exceptions).
1919
2020
#### Throwing standard exceptions
2121

@@ -72,11 +72,11 @@ async findAll() {
7272
await this.service.findAll()
7373
} catch (error) {
7474
throw new HttpException({
75-
status: HttpStatus.FORBIDDEN,
76-
error: 'This is a custom message',
77-
}, HttpStatus.FORBIDDEN, {
78-
cause: error
79-
});
75+
status: HttpStatus.FORBIDDEN,
76+
error: 'This is a custom message',
77+
}, HttpStatus.FORBIDDEN, {
78+
cause: error
79+
});
8080
}
8181
}
8282
```
@@ -206,6 +206,8 @@ export class HttpExceptionFilter {
206206

207207
> info **Hint** All exception filters should implement the generic `ExceptionFilter<T>` interface. This requires you to provide the `catch(exception: T, host: ArgumentsHost)` method with its indicated signature. `T` indicates the type of the exception.
208208
209+
> warning **Warning** If you are using `@nestjs/platform-fastify` you can use `response.send()` instead of `response.json()`. Don't forget to import the correct types from `fastify`.
210+
209211
The `@Catch(HttpException)` decorator binds the required metadata to the exception filter, telling Nest that this particular filter is looking for exceptions of type `HttpException` and nothing else. The `@Catch()` decorator may take a single parameter, or a comma-separated list. This lets you set up the filter for several types of exceptions at once.
210212

211213
#### Arguments host
@@ -347,6 +349,8 @@ export class AllExceptionsFilter implements ExceptionFilter {
347349
}
348350
```
349351

352+
> warning **Warning** When combining an exception filter that catches everything with a filter that is bound to a specific type, the "Catch anything" filter should be declared first to allow the specific filter to correctly handle the bound type.
353+
350354
#### Inheritance
351355

352356
Typically, you'll create fully customized exception filters crafted to fulfill your application requirements. However, there might be use-cases when you would like to simply extend the built-in default **global exception filter**, and override the behavior based on certain factors.

content/faq/errors.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Probably the most common error message is about Nest not being able to resolve d
1010
Nest can't resolve dependencies of the <provider> (?). Please make sure that the argument <unknown_token> at index [<index>] is available in the <module> context.
1111
1212
Potential solutions:
13+
- Is <module> a valid NestJS module?
1314
- If <unknown_token> is a provider, is it part of the current <module>?
1415
- If <unknown_token> is exported from a separate @Module, is that module imported within <module>?
1516
@Module({
@@ -56,6 +57,7 @@ This likely happens when your project end up loading two Node modules of the pac
5657
Solutions:
5758
5859
- For **Yarn** Workspaces, use the [nohoist feature](https://classic.yarnpkg.com/blog/2018/02/15/nohoist) to prevent hoisting the package `@nestjs/core`.
60+
- For **pnpm** Workspaces, set `@nestjs/core` as a peerDependencies in your other module and `"dependenciesMeta": {{ '{' }}"other-module-name": {{ '{' }}"injected": true{{ '}}' }}` in the app package.json where the module is imported. see: [dependenciesmetainjected](https://pnpm.io/package_json#dependenciesmetainjected)
5961
6062
#### "Circular dependency" error
6163

content/faq/raw-body.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
One of the most common use-case for having access to the raw request body is performing webhook signature verifications. Usually to perform webhook signature validations the unserialized request body is required to calculate an HMAC hash.
44

5+
> warning **Warning** This feature can be used only if the built-in global body parser middleware is enabled, ie., you must not pass `bodyParser: false` when creating the app.
6+
57
#### Use with Express
68

79
First enable the option when creating your Nest Express application:
@@ -35,7 +37,7 @@ First enable the option when creating your Nest Fastify application:
3537
```typescript
3638
const app = await NestFactory.create<NestFastifyApplication>(
3739
AppModule,
38-
new FastifyAdapter()
40+
new FastifyAdapter(),
3941
{
4042
rawBody: true,
4143
}

content/faq/request-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Interceptors, for the most part, follow the same pattern as guards, with one cat
3434

3535
#### Pipes
3636

37-
Pipes follow the standard global to controller to route bound sequence, with the same first in first out in regards to the `@usePipes()` parameters. However, at a route parameter level, if you have multiple pipes running, they will run in the order of the last parameter with a pipe to the first. This also applies to the route level and controller level pipes. For example, if we have the following controller:
37+
Pipes follow the standard global to controller to route bound sequence, with the same first in first out in regards to the `@UsePipes()` parameters. However, at a route parameter level, if you have multiple pipes running, they will run in the order of the last parameter with a pipe to the first. This also applies to the route level and controller level pipes. For example, if we have the following controller:
3838

3939
```typescript
4040
@UsePipes(GeneralValidationPipe)

0 commit comments

Comments
 (0)