== @ensono-stacks/rest-client:bump-version

.Creates new version(s) for an existing client endpoint
[%collapsible]
=====
[.details]
====
This plugin reads any existing endpoints and creates a new directory for the specified new version with the files contained within the previous version.
====

[discrete]
=== Prerequisites

This generator requires a _client-endpoint_ project to be available.

[discrete]
=== Usage

----
nx g @ensono-stacks/rest-client:bump-version
----

[discrete]
=== Command line arguments

The following command line arguments are available:


[cols="1,3,1,2,1,1"]
|===
|Option |Description |Type |Accepted Values |Default |Required

|--name
|The endpoint name you want to bump
|string
|
|
| true

|-directory
|Subdirectory inside libs/ where the generated endpoint is placed
|string
|
|
|

|--endpointVersion
|The version you want to bump your endpoint. Omitting this value will bump latest version + 1.
|number
|
|
|
|===

[discrete]
=== Generator Output

The generator will take a copy of your **latest** endpoint and bump it to the next version (unless overridden through the --endpointVersion argument)

[source, text]
----
├── client-endpoint
│   ├── v1
│   │   ├── README.md
│   │   │   ├──  src
│   │   │   │   ├── index.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   ├── index.types.ts
│   │   │   ├── tsconfig.json
│   │   │   ├── tsconfig.lib.json
│   │   │   ├── project.json
│   │   │   ├── .eslintrc.json
│   │   │   ├── jest.config.ts
└───└───└───└── tsconfig.spec.json
----

Once the `bump-version` generator has been used, your library structure will look similar to the following:

[source, text]
----
├── client-endpoint
│   ├── v1
│   │   ├── [...]
│   ├── v2
│   │   ├── README.md
│   │   │   ├──  src
│   │   │   │   ├── index.ts
│   │   │   │   ├── index.test.ts
│   │   │   │   ├── index.types.ts
│   │   │   ├── tsconfig.json
│   │   │   ├── tsconfig.lib.json
│   │   │   ├── project.json
│   │   │   ├── .eslintrc.json
│   │   │   ├── jest.config.ts
└───└───└───└── tsconfig.spec.json
----

In order to import the bumped client-endpoint into your application a new entry for the client is added to the tsconfig.base.json "paths"

[source, json]
----
{
  "paths": {
    "@<workspace-name>/client-endpoint/v2": [
      "libs/client-endpoint/v2/src/index.ts"
    ]
  }
}
----
=====
