@backstage/repo-tools 0.13.3-next.1 → 0.13.3-next.2

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,18 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.13.3-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - b229476: Support passing additional properties to OpenAPI server generator
8
+ - Updated dependencies
9
+ - @backstage/cli-node@0.2.13
10
+ - @backstage/backend-plugin-api@1.3.1-next.1
11
+ - @backstage/catalog-model@1.7.3
12
+ - @backstage/cli-common@0.1.15
13
+ - @backstage/config-loader@1.10.1-next.0
14
+ - @backstage/errors@1.2.7
15
+
3
16
  ## 0.13.3-next.1
4
17
 
5
18
  ### Patch Changes
@@ -21,6 +21,8 @@ function registerPackageCommand(program) {
21
21
  "Command to generate a client and/or a server stub from an OpenAPI spec."
22
22
  ).option("--client-additional-properties [properties]").description(
23
23
  "Additional properties that can be passed to @openapitools/openapi-generator-cli"
24
+ ).option("--server-additional-properties [properties]").description(
25
+ "Additional properties that can be passed to @openapitools/openapi-generator-cli"
24
26
  ).option("--watch").description("Watch the OpenAPI spec for changes and regenerate on save.").action(lazy(() => import('./package/schema/openapi/generate/index.cjs.js'), "command"));
25
27
  openApiCommand.command("fuzz").description(
26
28
  "Fuzz an OpenAPI schema by generating random data and sending it to the server."
@@ -38,7 +38,7 @@ async function command(opts) {
38
38
  );
39
39
  }
40
40
  if (opts.server) {
41
- promises.push(server.command(options));
41
+ promises.push(server.command(options, opts.serverAdditionalProperties));
42
42
  }
43
43
  await Promise.all(promises);
44
44
  };
@@ -45,7 +45,7 @@ export const createOpenApiRouter = async (
45
45
  const indexFile = path.join(schemaDir, "..", "index.ts");
46
46
  await fs__default.default.writeFile(
47
47
  indexFile,
48
- `//
48
+ `//
49
49
  export * from './generated';`
50
50
  );
51
51
  await exec.exec(`yarn backstage-cli package lint`, ["--fix", tsPath, indexFile]);
@@ -55,7 +55,7 @@ export const createOpenApiRouter = async (
55
55
  });
56
56
  }
57
57
  }
58
- async function generate(abortSignal) {
58
+ async function generate(serverAdditionalProperties, abortSignal) {
59
59
  const resolvedOpenapiPath = await helpers.getPathToCurrentOpenApiSpec();
60
60
  const resolvedOutputDirectory = await helpers.getRelativePathToFile(constants.OUTPUT_PATH);
61
61
  await fs__default.default.emptyDir(resolvedOutputDirectory);
@@ -63,6 +63,9 @@ async function generate(abortSignal) {
63
63
  path.resolve(resolvedOutputDirectory, ".openapi-generator-ignore"),
64
64
  constants.OPENAPI_IGNORE_FILES.join("\n")
65
65
  );
66
+ const additionalProperties = helpers.toGeneratorAdditionalProperties({
67
+ initialValue: serverAdditionalProperties
68
+ });
66
69
  await exec.exec(
67
70
  "node",
68
71
  [
@@ -80,7 +83,8 @@ async function generate(abortSignal) {
80
83
  "templates/typescript-backstage-server.yaml"
81
84
  ),
82
85
  "--generator-key",
83
- "v3.0"
86
+ "v3.0",
87
+ additionalProperties ? `--additional-properties=${additionalProperties}` : ""
84
88
  ],
85
89
  {
86
90
  maxBuffer: Number.MAX_VALUE,
@@ -114,9 +118,9 @@ async function generate(abortSignal) {
114
118
  async function command({
115
119
  abortSignal,
116
120
  isWatch = false
117
- }) {
121
+ }, serverAdditionalProperties) {
118
122
  try {
119
- await generate(abortSignal);
123
+ await generate(serverAdditionalProperties, abortSignal);
120
124
  console.log(chalk__default.default.green("Generated server files."));
121
125
  } catch (err) {
122
126
  if (err.name === "AbortError") {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.13.3-next.1";
3
+ var version = "0.13.3-next.2";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/repo-tools",
3
- "version": "0.13.3-next.1",
3
+ "version": "0.13.3-next.2",
4
4
  "description": "CLI for Backstage repo tooling ",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -84,8 +84,8 @@
84
84
  "yaml-diff-patch": "^2.0.0"
85
85
  },
86
86
  "devDependencies": {
87
- "@backstage/backend-test-utils": "1.5.0-next.1",
88
- "@backstage/cli": "0.32.1-next.1",
87
+ "@backstage/backend-test-utils": "1.5.0-next.2",
88
+ "@backstage/cli": "0.32.1-next.2",
89
89
  "@backstage/types": "1.2.1",
90
90
  "@types/is-glob": "^4.0.2",
91
91
  "@types/node": "^20.16.0",