Skip to content

Commit 2036e03

Browse files
committed
chore(): resolved conflicts
2 parents 8a7871e + 443311a commit 2036e03

File tree

8 files changed

+752
-479
lines changed

8 files changed

+752
-479
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
88
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
99
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
10-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
11-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
1210
<a href="https://coveralls.io/github/nestjs/nest?branch=master"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#6" alt="Coverage" /></a>
1311
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
1412
<a href="https://dev.to/nestjs"><img src="https://img.shields.io/badge/blog-dev.to-green"/></a>

content/cli/overview.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22

33
The [Nest CLI](https://github.com/nestjs/nest-cli) is a command-line interface tool that helps you to initialize, develop, and maintain your Nest applications. It assists in multiple ways, including scaffolding the project, serving it in development mode, and building and bundling the application for production distribution. It embodies best-practice architectural patterns to encourage well-structured apps.
44

5-
#### Requirements
6-
7-
Nest CLI requires a Node.js binary built with [internationalization support](https://nodejs.org/api/intl.html) (ICU), such as the official binaries from the [Node.js project page](https://nodejs.org/en/download). If you encounter errors related to ICU, check that your binary meets this requirement.
8-
9-
```bash
10-
node -p process.versions.icu
11-
```
12-
13-
If the command prints `undefined`, your Node.js binary has no internationalization support.
14-
155
#### Installation
166

177
**Note**: In this guide we describe using [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to install packages, including the Nest CLI. Other package managers may be used at your discretion. With npm, you have several options available for managing how your OS command line resolves the location of the `nest` CLI binary file. Here, we describe installing the `nest` binary globally using the `-g` option. This provides a measure of convenience, and is the approach we assume throughout the documentation. Note that installing **any** `npm` package globally leaves the responsibility of ensuring they're running the correct version up to the user. It also means that if you have different projects, each will run the **same** version of the CLI. A reasonable alternative is to use the [npx](https://github.com/npm/cli/blob/latest/docs/lib/content/commands/npx.md) program, built into the `npm` cli (or similar features with other package managers) to ensure that you run a **managed version** of the Nest CLI. We recommend you consult the [npx documentation](https://github.com/npm/cli/blob/latest/docs/lib/content/commands/npx.md) and/or your DevOps support staff for more information.
@@ -106,3 +96,13 @@ See [usage](/cli/usages) for detailed descriptions for each command.
10696
| `start` | | Compiles and runs an application (or default project in a workspace). |
10797
| `add` | | Imports a library that has been packaged as a **nest library**, running its install schematic. |
10898
| `info` | `i` | Displays information about installed nest packages and other helpful system info. |
99+
100+
#### Requirements
101+
102+
Nest CLI requires a Node.js binary built with [internationalization support](https://nodejs.org/api/intl.html) (ICU), such as the official binaries from the [Node.js project page](https://nodejs.org/en/download). If you encounter errors related to ICU, check that your binary meets this requirement.
103+
104+
```bash
105+
node -p process.versions.icu
106+
```
107+
108+
If the command prints `undefined`, your Node.js binary has no internationalization support.

content/discover/who-uses.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@
278278
"https://e-design.ca",
279279
"https://growthmill.com",
280280
"https://tarken.com.br",
281-
"https://remato.com"
281+
"https://remato.com",
282+
"https://remberg.de/en"
282283
]
283284
}

content/fundamentals/circular-dependency.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,13 @@ In order to resolve circular dependencies between modules, use the same `forward
7171
})
7272
export class CommonModule {}
7373
```
74+
75+
That covers one side of the relationship. Now let's do the same with `CatsModule`:
76+
77+
```typescript
78+
@@filename(cats.module)
79+
@Module({
80+
imports: [forwardRef(() => CommonModule)],
81+
})
82+
export class CatsModule {}
83+
```

content/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ npm i -g @nestjs/cli
2323
$ nest new project-name
2424
```
2525

26-
> info **Hint** To create a new project with TypeScript's [strict](https://www.typescriptlang.org/tsconfig#strict) mode enabled, pass the `--strict` flag to the `nest new` command.
26+
> info **Hint** To create a new TypeScript project with stricter feature set, pass the `--strict` flag to the `nest new` command.
2727
2828
#### Alternatives
2929

content/security/authentication.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class AuthService {
135135
this.usersService = usersService;
136136
}
137137

138-
async signIn(username, pass) {
138+
async signIn(username: string, pass: string) {
139139
const user = await this.usersService.findOne(username);
140140
if (user?.password !== pass) {
141141
throw new UnauthorizedException();
@@ -237,7 +237,7 @@ export class AuthService {
237237
if (user?.password !== pass) {
238238
throw new UnauthorizedException();
239239
}
240-
const payload = { username: user.username, sub: user.userId };
240+
const payload = { sub: user.userId, username: user.username };
241241
return {
242242
access_token: await this.jwtService.signAsync(payload),
243243
};
@@ -348,7 +348,7 @@ Let's go ahead and test our routes using cURL again. You can test with any of th
348348
```bash
349349
$ # POST to /auth/login
350350
$ curl -X POST http://localhost:3000/auth/login -d '{"username": "john", "password": "changeme"}' -H "Content-Type: application/json"
351-
$ # result -> {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}
351+
{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}
352352
$ # Note: above JWT truncated
353353
```
354354

@@ -445,15 +445,15 @@ Ensure the app is running, and test the routes using `cURL`.
445445
```bash
446446
$ # GET /profile
447447
$ curl http://localhost:3000/auth/profile
448-
$ # result -> {"statusCode":401,"message":"Unauthorized"}
448+
{"statusCode":401,"message":"Unauthorized"}
449449

450450
$ # POST /auth/login
451451
$ curl -X POST http://localhost:3000/auth/login -d '{"username": "john", "password": "changeme"}' -H "Content-Type: application/json"
452-
$ # result -> {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vybm... }
452+
{"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vybm..."}
453453

454454
$ # GET /profile using access_token returned from previous step as bearer code
455455
$ curl http://localhost:3000/auth/profile -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2Vybm..."
456-
$ # result -> {"userId":1,"username":"john"}
456+
{"sub":1,"username":"john","iat":...,"exp":...}
457457
```
458458

459459
Note that in the `AuthModule`, we configured the JWT to have an expiration of `60 seconds`. This is too short an expiration, and dealing with the details of token expiration and refresh is beyond the scope of this article. However, we chose that to demonstrate an important quality of JWTs. If you wait 60 seconds after authenticating before attempting a `GET /auth/profile` request, you'll receive a `401 Unauthorized` response. This is because `@nestjs/jwt` automatically checks the JWT for its expiration time, saving you the trouble of doing so in your application.

content/techniques/task-scheduling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Some sample cron patterns are:
100100
</tbody>
101101
</table>
102102

103-
The `@nestjs/schedule` package provides a convenience enum with commonly used cron patterns. You can use this enum as follows:
103+
The `@nestjs/schedule` package provides a convenient enum with commonly used cron patterns. You can use this enum as follows:
104104

105105
```typescript
106106
import { Injectable, Logger } from '@nestjs/common';

0 commit comments

Comments
 (0)