@backstage/repo-tools 0.13.3-next.0 → 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,31 @@
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
+
16
+ ## 0.13.3-next.1
17
+
18
+ ### Patch Changes
19
+
20
+ - 72d019d: Removed various typos
21
+ - Updated dependencies
22
+ - @backstage/backend-plugin-api@1.3.1-next.1
23
+ - @backstage/config-loader@1.10.1-next.0
24
+ - @backstage/catalog-model@1.7.3
25
+ - @backstage/cli-common@0.1.15
26
+ - @backstage/cli-node@0.2.13
27
+ - @backstage/errors@1.2.7
28
+
3
29
  ## 0.13.3-next.0
4
30
 
5
31
  ### 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."
@@ -86,7 +88,7 @@ function registerCommands(program) {
86
88
  false
87
89
  ).option(
88
90
  "-o, --omit-messages <messageCodes>",
89
- "select some message code to be omited on the API Extractor (comma separated values i.e ae-cyclic-inherit-doc,ae-missing-getter )"
91
+ "select some message code to be omitted on the API Extractor (comma separated values i.e ae-cyclic-inherit-doc,ae-missing-getter )"
90
92
  ).option(
91
93
  "--validate-release-tags",
92
94
  "Turn on release tag validation for the public, beta, and alpha APIs"
@@ -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.0";
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.0",
3
+ "version": "0.13.3-next.2",
4
4
  "description": "CLI for Backstage repo tooling ",
5
5
  "backstage": {
6
6
  "role": "cli"
@@ -43,11 +43,11 @@
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.3.1-next.0",
46
+ "@backstage/backend-plugin-api": "1.3.1-next.1",
47
47
  "@backstage/catalog-model": "1.7.3",
48
48
  "@backstage/cli-common": "0.1.15",
49
49
  "@backstage/cli-node": "0.2.13",
50
- "@backstage/config-loader": "1.10.0",
50
+ "@backstage/config-loader": "1.10.1-next.0",
51
51
  "@backstage/errors": "1.2.7",
52
52
  "@electric-sql/pglite": "^0.2.15",
53
53
  "@manypkg/get-packages": "^1.1.3",
@@ -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.0",
88
- "@backstage/cli": "0.32.1-next.0",
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",