Skip to main content

bump-version

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

Details

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

Prerequisites

This generator requires a client-endpoint project to be available.

Usage

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

Command line arguments

The following command line arguments are available:

OptionDescriptionTypeAccepted ValuesDefaultRequired
--nameThe endpoint name you want to bumpstringtrue
--directorySubdirectory inside libs/ where the generated endpoint is placedstring
--endpointVersionThe version you want to bump your endpoint. Omitting this value will bump latest version + 1.number

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)

V1 endpoint

├── 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:

Bumped endpoint structure

├── 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"

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