@codious/ngrx-generator

1.7.25 • Public • Published

Codious.NgRx-Generator

Build Status Quality Gate Status

Generates a NgRx store (for Angular) based on a OpenAPI 3.x configuration (i.e. Swagger).

Installation

npm install @codious/ngrx-generator

Usage

npx ngrx-gen -i <input path|url> -o <output path> -s <server name> -t <tag1, tag2>

Options:

  • [Required] --input, -i: a path to an OpenAPI specification file. This can also be an URL.
  • [Required] --output, -o: a path to a folder where the store will be generated.
  • [Optional] --conversions, -c: conversions from one model to another. (e.a. -c MyObject:any OtherObject:object)
  • [Optional] --format, -f: ESLint config for formatting the generated files. Add --format false to skip formatting.
  • [Optional] --server, -s: the server defined in the description of the servers section in the OpenAPI file. This value is used as the API base URL in the generated service. If the option is empty or the server couldn't be found in the servers section, the base URL will be ${environment.apiBaseUrl}. Then, in your tsconfig.json add a path "@environments": ["environments/environment"], and add the property apiBaseUrl to the files in your Angular environments folder.
  • [Optional] --tags, -t: only paths with these tags will be generated.

Package Sidebar

Install

npm i @codious/ngrx-generator

Weekly Downloads

58

Version

1.7.25

License

MIT

Unpacked Size

70 kB

Total Files

32

Last publish

Collaborators

  • gillesv
  • bartlenaerts
  • yluijten
  • pieterwillemsen