Skip to content

Commit 4084574

Browse files
committed
chore(): resolved conflicts
2 parents 3cc4765 + 2a72046 commit 4084574

File tree

12 files changed

+277
-331
lines changed

12 files changed

+277
-331
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
33
</p>
44

5-
[travis-image]: https://api.travis-ci.org/nestjs/nest.svg?branch=master
6-
[travis-url]: https://travis-ci.org/nestjs/nest
7-
[linux-image]: https://img.shields.io/travis/nestjs/nest/master.svg?label=linux
8-
[linux-url]: https://travis-ci.org/nestjs/nest
9-
105
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
116
<p align="center">
127
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>

content/cli/overview.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,27 @@
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-
#### Installation
5+
#### Requirements
66

7-
**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.
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.
814

15+
#### Installation
916

17+
**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.
1018

1119
Install the CLI globally using the `npm install -g` command (see the **Note** above for details about global installs).
1220

1321
```bash
1422
$ npm install -g @nestjs/cli
1523
```
1624

17-
> info **Hint** Alternatively, you can use this command `npx @nestjs/cli@latest` without installing the cli globally.
25+
> info **Hint** Alternatively, you can use this command `npx @nestjs/cli@latest` without installing the cli globally.
1826
1927
#### Basic workflow
2028

@@ -90,11 +98,11 @@ Run `nest <command> --help` for any of the following commands to see command-spe
9098

9199
See [usage](/cli/usages) for detailed descriptions for each command.
92100

93-
| Command | Alias | Description |
94-
| ---------- | ----- | ----------------------------------------------------------------------------------------------------- |
95-
| `new` | `n` | Scaffolds a new _standard mode_ application with all boilerplate files needed to run. |
96-
| `generate` | `g` | Generates and/or modifies files based on a schematic. |
97-
| `build` | | Compiles an application or workspace into an output folder. |
98-
| `start` | | Compiles and runs an application (or default project in a workspace). |
99-
| `add` | | Imports a library that has been packaged as a **nest library**, running its install schematic. |
100-
| `info` | `i` | Displays information about installed nest packages and other helpful system info. |
101+
| Command | Alias | Description |
102+
| ---------- | ----- | ---------------------------------------------------------------------------------------------- |
103+
| `new` | `n` | Scaffolds a new _standard mode_ application with all boilerplate files needed to run. |
104+
| `generate` | `g` | Generates and/or modifies files based on a schematic. |
105+
| `build` | | Compiles an application or workspace into an output folder. |
106+
| `start` | | Compiles and runs an application (or default project in a workspace). |
107+
| `add` | | Imports a library that has been packaged as a **nest library**, running its install schematic. |
108+
| `info` | `i` | Displays information about installed nest packages and other helpful system info. |

