semantic-release-openapi 2.3.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +58 -11
  2. package/package.json +15 -5
package/README.md CHANGED
@@ -1,23 +1,26 @@
1
1
  # semantic-release-openapi
2
2
 
3
- [![npm](https://img.shields.io/npm/v/semantic-release-openapi.svg)][npm]
3
+ [![npm](https://img.shields.io/npm/v/semantic-release-openapi.svg?logo=npm)][npm]
4
4
  [![npm types](https://badgen.net/npm/types/semantic-release-openapi?icon=typescript)][npm]
5
5
  [![license](https://img.shields.io/github/license/aensley/semantic-release-openapi.svg)](https://github.com/aensley/semantic-release-openapi/blob/main/LICENSE)
6
6
  [![prettier](https://img.shields.io/badge/prettier-ff69b4.svg?&logo=prettier&logoColor=fff)](https://prettier.io/)
7
7
  [![standard](https://img.shields.io/badge/standard-f3df49.svg?logo=standardjs&logoColor=000)](https://standardjs.com/)
8
- [![bundle size](https://img.shields.io/bundlephobia/min/semantic-release-openapi.svg?label=size)](https://bundlephobia.com/package/semantic-release-openapi)
9
8
  [![npm downloads](https://img.shields.io/npm/dw/semantic-release-openapi.svg)][npm]
10
- [![Dependabot badge](https://badgen.net/github/dependabot/aensley/semantic-release-openapi?icon=dependabot)](https://github.com/aensley/semantic-release-openapi/security/dependabot)<br>
9
+ [![dependencies](https://img.shields.io/librariesio/release/npm/semantic-release-openapi.svg?label=deps&logo=npm)](https://libraries.io/npm/semantic-release-openapi)<br>
11
10
  [![Maintainability](https://qlty.sh/gh/aensley/projects/semantic-release-openapi/maintainability.svg)][qltysh]
12
11
  [![Test Coverage](https://qlty.sh/gh/aensley/projects/semantic-release-openapi/coverage.svg)][qltysh]
13
12
  [![test](https://github.com/aensley/semantic-release-openapi/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/aensley/semantic-release-openapi/actions/workflows/test.yml)
14
13
  [![OpenSSF Scorecard](https://img.shields.io/ossf-scorecard/github.com/aensley/semantic-release-openapi.svg?label=ossf)](https://scorecard.dev/viewer/?uri=github.com/aensley/semantic-release-openapi)
15
14
  [![Socket](https://socket.dev/api/badge/npm/package/semantic-release-openapi)](https://socket.dev/npm/package/semantic-release-openapi)
16
15
  [![snyk](https://snyk.io/test/npm/semantic-release-openapi/badge.svg)](https://security.snyk.io/package/npm/semantic-release-openapi)
17
- [![dependencies](https://img.shields.io/librariesio/release/npm/semantic-release-openapi.svg?label=deps)](https://libraries.io/npm/semantic-release-openapi)
18
16
 
19
17
  A Semantic Release plugin to update versions in OpenAPI / Swagger specification files.
20
18
 
19
+ | Step | Description |
20
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
+ | `verifyConditions` | Verify existence of the `apiSpecFiles` config option, that it resolves to at least one valid `.json`, `.yml`, or `.yaml` file, and that it does not resolve to any other file types. |
22
+ | `prepare` | Update the `info.version` field in all matching `apiSpecFiles`. |
23
+
21
24
  ## Installation
22
25
 
23
26
  This module is distributed via npm and should be installed as one of your project's `devDependencies`:
@@ -28,19 +31,25 @@ npm install --save-dev semantic-release-openapi
28
31
 
29
32
  ## Usage
30
33
 
31
- ### Plugin Config
34
+ Configure the plugin wherever you have your [semantic-release configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration).
35
+
36
+ ## Configuration
32
37
 
33
- This plugin has one configuration option which must be supplied.
38
+ This plugin has one configuration option which **must be supplied**.
34
39
 
35
- - **`apiSpecFiles`**: An array of OpenAPI / Swagger specification file paths. [Glob patterns](https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching) (e.g. `'*.yaml'`) are supported.
40
+ | Option | Description |
41
+ | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
42
+ | **`apiSpecFiles`** | An array of OpenAPI / Swagger specification file paths.<br>[Glob patterns](https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching) (e.g. `'*.yaml'`) are supported.<br><br>_All matching files must have a `.json`, `.yaml`, or `.yml` extension._ |
36
43
 
37
- _All matching files must have a `.json`, `.yaml`, or `.yml` extension._
44
+ > [!TIP]
45
+ >
46
+ > Semantic Release will not commit changes to your OpenAPI spec files unless you add the same files in `assets` for the **@semantic-release/git** plugin. See the examples below.
38
47
 
39
- ### Committing Changes
48
+ ## Examples
40
49
 
41
- **IMPORTANT**: Semantic Release will not commit changes to your OpenAPI spec files unless you add the same files in `assets` for the **@semantic-release/git** plugin! See the example below.
50
+ The following examples assume you've put your `semantic-release` configuration in your `package.json` file.
42
51
 
43
- ### Example
52
+ ### Basic Example
44
53
 
45
54
  ```json
46
55
  {
@@ -63,5 +72,43 @@ This plugin has one configuration option which must be supplied.
63
72
  }
64
73
  ```
65
74
 
75
+ ### Extended Example
76
+
77
+ ```json
78
+ {
79
+ "release": {
80
+ "branches": ["main"],
81
+ "plugins": [
82
+ "@semantic-release/commit-analyzer",
83
+ "@semantic-release/release-notes-generator",
84
+ [
85
+ "@semantic-release/github",
86
+ {
87
+ "assets": [
88
+ {
89
+ "path": "src/openapi.yml",
90
+ "label": "Open API Spec"
91
+ }
92
+ ]
93
+ }
94
+ ],
95
+ "@semantic-release/npm",
96
+ [
97
+ "semantic-release-openapi",
98
+ {
99
+ "apiSpecFiles": ["src/openapi.yml"]
100
+ }
101
+ ],
102
+ [
103
+ "@semantic-release/git",
104
+ {
105
+ "assets": ["package.json", "src/openapi.yml"]
106
+ }
107
+ ]
108
+ ]
109
+ }
110
+ }
111
+ ```
112
+
66
113
  [npm]: https://www.npmjs.com/package/semantic-release-openapi
67
114
  [qltysh]: https://qlty.sh/gh/aensley/projects/semantic-release-openapi
package/package.json CHANGED
@@ -1,18 +1,28 @@
1
1
  {
2
2
  "name": "semantic-release-openapi",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "A Semantic Release plugin to update versions in OpenAPI / Swagger specification files",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/aensley/semantic-release-openapi.git"
8
8
  },
9
9
  "keywords": [
10
- "semantic-release",
11
- "plugin",
10
+ "api",
11
+ "asyncapi",
12
+ "json",
13
+ "oas",
12
14
  "openapi",
13
- "version",
15
+ "plugin",
16
+ "publish",
17
+ "release",
18
+ "rest",
19
+ "semantic-release",
14
20
  "swagger",
15
- "asyncapi"
21
+ "swagger-api",
22
+ "update",
23
+ "version",
24
+ "yaml",
25
+ "yml"
16
26
  ],
17
27
  "author": {
18
28
  "name": "Andrew Ensley",