Skip to content
This repository was archived by the owner on Nov 27, 2019. It is now read-only.

Commit

Permalink
docs(schematics): Grammatical and inconsistency fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeHowellDev authored and brandonroberts committed Apr 26, 2018
1 parent 739e80a commit 1046043
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 64 deletions.
34 changes: 17 additions & 17 deletions docs/schematics/entity.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Entity
--------

---

## Overview

Generates an set of entity files for managing a collection using `@ngrx/entity` including a set of predefined `actions`, a collection `model` and a `reducer` with state selectors.
Generates a set of entity files for managing a collection using `@ngrx/entity` including a set of predefined `actions`, a collection `model` and a `reducer` with state selectors.

## Command

Expand All @@ -21,28 +22,27 @@ ng generate en EntityName [options]

Nest the effects file within a folder based on the entity `name`.

- `--flat`
- Type: `boolean`
- Default: `true`
* `--flat`
* Type: `boolean`
* Default: `true`

Provide the path to a file containing an `Angular Module` and the entity reducer will be added to its `imports` array using `StoreModule.forFeature`.

- `--module`
- Alias: `-m`
- Type: `string`
* `--module`
* Alias: `-m`
* Type: `string`

Provide the path to a `reducers` file containing a state interface and a object map of action reducers. The generated entity interface will be imported added to the first defined interface within the file. The entity reducer will be imported and added to the first defined object with an `ActionReducerMap` type.
Provide the path to a `reducers` file containing a state interface and a object map of action reducers. The generated entity interface will be imported and added to the first defined interface within the file. The entity reducer will be imported and added to the first defined object with an `ActionReducerMap` type.

- `--reducers`
- Alias: `-r`
- Type: `string`
* `--reducers`
* Alias: `-r`
* Type: `string`

Generate spec files associated with the entity files.

- `--spec`
- Type: `boolean`
- Default: `true`

* `--spec`
* Type: `boolean`
* Default: `true`

#### Examples

Expand All @@ -52,7 +52,7 @@ Generate a set of `User` entity files and add it to a defined map of reducers ge
ng generate entity User --reducers reducers/index.ts
```

Generate a set of `User` entity files within a nested folder
Generate a set of `User` entity files within a nested folder.

```sh
ng generate entity User --flat false
Expand Down
14 changes: 7 additions & 7 deletions docs/schematics/ionic.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ But you can integrate Angular CLI and `@ngrx/schematics` with these simple steps
npm install --save-dev @angular/cli@latest
```

* Install `@ngrx/schematics` and its dependencies following the steps in the sections above.
* Install `@ngrx/schematics` and its dependencies following the steps in the [documentation](./README.md#installation).

* Create a `.angular-cli.json` file in your root directory, beside your `ionic.config.json` file. Angular CLI (`ng`) will use it to know where to generate new files. The only contents it needs to have are:

Expand All @@ -25,13 +25,13 @@ npm install --save-dev @angular/cli@latest
}
```