content/cli/workspaces.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ These properties specify the compiler to use as well as various options that aff
191191
| `deleteOutDir` | boolean | If `true`, whenever the compiler is invoked, it will first remove the compilation output directory (as configured in `tsconfig.json`, where the default is `./dist`). |
192192
| `assets` | array | Enables automatically distributing non-TypeScript assets whenever a compilation step begins (asset distribution does **not** happen on incremental compiles in `--watch` mode). See below for details. |
193193
| `watchAssets` | boolean | If `true`, run in watch-mode, watching **all** non-TypeScript assets. (For more fine-grained control of the assets to watch, see [Assets](cli/monorepo#assets) section below). |
194+
| `manualRestart` | boolean | If `true`, enables the shortcut `rs` to manually restart the server. Default value is `false`. |
194195

195196
#### Global generate options
196197

content/controllers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class CatsController {
3737
}
3838
```
3939

40-
> info **Hint** To create a controller using the CLI, simply execute the `$ nest g controller cats` command.
40+
> info **Hint** To create a controller using the CLI, simply execute the `$ nest g controller [name]` command.
4141
4242
The `@Get()` HTTP request method decorator before the `findAll()` method tells Nest to create a handler for a specific endpoint for HTTP requests. The endpoint corresponds to the HTTP request method (GET in this case) and the route path. What is the route path? The route path for a handler is determined by concatenating the (optional) prefix declared for the controller, and any path specified in the method's decorator. Since we've declared a prefix for every route ( `cats`), and haven't added any path information in the decorator, Nest will map `GET /cats` requests to this handler. As mentioned, the path includes both the optional controller path prefix **and** any path string declared in the request method decorator. For example, a path prefix of `cats` combined with the decorator `@Get('breed')` would produce a route mapping for requests like `GET /cats/breed`.
4343

content/graphql/quick-start.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
6969
imports: [
7070
GraphQLModule.forRoot<ApolloDriverConfig>({
7171
driver: ApolloDriver,
72-
debug: false,
7372
playground: false,
7473
}),
7574
],

content/recipes/automock.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ describe('CatsService unit spec', () => {
7171
beforeAll(() => {
7272
const { unit, unitRef } = TestBed.create(CatsService)
7373
.mock(HttpService)
74-
.use({ get: jest.fn() })
74+
.using({ get: jest.fn() })
7575
.mock(Logger)
76-
.use({ log: jest.fn() })
76+
.using({ log: jest.fn() })
7777
.mock(CatsDal)
78-
.use({ saveCats: jest.fn() })
78+
.using({ saveCats: jest.fn() })
7979
.compile();
8080

8181
underTest = unit;

content/recipes/swc.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ export default defineConfig({
121121
globals: true,
122122
root: './',
123123
},
124-
plugins: [swc.vite()], // This is required to build the test files with SWC
124+
plugins: [
125+
// This is required to build the test files with SWC
126+
swc.vite({
127+
// Explicitly set the module type to avoid inheriting this value from a `.swcrc` config file
128+
module: { type: 'es6' },
129+
}),
130+
],
125131
});
126132
```
127133

content/techniques/cookies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ npm i -D @types/cookie-parser
1414
Once the installation is complete, apply the `cookie-parser` middleware as global middleware (for example, in your `main.ts` file).
1515

1616
```typescript
17-
import * as cookieParser from 'cookie-parser';
17+
import cookieParser from 'cookie-parser';
1818
// somewhere in your initialization file
1919
app.use(cookieParser());
2020
```

content/techniques/queues.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ With this in place, you can now point to this configuration in the `registerQueu
9999

100100
```typescript
101101
BullModule.registerQueue({
102-
configKey: 'alternative-queue',
103-
name: 'video',
102+
configKey: 'alternative-config',
103+
name: 'video'
104104
});
105105
```
106106

content/techniques/sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For convenience, Nest provides tight integration with TypeORM and Sequelize out-
88

99
### TypeORM Integration
1010

11-
For integrating with SQL and NoSQL databases, Nest provides the `@nestjs/typeorm` package. Nest uses [TypeORM](https://github.com/typeorm/typeorm) because it's the most mature Object Relational Mapper (ORM) available for TypeScript. Since it's written in TypeScript, it integrates well with the Nest framework.
11+
For integrating with SQL and NoSQL databases, Nest provides the `@nestjs/typeorm` package. [TypeORM](https://github.com/typeorm/typeorm) it's the most mature Object Relational Mapper (ORM) available for TypeScript. Since it's written in TypeScript, it integrates well with the Nest framework.
1212

1313
To begin using it, we first install the required dependencies. In this chapter, we'll demonstrate using the popular [MySQL](https://www.mysql.com/) Relational DBMS, but TypeORM provides support for many relational databases, such as PostgreSQL, Oracle, Microsoft SQL Server, SQLite, and even NoSQL databases like MongoDB. The procedure we walk through in this chapter will be the same for any database supported by TypeORM. You'll simply need to install the associated client API libraries for your selected database.
1414

@@ -655,7 +655,7 @@ The construction above will instantiate `TypeOrmConfigService` inside `TypeOrmMo
655655

656656
```typescript
657657
@Injectable()
658-
class TypeOrmConfigService implements TypeOrmOptionsFactory {
658+
export class TypeOrmConfigService implements TypeOrmOptionsFactory {
659659
createTypeOrmOptions(): TypeOrmModuleOptions {
660660
return {
661661
type: 'mysql',

0 commit comments

Comments
 (0)