Skip to content

Commit 84623da

Browse files
Merge branch 'master' into mercurius-plugins
2 parents 81827e4 + 4d3f066 commit 84623da

File tree

300 files changed

+5862
-1953
lines changed

Some content is hidden

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

300 files changed

+5862
-1953
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ dist/*
77
!/dist/v6
88
!/dist/v7
99
!/dist/v8
10+
!/dist/v9
1011

1112
/tmp
1213
/out-tsc

.nvmrc

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

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
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>
138
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
149
<a href="https://www.npmjs.com/~nestjscore"><img src="https://img.shields.io/npm/dm/@nestjs/core.svg" alt="NPM Downloads" /></a>
15-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://api.travis-ci.org/nestjs/nest.svg?branch=master" alt="Travis" /></a>
16-
<a href="https://travis-ci.org/nestjs/nest"><img src="https://img.shields.io/travis/nestjs/nest/master.svg?label=linux" alt="Linux" /></a>
1710
<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>
1811
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
1912
<a href="https://dev.to/nestjs"><img src="https://img.shields.io/badge/blog-dev.to-green"/></a>

content/cli/overview.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ The [Nest CLI](https://github.com/nestjs/nest-cli) is a command-line interface t
44

55
#### Installation
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/npx) program (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/npx) and/or your DevOps support staff for more information.
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.
88

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

1111
```bash
1212
$ npm install -g @nestjs/cli
1313
```
1414

15+
> info **Hint** Alternatively, you can use this command `npx @nestjs/cli@latest` without installing the cli globally.
16+
1517
#### Basic workflow
1618

1719
Once installed, you can invoke CLI commands directly from your OS command line through the `nest` executable. See the available `nest` commands by entering the following:
@@ -36,6 +38,8 @@ $ npm run start:dev
3638

3739
In your browser, open [http://localhost:3000](http://localhost:3000) to see the new application running. The app will automatically recompile and reload when you change any of the source files.
3840

41+
> info **Hint** We recommend using the [SWC builder](/recipes/swc) for faster builds (10x more performant than the default TypeScript compiler).
42+
3943
#### Project structure
4044

4145
When you run `nest new`, Nest generates a boilerplate application structure by creating a new folder and populating an initial set of files. You can continue working in this default structure, adding new components, as described throughout this documentation. We refer to the project structure generated by `nest new` as **standard mode**. Nest also supports an alternate structure for managing multiple projects and libraries called **monorepo mode**.
@@ -86,11 +90,21 @@ Run `nest <command> --help` for any of the following commands to see command-spe
8690

8791
See [usage](/cli/usages) for detailed descriptions for each command.
8892

89-
| Command | Alias | Description |
90-
| ---------- | ----- | ----------------------------------------------------------------------------------------------------- |
91-
| `new` | `n` | Scaffolds a new _standard mode_ application with all boilerplate files needed to run. |
92-
| `generate` | `g` | Generates and/or modifies files based on a schematic. |
93-
| `build` | | Compiles an application or workspace into an output folder. |
94-
| `start` | | Compiles and runs an application (or default project in a workspace). |
95-
| `add` | | Imports a library that has been packaged as a **nest library**, running its install schematic. |
96-
| `info` | `i` | Displays information about installed nest packages and other helpful system info. |
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+
102+
#### Requirements
103+
104+
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.
105+
106+
```bash
107+
node -p process.versions.icu
108+
```
109+
110+
If the command prints `undefined`, your Node.js binary has no internationalization support.

content/cli/scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The `nest` command is an OS level binary (i.e., runs from the OS command line).
1616

1717
#### Build
1818

19-
`nest build` is a wrapper on top of the standard `tsc` compiler (for [standard projects](https://docs.nestjs.com/cli/overview#project-structure)) or the webpack compiler (for [monorepos](https://docs.nestjs.com/cli/overview#project-structure)). It does not add any other compilation features or steps except for handling `tsconfig-paths` out of the box. The reason it exists is that most developers, especially when starting out with Nest, do not need to adjust compiler options (e.g., `tsconfig.json` file) which can sometimes be tricky.
19+
`nest build` is a wrapper on top of the standard `tsc` compiler or `swc` compiler (for [standard projects](https://docs.nestjs.com/cli/overview#project-structure)) or the webpack bundler using the `ts-loader` (for [monorepos](https://docs.nestjs.com/cli/overview#project-structure)). It does not add any other compilation features or steps except for handling `tsconfig-paths` out of the box. The reason it exists is that most developers, especially when starting out with Nest, do not need to adjust compiler options (e.g., `tsconfig.json` file) which can sometimes be tricky.
2020

2121
See the [nest build](https://docs.nestjs.com/cli/usages#nest-build) documentation for more details.
2222

content/cli/usages.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Creates and initializes a new Nest project. Prompts for package manager.
2626

2727
##### Options
2828

29-
| Option | Description |
30-
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
31-
| `--dry-run` | Reports changes that would be made, but does not change the filesystem.<br/> Alias: `-d` |
32-
| `--skip-git` | Skip git repository initialization.<br/> Alias: `-g` |
33-
| `--skip-install` | Skip package installation.<br/> Alias: `-s` |
34-
| `--package-manager [package-manager]` | Specify package manager. Use `npm`, `yarn`, or `pnpm`. Package manager must be installed globally.<br/> Alias: `-p` |
35-
| `--language [language]` | Specify programming language (`TS` or `JS`).<br/> Alias: `-l` |
36-
| `--collection [collectionName]` | Specify schematics collection. Use package name of installed npm package containing schematic.<br/> Alias: `-c` |
29+
| Option | Description |
30+
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
31+
| `--dry-run` | Reports changes that would be made, but does not change the filesystem.<br/> Alias: `-d` |
32+
| `--skip-git` | Skip git repository initialization.<br/> Alias: `-g` |
33+
| `--skip-install` | Skip package installation.<br/> Alias: `-s` |
34+
| `--package-manager [package-manager]` | Specify package manager. Use `npm`, `yarn`, or `pnpm`. Package manager must be installed globally.<br/> Alias: `-p` |
35+
| `--language [language]` | Specify programming language (`TS` or `JS`).<br/> Alias: `-l` |
36+
| `--collection [collectionName]` | Specify schematics collection. Use package name of installed npm package containing schematic.<br/> Alias: `-c` |
3737
| `--strict` | Start the project with the following TypeScript compiler flags enabled: `strictNullChecks`, `noImplicitAny`, `strictBindCallApply`, `forceConsistentCasingInFileNames`, `noFallthroughCasesInSwitch` |
3838

3939
#### nest generate
@@ -107,14 +107,15 @@ $ nest build <name> [options]
107107

108108
##### Options
109109

110-
| Option | Description |
111-
| ----------------- | ------------------------------------------------------ |
112-
| `--path [path]` | Path to `tsconfig` file. <br/>Alias `-p` |
113-
| `--config [path]` | Path to `nest-cli` configuration file. <br/>Alias `-c` |
114-
| `--watch` | Run in watch mode (live-reload) <br/>Alias `-w` |
115-
| `--webpack` | Use webpack for compilation. |
116-
| `--webpackPath` | Path to webpack configuration. |
117-
| `--tsc` | Force use `tsc` for compilation. |
110+
| Option | Description |
111+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
112+
| `--path [path]` | Path to `tsconfig` file. <br/>Alias `-p` |
113+
| `--config [path]` | Path to `nest-cli` configuration file. <br/>Alias `-c` |
114+
| `--watch` | Run in watch mode (live-reload).<br /> If you're using `tsc` for compilation, you can type `rs` to restart the application (when `manualRestart` option is set to `true`). <br/>Alias `-w` |
115+
| `--builder [name]` | Specify the builder to use for compilation (`tsc`, `swc`, or `webpack`). <br/>Alias `-b` |
116+
| `--webpack` | Use webpack for compilation (deprecated: use `--builder webpack` instead). |
117+
| `--webpackPath` | Path to webpack configuration. |
118+
| `--tsc` | Force use `tsc` for compilation. |
118119

119120
#### nest start
120121

@@ -137,10 +138,11 @@ $ nest start <name> [options]
137138
| `--path [path]` | Path to `tsconfig` file. <br/>Alias `-p` |
138139
| `--config [path]` | Path to `nest-cli` configuration file. <br/>Alias `-c` |
139140
| `--watch` | Run in watch mode (live-reload) <br/>Alias `-w` |
141+
| `--builder [name]` | Specify the builder to use for compilation (`tsc`, `swc`, or `webpack`). <br/>Alias `-b` |
140142
| `--preserveWatchOutput` | Keep outdated console output in watch mode instead of clearing the screen. (`tsc` watch mode only) |
141143
| `--watchAssets` | Run in watch mode (live-reload), watching non-TS files (assets). See [Assets](cli/monorepo#assets) for more details. |
142144
| `--debug [hostport]` | Run in debug mode (with --inspect flag) <br/>Alias `-d` |
143-
| `--webpack` | Use webpack for compilation. |
145+
| `--webpack` | Use webpack for compilation. (deprecated: use `--builder webpack` instead) |
144146
| `--webpackPath` | Path to webpack configuration. |
145147
| `--tsc` | Force use `tsc` for compilation. |
146148
| `--exec [binary]` | Binary to run (default: `node`). <br/>Alias `-e` |
@@ -177,12 +179,11 @@ $ nest info
177179
178180
[System Information]
179181
OS Version : macOS High Sierra
180-
NodeJS Version : v8.9.0
181-
YARN Version : 1.5.1
182+
NodeJS Version : v16.18.0
182183
[Nest Information]
183-
microservices version : 6.0.0
184-
websockets version : 6.0.0
185-
testing version : 6.0.0
186-
common version : 6.0.0
187-
core version : 6.0.0
184+
microservices version : 10.0.0
185+
websockets version : 10.0.0
186+
testing version : 10.0.0
187+
common version : 10.0.0
188+
core version : 10.0.0
188189
```

0 commit comments

Comments
 (0)