Skip to content

Commit 219416a

Browse files
Merge pull request #2256 from johannesschobel/fix/typos
Fix Typos and Format Code Blocks
2 parents f51b5c4 + 5ab2fb3 commit 219416a

32 files changed

+114
-105
lines changed

content/application-context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ async function bootstrap() {
6666
bootstrap();
6767
```
6868

69-
#### Example
69+
#### Example
7070

7171
A working example is available [here](https://github.com/nestjs/nest/tree/master/sample/18-context).

content/cli/usages.md

Lines changed: 31 additions & 31 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

3838
#### nest generate
3939

@@ -53,25 +53,25 @@ $ nest g <schematic> <name> [options]
5353

5454
##### Schematics
5555

56-
| Name | Alias | Description |
57-
| ------------- | ----- | --------------------------------------------------------------------------------------------------- |
58-
| `app` | | Generate a new application within a monorepo (converting to monorepo if it's a standard structure). |
59-
| `library` | `lib` | Generate a new library within a monorepo (converting to monorepo if it's a standard structure). |
60-
| `class` | `cl` | Generate a new class. |
61-
| `controller` | `co` | Generate a controller declaration. |
62-
| `decorator` | `d` | Generate a custom decorator. |
63-
| `filter` | `f` | Generate a filter declaration. |
64-
| `gateway` | `ga` | Generate a gateway declaration. |
65-
| `guard` | `gu` | Generate a guard declaration. |
66-
| `interface` | | Generate an interface. |
67-
| `interceptor` | `in` | Generate an interceptor declaration. |
68-
| `middleware` | `mi` | Generate a middleware declaration. |
69-
| `module` | `mo` | Generate a module declaration. |
70-
| `pipe` | `pi` | Generate a pipe declaration. |
71-
| `provider` | `pr` | Generate a provider declaration. |
72-
| `resolver` | `r` | Generate a resolver declaration.
73-
| `resource` | `res` | Generate a new CRUD resource. See the [CRUD (resource) generator](/recipes/crud-generator) for more details. |
74-
| `service` | `s` | Generate a service declaration. |
56+
| Name | Alias | Description |
57+
| ------------- | ----- | ------------------------------------------------------------------------------------------------------------ |
58+
| `app` | | Generate a new application within a monorepo (converting to monorepo if it's a standard structure). |
59+
| `library` | `lib` | Generate a new library within a monorepo (converting to monorepo if it's a standard structure). |
60+
| `class` | `cl` | Generate a new class. |
61+
| `controller` | `co` | Generate a controller declaration. |
62+
| `decorator` | `d` | Generate a custom decorator. |
63+
| `filter` | `f` | Generate a filter declaration. |
64+
| `gateway` | `ga` | Generate a gateway declaration. |
65+
| `guard` | `gu` | Generate a guard declaration. |
66+
| `interface` | | Generate an interface. |
67+
| `interceptor` | `in` | Generate an interceptor declaration. |
68+
| `middleware` | `mi` | Generate a middleware declaration. |
69+
| `module` | `mo` | Generate a module declaration. |
70+
| `pipe` | `pi` | Generate a pipe declaration. |
71+
| `provider` | `pr` | Generate a provider declaration. |
72+
| `resolver` | `r` | Generate a resolver declaration. |
73+
| `resource` | `res` | Generate a new CRUD resource. See the [CRUD (resource) generator](/recipes/crud-generator) for more details. |
74+
| `service` | `s` | Generate a service declaration. |
7575

7676
##### Options
7777

@@ -158,10 +158,10 @@ Updates `@nestjs` dependencies in the `package.json` `"dependencies"` list to th
158158

159159
##### Options
160160

161-
| Option | Description |
162-
| --------- | ------------------------------------------------------------------------ |
163-
| `--force` | Do **upgrade** instead of update <br/>Alias `-f` |
164-
| `--tag` | Update to tagged version (use `@latest`, `@<tag>`, etc) <br/>Alias `-t` | |
161+
| Option | Description |
162+
| --------- | ----------------------------------------------------------------------- | --- |
163+
| `--force` | Do **upgrade** instead of update <br/>Alias `-f` |
164+
| `--tag` | Update to tagged version (use `@latest`, `@<tag>`, etc) <br/>Alias `-t` | |
165165

166166
#### nest info
167167

content/cli/workspaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ module.exports = {
279279
Since the webpack config file is a JavaScript file, you can even expose a function that takes default options and returns a modified object:
280280

281281
```javascript
282-
module.exports = function(options) {
282+
module.exports = function (options) {
283283
return {
284284
...options,
285285
externals: [],

content/components.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Providers normally have a lifetime ("scope") synchronized with the application l
128128

129129
#### Custom providers
130130

131-
Nest has a built-in inversion of control ("IoC") container that resolves relationships between providers. This feature underlies the dependency injection feature described above, but is in fact far more powerful than what we've described so far. There are several ways to define a provider: you can use plain values, classes, and either asynchronous or synchronous factories. More examples are provided [here](/fundamentals/dependency-injection).
131+
Nest has a built-in inversion of control ("IoC") container that resolves relationships between providers. This feature underlies the dependency injection feature described above, but is in fact far more powerful than what we've described so far. There are several ways to define a provider: you can use plain values, classes, and either asynchronous or synchronous factories. More examples are provided [here](/fundamentals/dependency-injection).
132132

133133
#### Optional providers
134134

@@ -207,8 +207,8 @@ This is how our directory structure should look now:
207207

208208
#### Manual instantiation
209209

210-
Thus far, we've discussed how Nest automatically handles most of the details of resolving dependencies. In certain circumstances, you may need to step outside of the built-in Dependency Injection system and manually retrieve or instantiate providers. We briefly discuss two such topics below.
210+
Thus far, we've discussed how Nest automatically handles most of the details of resolving dependencies. In certain circumstances, you may need to step outside of the built-in Dependency Injection system and manually retrieve or instantiate providers. We briefly discuss two such topics below.
211211

212-
To get existing instances, or instantiate providers dynamically, you can use [Module reference](https://docs.nestjs.com/fundamentals/module-ref).
213-
214-
To get providers within the `bootstrap()` function (for example for standalone applications without controllers, or to utilize a configuration service during bootstrapping) see [Standalone applications](https://docs.nestjs.com/standalone-applications).
212+
To get existing instances, or instantiate providers dynamically, you can use [Module reference](https://docs.nestjs.com/fundamentals/module-ref).
213+
214+
To get providers within the `bootstrap()` function (for example for standalone applications without controllers, or to utilize a configuration service during bootstrapping) see [Standalone applications](https://docs.nestjs.com/standalone-applications).

content/faq/errors.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ Potential solutions:
1717
})
1818
```
1919
20-
2120
The most common culprit of the error, is not having the `provider` in the module's `providers` array. Please make sure that the provider is indeed in the `providers` array and following [standard NestJS provider practices](/fundamentals/custom-providers#di-fundamentals).
2221

2322
There are a few gotchas, that are common. One is putting a provider in an `imports` array. If this is the case, the error will have the provider's name where `<module>` should be.
2423
2524
If you run across this error while developing, take a look at the module mentioned in the error message and look at its `providers`. For each provider in the `providers` array, make sure the module has access to all of the dependencies. Often times, `providers` are duplicated in a "Feature Module" and a "Root Module" which means Nest will try to instantiate the provider twice. More than likely, the module containing the `provider` being duplicated should be added in the "Root Module"'s `imports` array instead.
2625

27-
If the `unknown_token` above is the string `dependency`, you might have a circular file import. This is different from the [circular dependency](./errors.md#circular-dependency-error) below because instead of having providers depend on each other in their constructors, it just means that two files end up importing each other. A common case would be a module file declaring a token and importing a provider, and the provider import the token constant from the module file. If you are using barrel files, ensure that your barrel imports do not end up creating these circular imports as well.
26+
If the `unknown_token` above is the string `dependency`, you might have a circular file import. This is different from the [circular dependency](./errors.md#circular-dependency-error) below because instead of having providers depend on each other in their constructors, it just means that two files end up importing each other. A common case would be a module file declaring a token and importing a provider, and the provider import the token constant from the module file. If you are using barrel files, ensure that your barrel imports do not end up creating these circular imports as well.
2827

2928
#### "Circular dependency" error
3029

@@ -46,7 +45,7 @@ Circular dependencies can arise from both providers depending on each other, or
4645

4746
#### Debugging dependency errors
4847

49-
Along with just manually verifying your dependencies are correct, as of Nest 8.1.0 you can set the `NEST_DEBUG` environment variable to a string that resolves as truthy, and get extra logging information while Nest is resolving all of the dependencies for the application.
48+
Along with just manually verifying your dependencies are correct, as of Nest 8.1.0 you can set the `NEST_DEBUG` environment variable to a string that resolves as truthy, and get extra logging information while Nest is resolving all of the dependencies for the application.
5049

5150
<figure><img src="/assets/injector_logs.png" /></figure>
5251

content/first-steps.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ $ npm run start
102102
This command starts the app with the HTTP server listening on the port defined in the `src/main.ts` file. Once the application is running, open your browser and navigate to `http://localhost:3000/`. You should see the `Hello World!` message.
103103

104104
To watch for changes in your files, you can run the following command to start the application:
105+
105106
```bash
106107
$ npm run start:dev
107108
```

content/fundamentals/circular-dependency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ While circular dependencies should be avoided where possible, you can't always d
66

77
We also describe resolving circular dependencies between modules.
88

9-
> warning **Warning** A circular dependency might also be caused when using "barrel files"/index.ts files to group imports. Barrel files should be omitted when it comes to module/provider classes. For example, barrel files should not be used when importing files within the same directory as the barrel file, i.e. `cats/cats.controller` should not import `cats` to import the `cats/cats.service` file. For more details please also see [this github issue](https://github.com/nestjs/nest/issues/1181#issuecomment-430197191).
9+
> warning **Warning** A circular dependency might also be caused when using "barrel files"/index.ts files to group imports. Barrel files should be omitted when it comes to module/provider classes. For example, barrel files should not be used when importing files within the same directory as the barrel file, i.e. `cats/cats.controller` should not import `cats` to import the `cats/cats.service` file. For more details please also see [this github issue](https://github.com/nestjs/nest/issues/1181#issuecomment-430197191).
1010
1111
#### Forward reference
1212

content/fundamentals/lifecycle-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In the following table, `onModuleDestroy`, `beforeApplicationShutdown` and `onAp
2020
| `onApplicationBootstrap()` | Called once all modules have been initialized, but before listening for connections. |
2121
| `onModuleDestroy()`\* | Called after a termination signal (e.g., `SIGTERM`) has been received. |
2222
| `beforeApplicationShutdown()`\* | Called after all `onModuleDestroy()` handlers have completed (Promises resolved or rejected);<br />once complete (Promises resolved or rejected), all existing connections will be closed (`app.close()` called). |
23-
| `onApplicationShutdown()`\* | Called after connections close (`app.close()` resolves). |
23+
| `onApplicationShutdown()`\* | Called after connections close (`app.close()` resolves). |
2424

2525
\* For these events, if you're not calling `app.close()` explicitly, you must opt-in to make them work with system signals such as `SIGTERM`. See [Application shutdown](fundamentals/lifecycle-events#application-shutdown) below.
2626

content/fundamentals/unit-testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe('CatsController', () => {
191191

192192
controller = moduleRef.get(CatsController);
193193
});
194-
})
194+
});
195195
```
196196

197197
> info **Hint** A general mock factory, like `createMock` from [`@golevelup/ts-jest`](https://github.com/golevelup/nestjs/tree/master/packages/testing) can also be passed directly.
@@ -302,7 +302,7 @@ describe('Cats', () => {
302302
> expect(result.payload).toEqual(/* expectedPayload */);
303303
> });
304304
> });
305-
>
305+
>
306306
> afterAll(async () => {
307307
> await app.close();
308308
> });

content/graphql/interfaces.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Field, ID, InterfaceType } from '@nestjs/graphql';
1111

1212
@InterfaceType()
1313
export abstract class Character {
14-
@Field(type => ID)
14+
@Field((type) => ID)
1515
id: string;
1616

1717
@Field()
@@ -58,7 +58,7 @@ To provide a customized `resolveType()` function, pass the `resolveType` propert
5858
},
5959
})
6060
export abstract class Book {
61-
@Field(type => ID)
61+
@Field((type) => ID)
6262
id: string;
6363

6464
@Field()

0 commit comments

Comments
 (0)