semantic-release-openapi 2.3.2 → 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.
- package/README.md +58 -11
- package/package.json +15 -5
package/README.md
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
# semantic-release-openapi
|
|
2
2
|
|
|
3
|
-
[][npm]
|
|
3
|
+
[][npm]
|
|
4
4
|
[][npm]
|
|
5
5
|
[](https://github.com/aensley/semantic-release-openapi/blob/main/LICENSE)
|
|
6
6
|
[](https://prettier.io/)
|
|
7
7
|
[](https://standardjs.com/)
|
|
8
|
-
[](https://bundlephobia.com/package/semantic-release-openapi)
|
|
9
8
|
[][npm]
|
|
10
|
-
[](https://libraries.io/npm/semantic-release-openapi)<br>
|
|
11
10
|
[][qltysh]
|
|
12
11
|
[][qltysh]
|
|
13
12
|
[](https://github.com/aensley/semantic-release-openapi/actions/workflows/test.yml)
|
|
14
13
|
[](https://scorecard.dev/viewer/?uri=github.com/aensley/semantic-release-openapi)
|
|
15
14
|
[](https://socket.dev/npm/package/semantic-release-openapi)
|
|
16
15
|
[](https://security.snyk.io/package/npm/semantic-release-openapi)
|
|
17
|
-
[](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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
+
## Examples
|
|
40
49
|
|
|
41
|
-
|
|
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.
|
|
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
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"api",
|
|
11
|
+
"asyncapi",
|
|
12
|
+
"json",
|
|
13
|
+
"oas",
|
|
12
14
|
"openapi",
|
|
13
|
-
"
|
|
15
|
+
"plugin",
|
|
16
|
+
"publish",
|
|
17
|
+
"release",
|
|
18
|
+
"rest",
|
|
19
|
+
"semantic-release",
|
|
14
20
|
"swagger",
|
|
15
|
-
"
|
|
21
|
+
"swagger-api",
|
|
22
|
+
"update",
|
|
23
|
+
"version",
|
|
24
|
+
"yaml",
|
|
25
|
+
"yml"
|
|
16
26
|
],
|
|
17
27
|
"author": {
|
|
18
28
|
"name": "Andrew Ensley",
|