From a01e1c1547cbe713c89cf81a3c668f18cb7b39ee Mon Sep 17 00:00:00 2001 From: Jonas Beck Date: Tue, 3 Jun 2025 18:32:25 +0200 Subject: [PATCH 1/3] fix(repo-tools): remove enum const export Signed-off-by: Jonas Beck --- .../typescript-backstage-client/modelEnum.mustache | 11 ----------- .../typescript-backstage-server/modelEnum.mustache | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/packages/repo-tools/templates/typescript-backstage-client/modelEnum.mustache b/packages/repo-tools/templates/typescript-backstage-client/modelEnum.mustache index 3a1b5ce86d..2461d8c549 100644 --- a/packages/repo-tools/templates/typescript-backstage-client/modelEnum.mustache +++ b/packages/repo-tools/templates/typescript-backstage-client/modelEnum.mustache @@ -18,14 +18,3 @@ export enum {{classname}} { */ export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; -/** - * @public - */ -export const {{classname}} = { -{{#allowableValues}} -{{#enumVars}} - {{name}}: {{{value}}} as {{classname}}{{^-last}},{{/-last}} -{{/enumVars}} -{{/allowableValues}} -}; -{{/stringEnums}} diff --git a/packages/repo-tools/templates/typescript-backstage-server/modelEnum.mustache b/packages/repo-tools/templates/typescript-backstage-server/modelEnum.mustache index 3a1b5ce86d..2461d8c549 100644 --- a/packages/repo-tools/templates/typescript-backstage-server/modelEnum.mustache +++ b/packages/repo-tools/templates/typescript-backstage-server/modelEnum.mustache @@ -18,14 +18,3 @@ export enum {{classname}} { */ export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^-last}} | {{/-last}}{{/enumVars}}{{/allowableValues}}; -/** - * @public - */ -export const {{classname}} = { -{{#allowableValues}} -{{#enumVars}} - {{name}}: {{{value}}} as {{classname}}{{^-last}},{{/-last}} -{{/enumVars}} -{{/allowableValues}} -}; -{{/stringEnums}} From 4bff5d090ca9fe04d46cdcbccd012067a53caf0b Mon Sep 17 00:00:00 2001 From: Jonas Beck Date: Tue, 3 Jun 2025 18:39:42 +0200 Subject: [PATCH 2/3] chore(changeset): add changeset Signed-off-by: Jonas Beck --- .changeset/fair-doors-bathe.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fair-doors-bathe.md diff --git a/.changeset/fair-doors-bathe.md b/.changeset/fair-doors-bathe.md new file mode 100644 index 0000000000..f28bf5a0e5 --- /dev/null +++ b/.changeset/fair-doors-bathe.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Remove exported `const` objects from the `modelEnum` template files for the server and client, as they were causing issues when defining `enum` schemas From 918dd35940230639819319f04ae46ffef13495d5 Mon Sep 17 00:00:00 2001 From: Jonas Beck <112394761+Jonas-Beck@users.noreply.github.com> Date: Tue, 3 Jun 2025 19:32:58 +0200 Subject: [PATCH 3/3] Update .changeset/fair-doors-bathe.md Co-authored-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com> Signed-off-by: Jonas Beck <112394761+Jonas-Beck@users.noreply.github.com> --- .changeset/fair-doors-bathe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/fair-doors-bathe.md b/.changeset/fair-doors-bathe.md index f28bf5a0e5..bbb5f238ee 100644 --- a/.changeset/fair-doors-bathe.md +++ b/.changeset/fair-doors-bathe.md @@ -2,4 +2,4 @@ '@backstage/repo-tools': patch --- -Remove exported `const` objects from the `modelEnum` template files for the server and client, as they were causing issues when defining `enum` schemas +Fixed a bug where linting would fail with the generated clients when defining top-level `enum` schema values.