@backstage/repo-tools 0.18.1-next.0 → 0.19.0
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
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @backstage/repo-tools
|
|
2
2
|
|
|
3
|
+
## 0.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0804116: **BREAKING**: Renamed the `repo schema openapi verify` command to `repo schema openapi validate`. Added a new `package schema openapi validate` command to validate that an OpenAPI spec is a valid OpenAPI 3.x document.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 226817d: chore(deps): bump `js-yaml` from 4.2.0 to 4.3.0
|
|
12
|
+
- 78bf918: chore(deps): bump `tar` from 7.5.15 to 7.5.21
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/catalog-model@1.10.0
|
|
15
|
+
- @backstage/config-loader@1.11.2
|
|
16
|
+
- @backstage/backend-plugin-api@1.10.0
|
|
17
|
+
|
|
18
|
+
## 0.18.1-next.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 78bf918: chore(deps): bump `tar` from 7.5.15 to 7.5.21
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
- @backstage/config-loader@1.11.2-next.0
|
|
25
|
+
- @backstage/backend-plugin-api@1.10.0-next.1
|
|
26
|
+
|
|
3
27
|
## 0.18.1-next.0
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -25,6 +25,9 @@ function registerPackageCommand(program) {
|
|
|
25
25
|
"--watch",
|
|
26
26
|
"Watch the OpenAPI spec for changes and regenerate on save."
|
|
27
27
|
).action(lazy(() => import('./package/schema/openapi/generate/index.cjs.js'), "command"));
|
|
28
|
+
openApiCommand.command("validate").description(
|
|
29
|
+
"Validate that the OpenAPI spec is a valid OpenAPI 3.x document."
|
|
30
|
+
).action(lazy(() => import('./package/schema/openapi/validate.cjs.js'), "command"));
|
|
28
31
|
openApiCommand.command("fuzz").description(
|
|
29
32
|
"Fuzz an OpenAPI schema by generating random data and sending it to the server."
|
|
30
33
|
).option("--limit <limit>", "Maximum number of requests to send.").option("--workers <workers>", "Number of workers to use", "2").option(
|
|
@@ -40,9 +43,18 @@ function registerRepoCommand(program) {
|
|
|
40
43
|
const command = program.command("repo [command]").description("Tools for working across your entire repository.");
|
|
41
44
|
const schemaCommand = command.command("schema [command]").description("Various tools for working with API schema");
|
|
42
45
|
const openApiCommand = schemaCommand.command("openapi [command]").description("Tooling for OpenApi schema");
|
|
43
|
-
openApiCommand.command("
|
|
44
|
-
"
|
|
45
|
-
).action(
|
|
46
|
+
openApiCommand.command("validate [paths...]").description(
|
|
47
|
+
"Validate that all OpenAPI schemas are valid and set up correctly."
|
|
48
|
+
).action(
|
|
49
|
+
lazy(() => import('./repo/schema/openapi/validate.cjs.js'), "bulkCommand")
|
|
50
|
+
);
|
|
51
|
+
openApiCommand.command("verify", { hidden: true }).description("Deprecated: use validate instead.").action(async () => {
|
|
52
|
+
errors.exitWithError(
|
|
53
|
+
new Error(
|
|
54
|
+
`This command has been removed, use 'repo schema openapi validate' instead`
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
});
|
|
46
58
|
openApiCommand.command("lint [paths...]").description("Lint OpenAPI schemas.").option(
|
|
47
59
|
"--strict",
|
|
48
60
|
"Fail on any linting severity messages, not just errors."
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chalk = require('chalk');
|
|
4
|
+
var helpers = require('../../../../lib/openapi/helpers.cjs.js');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
9
|
+
|
|
10
|
+
async function command() {
|
|
11
|
+
try {
|
|
12
|
+
const resolvedOpenapiPath = await helpers.getPathToCurrentOpenApiSpec();
|
|
13
|
+
await helpers.loadAndValidateOpenApiYaml(resolvedOpenapiPath);
|
|
14
|
+
console.log(chalk__default.default.green("OpenAPI spec is valid."));
|
|
15
|
+
} catch (err) {
|
|
16
|
+
console.log(chalk__default.default.red("OpenAPI spec validation failed:"));
|
|
17
|
+
console.error(err);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.command = command;
|
|
23
|
+
//# sourceMappingURL=validate.cjs.js.map
|
|
@@ -14,7 +14,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
14
14
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
15
15
|
var chalk__default = /*#__PURE__*/_interopDefaultCompat(chalk);
|
|
16
16
|
|
|
17
|
-
async function
|
|
17
|
+
async function validate(directoryPath) {
|
|
18
18
|
let openapiPath = "";
|
|
19
19
|
try {
|
|
20
20
|
openapiPath = await helpers.getPathToOpenApiSpec(directoryPath);
|
|
@@ -43,7 +43,7 @@ async function verify(directoryPath) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
async function bulkCommand(paths = []) {
|
|
46
|
-
const resultsList = await runner.runner(paths, (dir) =>
|
|
46
|
+
const resultsList = await runner.runner(paths, (dir) => validate(dir));
|
|
47
47
|
let failed = false;
|
|
48
48
|
for (const { relativeDir, resultText } of resultsList) {
|
|
49
49
|
if (resultText) {
|
|
@@ -56,9 +56,9 @@ async function bulkCommand(paths = []) {
|
|
|
56
56
|
if (failed) {
|
|
57
57
|
process.exit(1);
|
|
58
58
|
} else {
|
|
59
|
-
console.log(chalk__default.default.green("
|
|
59
|
+
console.log(chalk__default.default.green("Validated all files."));
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
exports.bulkCommand = bulkCommand;
|
|
64
|
-
//# sourceMappingURL=
|
|
64
|
+
//# sourceMappingURL=validate.cjs.js.map
|
package/dist/package.json.cjs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/repo-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "CLI for Backstage repo tooling ",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
45
45
|
"@apisyouwonthate/style-guide": "^1.4.0",
|
|
46
|
-
"@backstage/backend-plugin-api": "1.10.0
|
|
47
|
-
"@backstage/catalog-model": "1.
|
|
48
|
-
"@backstage/cli-common": "0.3.0",
|
|
49
|
-
"@backstage/cli-node": "0.3.4",
|
|
50
|
-
"@backstage/config-loader": "1.11.
|
|
51
|
-
"@backstage/errors": "1.3.1",
|
|
46
|
+
"@backstage/backend-plugin-api": "^1.10.0",
|
|
47
|
+
"@backstage/catalog-model": "^1.10.0",
|
|
48
|
+
"@backstage/cli-common": "^0.3.0",
|
|
49
|
+
"@backstage/cli-node": "^0.3.4",
|
|
50
|
+
"@backstage/config-loader": "^1.11.2",
|
|
51
|
+
"@backstage/errors": "^1.3.1",
|
|
52
52
|
"@electric-sql/pglite": "^0.3.0",
|
|
53
53
|
"@manypkg/get-packages": "^1.1.3",
|
|
54
54
|
"@microsoft/api-documenter": "^7.28.1",
|
|
@@ -79,15 +79,15 @@
|
|
|
79
79
|
"lodash": "^4.17.21",
|
|
80
80
|
"minimatch": "^10.2.1",
|
|
81
81
|
"p-limit": "^3.0.2",
|
|
82
|
-
"tar": "^7.5.
|
|
82
|
+
"tar": "^7.5.21",
|
|
83
83
|
"ts-morph": "^24.0.0",
|
|
84
84
|
"yaml-diff-patch": "^2.0.0",
|
|
85
85
|
"zod": "^3.25.76 || ^4.0.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@backstage/backend-test-utils": "1.11.6
|
|
89
|
-
"@backstage/cli": "0.36.
|
|
90
|
-
"@backstage/types": "1.2.2",
|
|
88
|
+
"@backstage/backend-test-utils": "^1.11.6",
|
|
89
|
+
"@backstage/cli": "^0.36.5",
|
|
90
|
+
"@backstage/types": "^1.2.2",
|
|
91
91
|
"@types/is-glob": "^4.0.2",
|
|
92
92
|
"@types/node": "^22.13.14",
|
|
93
93
|
"@types/prettier": "^2.0.0",
|