@backstage/repo-tools 0.16.0 → 0.16.1-next.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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # @backstage/repo-tools
2
2
 
3
+ ## 0.16.1-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 688f070: Updated to use new utilities from `@backstage/cli-common`.
8
+ - d1e38a7: Properly create workspace in OS temporary directory for `generate-patch` command
9
+ - Updated dependencies
10
+ - @backstage/cli-node@0.2.16-next.1
11
+ - @backstage/cli-common@0.1.16-next.1
12
+
13
+ ## 0.16.1-next.0
14
+
15
+ ### Patch Changes
16
+
17
+ - 85895f9: Updates OpenAPI generator templates to preserve original property names (like 'group-name', 'user-id') from OpenAPI specs when propertyNaming=original is specified. Previously, these were always converted to camelCase regardless of the propertyNaming setting.
18
+
19
+ - Updates modelGeneric.mustache templates in both client and server generators
20
+ - Updates modelTaggedUnion.mustache templates in both client and server generators
21
+ - Uses {{baseName}} when available, falls back to {{name}} for backward compatibility
22
+ - Maintains backward compatibility - no changes when propertyNaming=original is not used
23
+
24
+ - Updated dependencies
25
+ - @backstage/backend-plugin-api@1.5.1-next.0
26
+ - @backstage/cli-common@0.1.16-next.0
27
+ - @backstage/cli-node@0.2.16-next.0
28
+ - @backstage/config-loader@1.10.7-next.0
29
+ - @backstage/catalog-model@1.7.6
30
+ - @backstage/errors@1.2.7
31
+
3
32
  ## 0.16.0
4
33
 
5
34
  ### Minor Changes
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var fs = require('fs-extra');
4
- var child_process = require('child_process');
4
+ var cliCommon = require('@backstage/cli-common');
5
5
  var paths = require('../../../lib/paths.cjs.js');
6
6
 
7
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -10,22 +10,27 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
10
10
 
