0.0.35 • Published 1 month ago

@seriouslag/nx-openapi-ts-plugin v0.0.35

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@seriouslag/nx-openapi-ts-plugin

This plugin provides a generator and executor for generating and updating OpenAPI clients using the @hey-api/openapi-ts library. This can be tied in to automation and CI workflows to ensure your API clients are always up to date.

Installation

npm install -D @seriouslag/plugin-nx

Usage

Generators

openapi-client

Docs

This plugin provides a generator for generating OpenAPI clients using the @hey-api/openapi-ts library.

Run in interactive mode nx g @seriouslag/nx-openapi-ts-plugin:openapi-client

Options
  • name: The name of the project. string
  • scope: The scope of the project. string
  • spec: The path to the OpenAPI spec file. URI or string
  • directory: The directory to create the project in. string (default: libs)
  • client: The type of client to generate. string (default: @hey-api/client-fetch) To specify a specific version of the client you can use @hey-api/client-fetch@1.x.x.
  • tags: The tags to add to the project. string[] (default: api,openapi) The defaults tags will not be added to the project if you specify this option.
  • plugins: Additional plugins to provide to the client api. string[]
  • test: The type of tests to setup. 'none' | 'vitest' (default: none)
Example
nx g @seriouslag/nx-openapi-ts-plugin:openapi-client --name=my-api --client=@hey-api/client-fetch --scope=@my-app --directory=libs --spec=./spec.yaml --tags=api,openapi

Executors

update-api

This executor updates the OpenAPI spec file and generates a new client. The options for the executor will be populated from the generator.

Run nx run @my-org/my-generated-package:updateApi

Options
  • spec: The path to the OpenAPI spec file. URI or string
  • name: The name of the project. string
  • scope: The scope of the project. string
  • client: The type of client to generate. string (default: @hey-api/client-fetch)
  • directory: The directory to create the project in. string (default: libs)
  • plugins: Additional plugins to provide to the client api. string[] (default:[])
Spec File Notes

If the spec file is a relative path and is located in the workspace then the containing project will be listed as an implicit dependency. The assumption is made that that project will generate the API spec file on build.

If the spec file is a URL then we fetch the spec during cache checks to determine if we should rebuild the client code.

0.0.35

1 month ago

0.0.34

1 month ago

0.0.33

1 month ago

0.0.32

2 months ago

0.0.31

2 months ago

0.0.30

2 months ago

0.0.29

2 months ago

0.0.28

2 months ago

0.0.26

2 months ago

0.0.25

2 months ago

0.0.24

2 months ago

0.0.23

2 months ago

0.0.21

2 months ago

0.0.20

2 months ago

0.0.19

2 months ago

0.0.18

2 months ago

0.0.17

2 months ago

0.0.16

2 months ago

0.0.15

2 months ago

0.0.14

2 months ago

0.0.13

2 months ago

0.0.12

2 months ago

0.0.11

2 months ago

0.0.10

2 months ago

0.0.9

2 months ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.5

2 months ago

0.0.3

2 months ago

0.0.1

2 months ago