@backstage/repo-tools 0.3.0-next.0 → 0.3.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,19 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 799c33047ed: **BREAKING**: The OpenAPI commands are now found within the `schema openapi` sub-command. For example `yarn backstage-repo-tools schema:openapi:verify` is now `yarn backstage-repo-tools schema openapi verify`.
8
+ - 27956d78671: Generated OpenAPI files now have a `.generated.ts` file name and a warning header at the top, to highlight that they should not be edited by hand.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+ - @backstage/cli-common@0.1.12
14
+ - @backstage/cli-node@0.1.0
15
+ - @backstage/errors@1.1.5
16
+
3
17
  ## 0.3.0-next.0
4
18
 
5
19
  ### Minor Changes
@@ -56,7 +56,7 @@ async function verify(directoryPath) {
56
56
  if (!lodash.isEqual(schema.default, yaml)) {
57
57
  const path$1 = path.relative(paths.paths.targetRoot, directoryPath);
58
58
  throw new Error(
59
- `\`${constants.YAML_SCHEMA_PATH}\` and \`${constants.TS_SCHEMA_PATH}\` do not match. Please run \`yarn backstage-repo-tools schema:openapi:generate ${path$1}\` to regenerate \`${constants.TS_SCHEMA_PATH}\`.`
59
+ `\`${constants.YAML_SCHEMA_PATH}\` and \`${constants.TS_SCHEMA_PATH}\` do not match. Please run \`yarn backstage-repo-tools schema openapi generate ${path$1}\` to regenerate \`${constants.TS_SCHEMA_PATH}\`.`
60
60
  );
61
61
  }
62
62
  }
@@ -79,4 +79,4 @@ async function bulkCommand(paths = []) {
79
79
  }
80
80
 
81
81
  exports.bulkCommand = bulkCommand;
82
- //# sourceMappingURL=verify-72114657.cjs.js.map
82
+ //# sourceMappingURL=verify-46e56357.cjs.js.map
package/dist/index.cjs.js CHANGED
@@ -37,6 +37,16 @@ ${chalk__default["default"].red(`${error}`)}
37
37
  }
38
38
  }
39
39
 
40
+ function registerSchemaCommand(program) {
41
+ const command = program.command("schema [command]").description("Various tools for working with API schema");
42
+ const openApiCommand = command.command("openapi [command]").description("Tooling for OpenApi schema");
43
+ openApiCommand.command("verify [paths...]").description(
44
+ "Verify that all OpenAPI schemas are valid and have a matching `schemas/openapi.generated.ts` file."
45
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/verify-46e56357.cjs.js'); }).then((m) => m.bulkCommand)));
46
+ openApiCommand.command("generate [paths...]").description(
47
+ "Generates a Typescript file from an OpenAPI yaml spec. For use with the `@backstage/backend-openapi-utils` ApiRouter type."
48
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/generate-6f0190dd.cjs.js'); }).then((m) => m.bulkCommand)));
49
+ }
40
50
  function registerCommands(program) {
41
51
  program.command("api-reports [paths...]").option("--ci", "CI run checks that there is no changes on API reports").option("--tsc", "executes the tsc compilation before extracting the APIs").option("--docs", "generates the api documentation").option(
42
52
  "--include <pattern>",
@@ -65,12 +75,7 @@ function registerCommands(program) {
65
75
  )
66
76
  );
67
77
  program.command("type-deps").description("Find inconsistencies in types of all packages and plugins").action(lazy(() => Promise.resolve().then(function () { return require('./cjs/type-deps-5eacd931.cjs.js'); }).then((m) => m.default)));
68
- program.command("schema:openapi:verify [paths...]").description(
69
- "Verify that all OpenAPI schemas are valid and have a matching `schemas/openapi.generated.ts` file."
70
- ).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/verify-72114657.cjs.js'); }).then((m) => m.bulkCommand)));
71
- program.command("schema:openapi:generate [paths...]").description(
72
- "Generates a Typescript file from an OpenAPI yaml spec. For use with the `@backstage/backend-openapi-utils` ApiRouter type."
73
- ).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/generate-6f0190dd.cjs.js'); }).then((m) => m.bulkCommand)));
78
+ registerSchemaCommand(program);
74
79
  }
75
80
  function lazy(getActionFunc) {
76
81
  return async (...args) => {
@@ -85,7 +90,7 @@ function lazy(getActionFunc) {
85
90
  };
86
91
  }
87
92
 
88
- var version = "0.3.0-next.0";
93
+ var version = "0.3.0";
89
94
 
90
95
  const main = (argv) => {
91
96
  commander.program.name("backstage-repo-tools").version(version);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/repo-tools",
3
3
  "description": "CLI for Backstage repo tooling ",
4
- "version": "0.3.0-next.0",
4
+ "version": "0.3.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,7 +49,7 @@
49
49
  "ts-node": "^10.0.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@backstage/cli": "^0.22.7-next.0",
52
+ "@backstage/cli": "^0.22.7",
53
53
  "@backstage/types": "^1.0.2",
54
54
  "@types/is-glob": "^4.0.2",
55
55
  "@types/mock-fs": "^4.13.0",