* Make `@ngrx/schematics` the default collection as described above, e.g.:
* Make `@ngrx/schematics` the default collection as described in the [documentation](README.md#default-schematics-collection), e.g.:

```bash
ng set defaults.schematics.collection=@ngrx/schematics
```

that command will modify the file `.angular-cli.json` so that you don't have to type `--collection @ngrx/schematics` with every command.
That command will modify the file `.angular-cli.json` so that you don't have to type `--collection @ngrx/schematics` with every command.

* Make SCSS the default style format (the default for Ionic):

Expand All @@ -45,15 +45,15 @@ ng set defaults.styleExt scss
ng generate store State --root --module app.module.ts
```

**Note**: when you generate components (like containers) they are generated with a `styleUrls` pointing to the `.scss` file. But by default, Ionic doesn't include styles directly in each component, so, you will probably need to remove that line from the components you create with `ng`. You would remove a line similar to this:
**Note**: When you generate components (like containers) they are generated with a `styleUrls` pointing to the `.scss` file, but by default Ionic doesn't include styles directly in each component. So, you will probably need to remove that line from the components you create with `ng`. You will remove a line similar to this:

```TypeScript
styleUrls: ['./login.component.css']
```

---

**Note**: as Ionic currently doesn't support Angular's `environment.ts` files, you will have to remove them from the imports and adjust the changed files manually, but apart from that, you can use the generated files normally. You will probably have to remove from `app.module.ts` the line with:
**Note**: As Ionic currently doesn't support Angular's `environment.ts` files, you will have to remove them from the imports and adjust the changed files manually, but apart from that, you can use the generated files normally. You will probably have to remove from `app.module.ts` the line with:

```TypeScript
import { environment } from '../environments/environment';
Expand All @@ -71,7 +71,7 @@ to:
StoreDevtoolsModule.instrument(),
```

during development, and probably remove that line in production.
during development and probably remove that line in production.

And in the file in `reducers/index.ts` remove the line:

Expand All @@ -91,4 +91,4 @@ to:
export const metaReducers: MetaReducer<State>[] = [];
```

during development, and probably remove that line in production.
during development and probably remove that line in production.
48 changes: 24 additions & 24 deletions docs/schematics/reducer.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Reducer
--------

---

## Overview

Generates a reducer file that contains a state interface,
and initial state object for the reducer, and a reducer function.
an initial state object for the reducer, and a reducer function.

## Command

Expand All @@ -22,35 +23,34 @@ ng generate r ReducerName [options]

Nest the reducer file within a folder based on the reducer `name`.

- `--flat`
- Type: `boolean`
- Default: `true`
* `--flat`
* Type: `boolean`
* Default: `true`

Group the reducer file within an `reducers` folder.
Group the reducer file within a `reducers` folder.

- `--group`
- Alias: `-g`
- Type: `boolean`
- Default: `false`
* `--group`
* Alias: `-g`
* Type: `boolean`
* Default: `false`

Provide the path to a file containing an `Angular Module` and the entity reducer will be added to its `imports` array using `StoreModule.forFeature`.

- `--module`
- Alias: `-m`
- Type: `string`
* `--module`
* Alias: `-m`
* Type: `string`

Provide the path to a `reducers` file containing a state interface and a object map of action reducers. The generated reducer interface will be imported added to the first defined interface within the file. The reducer will be imported and added to the first defined object with an `ActionReducerMap` type.
Provide the path to a `reducers` file containing a state interface and an object map of action reducers. The generated reducer interface will be imported and added to the first defined interface within the file. The reducer will be imported and added to the first defined object with an `ActionReducerMap` type.

- `--reducers`
- Alias: `-r`
- Type: `string`
* `--reducers`
* Alias: `-r`
* Type: `string`

Generate a spec file alongside the reducer file.

- `--spec`
- Type: `boolean`
- Default: `true`

* `--spec`
* Type: `boolean`
* Default: `true`

#### Examples

Expand All @@ -60,7 +60,7 @@ Generate a `User` reducer file add it to a defined map of reducers generated fro
ng generate reducer User --reducers reducers/index.ts
```

Generate `User` a reducer file within a nested folder based on the reducer name.
Generate a `User` reducer file within a nested folder based on the reducer name.

```sh
ng generate reducer User --flat false
Expand All @@ -72,8 +72,8 @@ Generate a `User` reducer and register it within the `Angular Module` in `app.mo
ng generate reducer User --module app.module.ts
```

Generate a `User` reducer file within a nested `reducers` folder
Generate a `User` reducer file within a nested `reducers` folder.

```sh
ng generate reducer User --group
```
```
33 changes: 17 additions & 16 deletions docs/schematics/store.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Store
--------

---

## Overview

Expand All @@ -21,31 +22,31 @@ ng generate st State [options]

Provide the path to a file containing an `Angular Module` and the feature state will be added to its `imports` array using `StoreModule.forFeature` or `StoreModule.forRoot`.

- `--module`
- Alias: `-m`
- Type: `string`
* `--module`
* Alias: `-m`
* Type: `string`

When used with the `--module` option, it registers the state within the `Angular Module` using `StoreModule.forRoot`. The `--root` option should only be used to setup the global `@ngrx/store` providers.
When used with the `--module` option, it registers the state within the `Angular Module` using `StoreModule.forRoot`. The `--root` option should only be used to setup the global `@ngrx/store` providers.

- `--root`
- Type: `boolean`
- Default: `false`
* `--root`
* Type: `boolean`
* Default: `false`

Provide the folder where the state files will be created.

- `--statePath`
- Type: `string`
- Default: `reducers`
* `--statePath`
* Type: `string`
* Default: `reducers`

Provide the name of the interface exported for your state. When defining with the `--root` option, the name of the store will be used to define the interface name.

- `--stateInterface`
- Type: `string`
- Default: `State`
* `--stateInterface`
* Type: `string`
* Default: `State`

#### Examples

Generate the initial state management files and register it within the `app.module.ts`
Generate the initial state management files and register it within the `app.module.ts`.

```sh
ng generate store State --root --module app.module.ts
Expand All @@ -58,7 +59,7 @@ ng generate module admin --flat false
ng generate store Admin -m admin/admin.module.ts
```

Generate the initial state management files within a `store` folder and register it within the `app.module.ts`
Generate the initial state management files within a `store` folder and register it within the `app.module.ts`.

```sh
ng generate store State --root --statePath store --module app.module.ts
Expand Down

0 comments on commit 1046043

Please sign in to comment.