Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): add ngrx feature store generator #16806

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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