Skip to content

Commit

Permalink
feat(angular): add ngrx feature store generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed May 5, 2023
1 parent 575c6a1 commit fde2e6f
Show file tree
Hide file tree
Showing 30 changed files with 2,583 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -4014,6 +4014,14 @@
"isExternal": false,
"disableCollapsible": false
},
{
"id": "ngrx-feature-store",
"path": "/packages/angular/generators/ngrx-feature-store",
"name": "ngrx-feature-store",
"children": [],
"isExternal": false,
"disableCollapsible": false
},
{
"id": "pipe",
"path": "/packages/angular/generators/pipe",
Expand Down
9 changes: 9 additions & 0 deletions docs/generated/manifests/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,15 @@
"path": "/packages/angular/generators/ngrx",
"type": "generator"
},
"/packages/angular/generators/ngrx-feature-store": {
"description": "Adds an NgRx Feature Store to an application or library.",
"file": "generated/packages/angular/generators/ngrx-feature-store.json",
"hidden": false,
"name": "ngrx-feature-store",
"originalFilePath": "/packages/angular/src/generators/ngrx-feature-store/schema.json",
"path": "/packages/angular/generators/ngrx-feature-store",
"type": "generator"
},
"/packages/angular/generators/pipe": {
"description": "Generate an Angular Pipe",
"file": "generated/packages/angular/generators/pipe.json",
Expand Down
9 changes: 9 additions & 0 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@
"path": "angular/generators/ngrx",
"type": "generator"
},
{
"description": "Adds an NgRx Feature Store to an application or library.",
"file": "generated/packages/angular/generators/ngrx-feature-store.json",
"hidden": false,
"name": "ngrx-feature-store",
"originalFilePath": "/packages/angular/src/generators/ngrx-feature-store/schema.json",
"path": "angular/generators/ngrx-feature-store",
"type": "generator"
},
{
"description": "Generate an Angular Pipe",
"file": "generated/packages/angular/generators/pipe.json",
Expand Down
80 changes: 80 additions & 0 deletions docs/generated/packages/angular/generators/ngrx-feature-store.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "ngrx-feature-store",
"factory": "./src/generators/ngrx-feature-store/ngrx-feature-store",
"schema": {
"$schema": "http://json-schema.org/schema",
"$id": "NxNgrxFeatureStoreGenerator",
"title": "NgRx Feature Store Generator",
"description": "Add an NgRx Feature Store to an application or library.",
"cli": "nx",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the NgRx feature state, such as `products` or `users`. Recommended to use the plural form of the name.",
"$default": { "$source": "argv", "index": 0 },
"x-prompt": "What name would you like to use for the NgRx feature state? An example would be `users`.",
"x-priority": "important"
},
"parent": {
"type": "string",
"description": "The path to the file where the state will be registered. For NgModule usage, this will be your Feature Module. For Standalone API usage, this will be your Routes definition file for your feature state. The host directory will create/use the new state directory. _Note: The Standalone API usage is only supported in Angular versions >= 14.1.0_.",
"x-prompt": "What is the path to the module or Routes definition where this NgRx state should be registered?",
"x-priority": "important"
},
"route": {
"type": "string",
"description": "The route that the Standalone NgRx Providers should be added to. _Note: This is only supported in Angular versions >= 14.1.0_.",
"default": "''"
},
"minimal": {
"type": "boolean",
"default": false,
"description": "Only register the feature state.",
"x-priority": "important"
},
"directory": {
"type": "string",
"default": "+state",
"description": "The name of the folder used to contain/group the generated NgRx files."
},
"facade": {
"type": "boolean",
"default": false,
"description": "Create a Facade class for the the feature.",
"x-prompt": "Would you like to use a Facade with your NgRx state?"
},
"skipImport": {
"type": "boolean",
"default": false,
"description": "Generate NgRx feature files without registering the feature in the NgModule."
},
"skipFormat": {
"description": "Skip formatting files.",
"type": "boolean",
"default": false,
"x-priority": "internal"
},
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not update the `package.json` with NgRx dependencies.",
"x-priority": "internal"
},
"barrels": {
"type": "boolean",
"default": false,
"description": "Use barrels to re-export actions, state and selectors."
}
},
"additionalProperties": false,
"required": ["name"],
"presets": []
},
"description": "Adds an NgRx Feature Store to an application or library.",
"implementation": "/packages/angular/src/generators/ngrx-feature-store/ngrx-feature-store.ts",
"aliases": [],
"hidden": false,
"path": "/packages/angular/src/generators/ngrx-feature-store/schema.json",
"type": "generator"
}
5 changes: 5 additions & 0 deletions packages/angular/generators.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@
"schema": "./src/generators/ngrx/schema.json",
"description": "Adds NgRx support to an application or library."
},
"ngrx-feature-store": {
"factory": "./src/generators/ngrx-feature-store/ngrx-feature-store",
"schema": "./src/generators/ngrx-feature-store/schema.json",
"description": "Adds an NgRx Feature Store to an application or library."
},
"pipe": {
"factory": "./src/generators/pipe/pipe",
"schema": "./src/generators/pipe/schema.json",
Expand Down
1 change: 1 addition & 0 deletions packages/angular/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export * from './src/generators/library-secondary-entry-point/library-secondary-
export * from './src/generators/library/library';
export * from './src/generators/move/move';
export * from './src/generators/ngrx/ngrx';
export * from './src/generators/ngrx-feature-store/ngrx-feature-store';
export * from './src/generators/pipe/pipe';
export * from './src/generators/remote/remote';
export * from './src/generators/scam-directive/scam-directive';
Expand Down
Loading

0 comments on commit fde2e6f

Please sign in to comment.