11
11
  async function generateTypeDeclarations(tsconfigFilePath) {
12
12
  await fs__default.default.remove(paths.paths.resolveTargetRoot("dist-types"));
13
- const { status } = child_process.spawnSync(
14
- "yarn",
15
- [
16
- "tsc",
17
- ["--project", tsconfigFilePath],
18
- ["--skipLibCheck", "false"],
19
- ["--incremental", "false"]
20
- ].flat(),
21
- {
22
- stdio: "inherit",
23
- shell: true,
24
- cwd: paths.paths.targetRoot
13
+ try {
14
+ await cliCommon.run(
15
+ [
16
+ "yarn",
17
+ "tsc",
18
+ "--project",
19
+ tsconfigFilePath,
20
+ "--skipLibCheck",
21
+ "false",
22
+ "--incremental",
23
+ "false"
24
+ ],
25
+ {
26
+ cwd: paths.paths.targetRoot
27
+ }
28
+ ).waitForExit();
29
+ } catch (error) {
30
+ if (error instanceof cliCommon.ExitCodeError) {
31
+ process.exit(error.code);
25
32
  }
26
- );
27
- if (status !== 0) {
28
- process.exit(status || void 0);
33
+ throw error;
29
34
  }
30
35
  }
31
36
 
@@ -56,7 +56,9 @@ var generatePatch = async (packageArg, opts) => {
56
56
  if (!sourcePkg) {
57
57
  throw new Error(`Could not find package ${packageArg} in source repo`);
58
58
  }
59
- const tmpDir = await fs__default.default.mkdtemp(os__default.default.tmpdir());
59
+ const tmpDir = await fs__default.default.mkdtemp(
60
+ path.join(os__default.default.tmpdir(), "backstage-repo-tools-generate-patch-")
61
+ );
60
62
  const ctx = {
61
63
  sourceRepo,
62
64
  targetRepo,
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
+ var backendPluginApi = require('@backstage/backend-plugin-api');
3
4
  var chalk = require('chalk');
4
- var path = require('path');
5
- var constants = require('../../../../../lib/openapi/constants.cjs.js');
6
- var paths = require('../../../../../lib/paths.cjs.js');
7
5
  var fs = require('fs-extra');
6
+ var path = require('path');
8
7
  var exec = require('../../../../../lib/exec.cjs.js');
9
- var backendPluginApi = require('@backstage/backend-plugin-api');
10
- var helpers = require('../../../../../lib/openapi/helpers.cjs.js');
8
+ var constants = require('../../../../../lib/openapi/constants.cjs.js');
11
9
  var dedupeImports = require('../../../../../lib/openapi/dedupe-imports.cjs.js');
10
+ var helpers = require('../../../../../lib/openapi/helpers.cjs.js');
11
+ var paths = require('../../../../../lib/paths.cjs.js');
12
12
 
13
13
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
14
 
@@ -51,7 +51,9 @@ async function lint(directoryPath, config) {
51
51
  "api-home-get": "off",
52
52
  "operation-tags": "off",
53
53
  "hosts-https-only-oas3": "off",
54
- "no-unknown-error-format": "off"
54
+ "no-unknown-error-format": "off",
55
+ // Disabled as it currently gives false positives when 'example' is used as a property name.
56
+ "oas3-valid-media-example": "off"
55
57
  }
56
58
  }
57
59
  ]
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.16.0";
3
+ var version = "0.16.1-next.1";
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.16.0",
3
+ "version": "0.16.1-next.1",
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.5.0",
47
- "@backstage/catalog-model": "^1.7.6",
48
- "@backstage/cli-common": "^0.1.15",
49
- "@backstage/cli-node": "^0.2.15",
50
- "@backstage/config-loader": "^1.10.6",
51
- "@backstage/errors": "^1.2.7",
46
+ "@backstage/backend-plugin-api": "1.5.1-next.0",
47
+ "@backstage/catalog-model": "1.7.6",
48
+ "@backstage/cli-common": "0.1.16-next.1",
49
+ "@backstage/cli-node": "0.2.16-next.1",
50
+ "@backstage/config-loader": "1.10.7-next.0",
51
+ "@backstage/errors": "1.2.7",
52
52
  "@electric-sql/pglite": "^0.3.0",
53
53
  "@manypkg/get-packages": "^1.1.3",
54
54
  "@microsoft/api-documenter": "^7.25.7",
@@ -86,9 +86,9 @@
86
86
  "zod": "^3.22.4"
87
87
  },
88
88
  "devDependencies": {
89
- "@backstage/backend-test-utils": "^1.10.0",
90
- "@backstage/cli": "^0.34.5",
91
- "@backstage/types": "^1.2.2",
89
+ "@backstage/backend-test-utils": "1.10.1-next.0",
90
+ "@backstage/cli": "0.34.6-next.1",
91
+ "@backstage/types": "1.2.2",
92
92
  "@types/is-glob": "^4.0.2",
93
93
  "@types/node": "^20.16.0",
94
94
  "@types/prettier": "^2.0.0",
@@ -18,7 +18,7 @@ export {{#isNullable}}type{{/isNullable}}{{^isNullable}}interface{{/isNullable}}
18
18
  * {{{.}}}
19
19
  */
20
20
  {{/description}}
21
- '{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
21
+ '{{#baseName}}{{baseName}}{{/baseName}}{{^baseName}}{{name}}{{/baseName}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
22
22
  {{/vars}}
23
23
  }{{#isNullable}} | null{{/isNullable}}
24
24
 
@@ -12,7 +12,7 @@ export interface {{classname}} { {{>modelGenericAdditionalProperties}}
12
12
  * {{{.}}}
13
13
  */
14
14
  {{/description}}
15
- {{name}}{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}};
15
+ '{{#baseName}}{{baseName}}{{/baseName}}{{^baseName}}{{name}}{{/baseName}}'{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}};
16
16
  {{/allVars}}
17
17
  }
18
18
  {{>modelGenericEnums}}
@@ -18,7 +18,7 @@ export {{#isNullable}}type{{/isNullable}}{{^isNullable}}interface{{/isNullable}}
18
18
  * {{{.}}}
19
19
  */
20
20
  {{/description}}
21
- '{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
21
+ '{{#baseName}}{{baseName}}{{/baseName}}{{^baseName}}{{name}}{{/baseName}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
22
22
  {{/vars}}
23
23
  }{{#isNullable}} | null{{/isNullable}}
24
24
 
@@ -12,7 +12,7 @@ export interface {{classname}} { {{>modelGenericAdditionalProperties}}
12
12
  * {{{.}}}
13
13
  */
14
14
  {{/description}}
15
- {{name}}{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}};
15
+ '{{#baseName}}{{baseName}}{{/baseName}}{{^baseName}}{{name}}{{/baseName}}'{{^required}}?{{/required}}: {{#discriminatorValue}}'{{.}}'{{/discriminatorValue}}{{^discriminatorValue}}{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/discriminatorValue}}{{#isNullable}} | null{{/isNullable}};
16
16
  {{/allVars}}
17
17
  }
18
18
  {{>modelGenericEnums}}