From 1046043abc6ae2b99dde45902b95c673405a143c Mon Sep 17 00:00:00 2001 From: Luke Howell Date: Wed, 25 Apr 2018 13:52:27 -0500 Subject: [PATCH] docs(schematics): Grammatical and inconsistency fixes --- docs/schematics/entity.md | 34 +++++++++++++-------------- docs/schematics/ionic.md | 14 +++++------ docs/schematics/reducer.md | 48 +++++++++++++++++++------------------- docs/schematics/store.md | 33 +++++++++++++------------- 4 files changed, 65 insertions(+), 64 deletions(-) diff --git a/docs/schematics/entity.md b/docs/schematics/entity.md index 6bd13efe60..8dc4fd682d 100644 --- a/docs/schematics/entity.md +++ b/docs/schematics/entity.md @@ -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 @@ -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 @@ -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 diff --git a/docs/schematics/ionic.md b/docs/schematics/ionic.md index 84eb2ef8ba..d3a2c5acf7 100644 --- a/docs/schematics/ionic.md +++ b/docs/schematics/ionic.md @@ -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: @@ -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): @@ -45,7 +45,7 @@ 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'] @@ -53,7 +53,7 @@ ng generate store State --root --module app.module.ts --- -**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'; @@ -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: @@ -91,4 +91,4 @@ to: export const metaReducers: MetaReducer[] = []; ``` -during development, and probably remove that line in production. +during development and probably remove that line in production. diff --git a/docs/schematics/reducer.md b/docs/schematics/reducer.md index 73d9cfa400..ce498cf53a 100644 --- a/docs/schematics/reducer.md +++ b/docs/schematics/reducer.md @@ -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 @@ -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 @@ -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 @@ -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 -``` \ No newline at end of file +``` diff --git a/docs/schematics/store.md b/docs/schematics/store.md index eb34719118..dfb1461eb5 100644 --- a/docs/schematics/store.md +++ b/docs/schematics/store.md @@ -1,5 +1,6 @@ # Store --------- + +--- ## Overview @@ -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 @@ -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