@team-supercharge/oasg 8.0.0 → 8.0.1
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/CHANGELOG.md +13 -0
- package/CONTRIBUTING.md +14 -0
- package/Dockerfile +5 -0
- package/README.md +17 -3
- package/package.json +3 -3
- package/bin/bundler.js +0 -34
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [8.0.1](https://gitlab.com/team-supercharge/oasg/compare/v8.0.0...v8.0.1) (2023-02-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* install dependencies used as CLI scripts in Docker ([5d041e0](https://gitlab.com/team-supercharge/oasg/commit/5d041e0c7d1651bd21fcb33287c237b6a18bb6f1))
|
|
11
|
+
* use fixed version for prism and redocly ([3986814](https://gitlab.com/team-supercharge/oasg/commit/39868141b55234e922ce8df5dd58d88a0b54baf3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Documentation
|
|
15
|
+
|
|
16
|
+
* improve extending the default oasg ruleset, add to migration notes ([9a70342](https://gitlab.com/team-supercharge/oasg/commit/9a703421a6eb7e75ddb8e83753fd9a6bc3b9edc7))
|
|
17
|
+
|
|
5
18
|
## [8.0.0](https://gitlab.com/team-supercharge/oasg/compare/v7.1.0...v8.0.0) (2023-02-22)
|
|
6
19
|
|
|
7
20
|
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
When contributing to this repository, please first discuss the change you wish to make via issue,
|
|
4
|
+
email, or any other method with the owners of this repository before making a change.
|
|
5
|
+
|
|
6
|
+
## CLI Dependencies
|
|
7
|
+
|
|
8
|
+
The following dependencies are used as CLI scripts both on CI machines and running locally:
|
|
9
|
+
|
|
10
|
+
* `@stoplight/spectral`
|
|
11
|
+
* `@stoplight/prism-cli`
|
|
12
|
+
* `@redocly/cli`
|
|
13
|
+
|
|
14
|
+
On updating these packages in `package.json`, please make sure to update the respective versions in `Dockerfile` as well.
|
package/Dockerfile
CHANGED
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ For detailed configuration instructions please refer to the [Configuration](#con
|
|
|
99
99
|
Create a `.spectral.yaml` file in the repo's root directory with the following minimal content:
|
|
100
100
|
|
|
101
101
|
```yaml
|
|
102
|
-
extends:
|
|
102
|
+
extends: '@team-supercharge/oasg/rules/default.yaml'
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
The file is used for configuring [Spectral](https://stoplight.io/open-source/spectral/) on a per-project basis and will enable usage of custom _OASg_ rulesets.
|
|
@@ -166,7 +166,7 @@ _OASg_ makes use of the awesome [Spectral](https://stoplight.io/open-source/spec
|
|
|
166
166
|
The `.spectral.yaml` file in the API repository should be always configured to extend the default _OASg Ruleset_ using:
|
|
167
167
|
|
|
168
168
|
```yaml
|
|
169
|
-
extends:
|
|
169
|
+
extends: '@team-supercharge/oasg/rules/default.yaml'
|
|
170
170
|
```
|
|
171
171
|
|
|
172
172
|
Rules defined in the ruleset can be split into two categories:
|
|
@@ -179,7 +179,7 @@ You can further customize the ruleset in `.spectral.yaml` according to the [docu
|
|
|
179
179
|
An example configuration can be found here:
|
|
180
180
|
|
|
181
181
|
```yaml
|
|
182
|
-
extends:
|
|
182
|
+
extends: '@team-supercharge/oasg/rules/default.yaml'
|
|
183
183
|
|
|
184
184
|
rules:
|
|
185
185
|
oasg-object-names-pascal-case: off # disables a default rule - don't do this in general :)
|
|
@@ -707,6 +707,20 @@ This section covers the breaking changes and their migrations across major versi
|
|
|
707
707
|
|
|
708
708
|
### From `7.x.x` to `8.0.0`
|
|
709
709
|
|
|
710
|
+
**Linting**
|
|
711
|
+
|
|
712
|
+
If you plan to use the _OASg_ base image with the preinstalled `oasg` binary without installing npm dependencies on CI, make sure you update your `.spectral.yaml` from the previously recommended syntax which picked up the rules directly from the file system:
|
|
713
|
+
|
|
714
|
+
```yaml
|
|
715
|
+
extends: node_modules/@team-supercharge/oasg/rules/default.yaml
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
to use the syntax which picks up rules from the npm package wherever it's installed:
|
|
719
|
+
|
|
720
|
+
```yaml
|
|
721
|
+
extends: '@team-supercharge/oasg/rules/default.yaml'
|
|
722
|
+
```
|
|
723
|
+
|
|
710
724
|
**Generators: `spring-kotlin`, `spring` and `feign`**
|
|
711
725
|
|
|
712
726
|
Spring Boot 3 version is the default for these generators. To generate Spring Boot 2 libraries, add `-puseSpringBoot3=false` to `generatorCustomArgs` in the projects `config.json`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@team-supercharge/oasg",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
|
|
5
5
|
"author": "Supercharge",
|
|
6
6
|
"license": "MIT",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
|
17
17
|
"@apidevtools/swagger-parser": "^10.0.2",
|
|
18
|
-
"@redocly/cli": "
|
|
19
|
-
"@stoplight/prism-cli": "
|
|
18
|
+
"@redocly/cli": "1.0.0-beta.123",
|
|
19
|
+
"@stoplight/prism-cli": "4.1.0",
|
|
20
20
|
"@stoplight/spectral": "5.9.0",
|
|
21
21
|
"ajv": "^8.11.0",
|
|
22
22
|
"command-exists": "^1.2.9",
|
package/bin/bundler.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const crypto = require('crypto');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
|
|
4
|
-
const { exec } = require(`${__dirname}/exec.js`);
|
|
5
|
-
|
|
6
|
-
async function bundleSpecification(source, file) {
|
|
7
|
-
// do NOT bundle by default for any sources
|
|
8
|
-
if (source.bundle === undefined || source.bundle === false) {
|
|
9
|
-
return file;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let outFile;
|
|
13
|
-
|
|
14
|
-
if (!file.startsWith("./out/.tmp")) {
|
|
15
|
-
if (!fs.existsSync('./out')) {
|
|
16
|
-
fs.mkdirSync('./out');
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (!fs.existsSync('./out/.tmp')) {
|
|
20
|
-
fs.mkdirSync('./out/.tmp');
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
outFile = `./out/.tmp/${source.id}-${crypto.randomBytes(4).readUInt32LE(0)}`;
|
|
24
|
-
} else {
|
|
25
|
-
outFile = file;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// using @redocly/cli to bundle
|
|
29
|
-
exec(`npx redocly bundle ${file} --keep-url-references --output ${outFile}`);
|
|
30
|
-
|
|
31
|
-
return outFile;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.bundleSpecification = bundleSpecification;
|