From 55c1ac90b72a6fe22a29ceaffed50e3e061f9354 Mon Sep 17 00:00:00 2001 From: Martin Polasko Date: Fri, 2 Jan 2026 15:55:43 +0100 Subject: [PATCH 1/5] fix(orchestrator): resolve TypeScript compilation errors Fixes RHIDP-11204 This PR fixes TypeScript compilation errors in the orchestrator plugins: 1. Fix incorrect import paths: - Change '@backstage/types/index' to '@backstage/types' in 7 files 2. Add missing type declarations: - Add '@types/js-yaml' to devDependencies in orchestrator-common - Add '@types/js-yaml' to devDependencies in scaffolder-backend-module-orchestrator 3. Add missing devDependencies for frontend plugin: - Add 'react', 'react-dom', 'react-router-dom' to orchestrator devDependencies (required for dynamic plugin export to resolve peer dependencies) Files modified: - plugins/orchestrator-common/package.json - plugins/orchestrator/package.json - plugins/scaffolder-backend-module-orchestrator/package.json - plugins/orchestrator-form-react/src/components/AuthRequester.tsx - plugins/orchestrator-form-widgets/src/uiPropTypes.ts - plugins/orchestrator-form-widgets/src/utils/evaluateTemplate.test.ts - plugins/orchestrator-form-widgets/src/utils/useFetch.ts - plugins/orchestrator-form-widgets/src/utils/useFetchAndEvaluate.ts - plugins/orchestrator/src/utils/deepSearchObject.ts - plugins/scaffolder-backend-module-orchestrator/src/actions/getWorkflowParams.ts --- .../.changeset/fix-tsc-compilation-errors.md | 22 +++++++++++++++++++ .../plugins/orchestrator-common/package.json | 1 + .../src/components/AuthRequester.tsx | 2 +- .../orchestrator-form-widgets/package.json | 4 +++- .../src/uiPropTypes.ts | 2 +- .../src/utils/evaluateTemplate.test.ts | 2 +- .../src/utils/useFetch.ts | 2 +- .../src/utils/useFetchAndEvaluate.ts | 2 +- .../plugins/orchestrator/package.json | 5 ++++- .../src/utils/deepSearchObject.ts | 2 +- .../package.json | 3 ++- .../src/actions/getWorkflowParams.ts | 2 +- workspaces/orchestrator/yarn.lock | 7 +++++- 13 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md diff --git a/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md b/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md new file mode 100644 index 0000000000..168d4fe650 --- /dev/null +++ b/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md @@ -0,0 +1,22 @@ +--- +'@red-hat-developer-hub/backstage-plugin-orchestrator': patch +'@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch +'@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets': patch +'@red-hat-developer-hub/backstage-plugin-orchestrator-form-react': patch +'@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator': patch +--- + +Fix TypeScript compilation errors (RHIDP-11204) + +This change fixes multiple TypeScript compilation errors that were preventing Konflux builds from succeeding: + +1. **Import path fixes**: Corrected `@backstage/types/index` imports to `@backstage/types` in 7 source files across multiple packages + +2. **Missing type declarations**: Added `@types/js-yaml` to devDependencies in orchestrator-common and scaffolder-backend-module-orchestrator packages + +3. **Missing peer dependencies**: Added `react`, `react-dom`, and `react-router-dom` to devDependencies in both orchestrator and orchestrator-form-widgets packages to resolve dynamic plugin export requirements + +Files modified: + +- Source files with import path corrections +- package.json files with added dependencies diff --git a/workspaces/orchestrator/plugins/orchestrator-common/package.json b/workspaces/orchestrator/plugins/orchestrator-common/package.json index 3def8b1321..ae82c22338 100644 --- a/workspaces/orchestrator/plugins/orchestrator-common/package.json +++ b/workspaces/orchestrator/plugins/orchestrator-common/package.json @@ -64,6 +64,7 @@ "devDependencies": { "@backstage/cli": "^0.34.5", "@openapitools/openapi-generator-cli": "2.25.2", + "@types/js-yaml": "^4.0.0", "@types/json-schema": "7.0.15", "js-yaml-cli": "^0.6.0" }, diff --git a/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/AuthRequester.tsx b/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/AuthRequester.tsx index 2710c6fe2e..9adfe56f2c 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/AuthRequester.tsx +++ b/workspaces/orchestrator/plugins/orchestrator-form-react/src/components/AuthRequester.tsx @@ -15,7 +15,7 @@ */ import { useEffect } from 'react'; -import { JsonObject } from '@backstage/types/index'; +import { JsonObject } from '@backstage/types'; import { Widget } from '@rjsf/utils'; import type { JSONSchema7 } from 'json-schema'; diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json b/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json index dc2195a166..d9b46ae892 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json @@ -86,7 +86,9 @@ "@testing-library/user-event": "^14.0.0", "express": "^5.1.0", "msw": "^1.0.0", - "react": "^16.13.1 || ^17.0.0 || ^18.0.0" + "react": "^18.0.0", + "react-dom": "^18.0.0", + "react-router-dom": "^6.3.0" }, "files": [ "app-config.yaml", diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/uiPropTypes.ts b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/uiPropTypes.ts index e85ae9199a..9ffb838463 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/uiPropTypes.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/uiPropTypes.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { JsonValue } from '@backstage/types/index'; +import { JsonValue } from '@backstage/types'; import { TypographyVariant } from '@mui/material/styles'; export type UiProps = { diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/evaluateTemplate.test.ts b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/evaluateTemplate.test.ts index 2ac3633577..9b6e55eb15 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/evaluateTemplate.test.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/evaluateTemplate.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { JsonValue } from '@backstage/types/index'; +import { JsonValue } from '@backstage/types'; import { evaluateTemplate, evaluateTemplateProps } from './evaluateTemplate'; import get from 'lodash/get'; diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts index ebe6f2055b..3b590baeb1 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetch.ts @@ -15,7 +15,7 @@ */ import { useApi, fetchApiRef } from '@backstage/core-plugin-api'; -import { JsonObject } from '@backstage/types/index'; +import { JsonObject } from '@backstage/types'; import { useState } from 'react'; import { UiProps } from '../uiPropTypes'; import { getErrorMessage } from './errorUtils'; diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetchAndEvaluate.ts b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetchAndEvaluate.ts index 0d5a28e637..7beeb22007 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetchAndEvaluate.ts +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/src/utils/useFetchAndEvaluate.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { JsonObject } from '@backstage/types/index'; +import { JsonObject } from '@backstage/types'; import React, { useState, useEffect } from 'react'; import { UiProps } from '../uiPropTypes'; import { getErrorMessage } from './errorUtils'; diff --git a/workspaces/orchestrator/plugins/orchestrator/package.json b/workspaces/orchestrator/plugins/orchestrator/package.json index ab14891b5c..db4374f3e2 100644 --- a/workspaces/orchestrator/plugins/orchestrator/package.json +++ b/workspaces/orchestrator/plugins/orchestrator/package.json @@ -90,7 +90,10 @@ "@types/react": "^18.2.58", "@types/react-dom": "^18.2.19", "@types/uuid": "^9.0.0", - "prettier": "3.6.2" + "prettier": "3.6.2", + "react": "^18.0.0", + "react-dom": "^18.0.0", + "react-router-dom": "^6.3.0" }, "peerDependencies": { "@mui/icons-material": "^5.17.1", diff --git a/workspaces/orchestrator/plugins/orchestrator/src/utils/deepSearchObject.ts b/workspaces/orchestrator/plugins/orchestrator/src/utils/deepSearchObject.ts index 4e3872e313..0368f5c182 100644 --- a/workspaces/orchestrator/plugins/orchestrator/src/utils/deepSearchObject.ts +++ b/workspaces/orchestrator/plugins/orchestrator/src/utils/deepSearchObject.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { JsonObject } from '@backstage/types/index'; +import { JsonObject } from '@backstage/types'; import { isJsonObject } from '@red-hat-developer-hub/backstage-plugin-orchestrator-common'; diff --git a/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/package.json b/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/package.json index 4a9b7d9068..0992e95f65 100644 --- a/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/package.json +++ b/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/package.json @@ -68,7 +68,8 @@ "@backstage/cli": "^0.34.5", "@backstage/plugin-scaffolder-node-test-utils": "^0.3.5", "@janus-idp/cli": "3.6.1", - "@spotify/prettier-config": "^15.0.0" + "@spotify/prettier-config": "^15.0.0", + "@types/js-yaml": "^4.0.0" }, "files": [ "app-config.yaml", diff --git a/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/src/actions/getWorkflowParams.ts b/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/src/actions/getWorkflowParams.ts index 1cc61895ba..1ab7cc7158 100644 --- a/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/src/actions/getWorkflowParams.ts +++ b/workspaces/orchestrator/plugins/scaffolder-backend-module-orchestrator/src/actions/getWorkflowParams.ts @@ -16,7 +16,7 @@ import { AuthService } from '@backstage/backend-plugin-api'; import { DiscoveryApi } from '@backstage/plugin-permission-common'; import { createTemplateAction } from '@backstage/plugin-scaffolder-node'; -import { JsonObject } from '@backstage/types/index'; +import { JsonObject } from '@backstage/types'; import { isAxiosError } from 'axios'; import { dump } from 'js-yaml'; diff --git a/workspaces/orchestrator/yarn.lock b/workspaces/orchestrator/yarn.lock index 53c7041567..0c97d497de 100644 --- a/workspaces/orchestrator/yarn.lock +++ b/workspaces/orchestrator/yarn.lock @@ -12726,6 +12726,7 @@ __metadata: "@backstage/types": ^1.2.2 "@openapitools/openapi-generator-cli": 2.25.2 "@serverlessworkflow/sdk-typescript": ^0.8.4 + "@types/js-yaml": ^4.0.0 "@types/json-schema": 7.0.15 axios: ^1.11.0 js-yaml: ^4.1.0 @@ -12859,6 +12860,9 @@ __metadata: lodash: ^4.17.21 luxon: ^3.7.2 prettier: 3.6.2 + react: ^18.0.0 + react-dom: ^18.0.0 + react-router-dom: ^6.3.0 react-use: ^17.4.0 swr: ^2.0.0 tss-react: ^4.9.18 @@ -12887,6 +12891,7 @@ __metadata: "@janus-idp/cli": 3.6.1 "@red-hat-developer-hub/backstage-plugin-orchestrator-common": "workspace:^" "@spotify/prettier-config": ^15.0.0 + "@types/js-yaml": ^4.0.0 axios: ^1.11.0 js-yaml: ^4.1.0 languageName: unknown @@ -16038,7 +16043,7 @@ __metadata: languageName: node linkType: hard -"@types/js-yaml@npm:^4.0.1": +"@types/js-yaml@npm:^4.0.0, @types/js-yaml@npm:^4.0.1": version: 4.0.9 resolution: "@types/js-yaml@npm:4.0.9" checksum: e5e5e49b5789a29fdb1f7d204f82de11cb9e8f6cb24ab064c616da5d6e1b3ccfbf95aa5d1498a9fbd3b9e745564e69b4a20b6c530b5a8bbb2d4eb830cda9bc69 From 844f2cf3445bed19f9f970316f7dc5f675980814 Mon Sep 17 00:00:00 2001 From: Martin Polasko Date: Mon, 5 Jan 2026 12:56:26 +0100 Subject: [PATCH 2/5] fix(orchestrator-form-widgets): add react-dom and react-router-dom to peerDependencies - Add react-dom and react-router-dom to peerDependencies in orchestrator-form-widgets - This fixes the webpack bundling error during scalprum dynamic plugin export - Ensures these dependencies are treated as externals rather than bundled --- .../plugins/orchestrator-form-widgets/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json b/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json index d9b46ae892..85dbdd2bc7 100644 --- a/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json +++ b/workspaces/orchestrator/plugins/orchestrator-form-widgets/package.json @@ -67,7 +67,9 @@ "tss-react": "^4.9.18" }, "peerDependencies": { - "react": "^16.13.1 || ^17.0.0 || ^18.0.0" + "react": "^16.13.1 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", + "react-router-dom": "^6.3.0" }, "scalprum": { "name": "red-hat-developer-hub.backstage-plugin-orchestrator-form-widgets", From bed65df47b7a858273b05d7acf8c40242ac66849 Mon Sep 17 00:00:00 2001 From: Martin Polasko Date: Mon, 5 Jan 2026 12:57:14 +0100 Subject: [PATCH 3/5] chore: update yarn.lock for orchestrator-form-widgets peerDependencies - Update yarn.lock to reflect react-dom and react-router-dom peerDependencies changes - Ensures proper dependency resolution for dynamic plugin export --- workspaces/orchestrator/yarn.lock | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/workspaces/orchestrator/yarn.lock b/workspaces/orchestrator/yarn.lock index 0c97d497de..383775a99d 100644 --- a/workspaces/orchestrator/yarn.lock +++ b/workspaces/orchestrator/yarn.lock @@ -12816,11 +12816,15 @@ __metadata: jsonata: ^2.0.6 lodash: ^4.17.21 msw: ^1.0.0 - react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react: ^18.0.0 + react-dom: ^18.0.0 + react-router-dom: ^6.3.0 react-use: ^17.2.4 tss-react: ^4.9.18 peerDependencies: react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-router-dom: ^6.3.0 languageName: unknown linkType: soft From a0a156daa1c73f1b9f736f4f75d0c5502062ef19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pola=C5=A1ko?= <50864147+polasudo@users.noreply.github.com> Date: Mon, 5 Jan 2026 13:10:27 +0100 Subject: [PATCH 4/5] Fix TypeScript compilation errors for multiple packages This change addresses multiple TypeScript compilation errors that were hindering builds, including import path corrections, adding missing type declarations, and resolving peer dependencies. --- .../.changeset/fix-tsc-compilation-errors.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md b/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md index 168d4fe650..a5c634917c 100644 --- a/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md +++ b/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md @@ -1,22 +1,5 @@ ---- '@red-hat-developer-hub/backstage-plugin-orchestrator': patch '@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets': patch '@red-hat-developer-hub/backstage-plugin-orchestrator-form-react': patch '@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator': patch ---- - -Fix TypeScript compilation errors (RHIDP-11204) - -This change fixes multiple TypeScript compilation errors that were preventing Konflux builds from succeeding: - -1. **Import path fixes**: Corrected `@backstage/types/index` imports to `@backstage/types` in 7 source files across multiple packages - -2. **Missing type declarations**: Added `@types/js-yaml` to devDependencies in orchestrator-common and scaffolder-backend-module-orchestrator packages - -3. **Missing peer dependencies**: Added `react`, `react-dom`, and `react-router-dom` to devDependencies in both orchestrator and orchestrator-form-widgets packages to resolve dynamic plugin export requirements - -Files modified: - -- Source files with import path corrections -- package.json files with added dependencies From 8e8ee3c1a89ab9908c92fb82fc6a6fd480239a8d Mon Sep 17 00:00:00 2001 From: Martin Polasko Date: Mon, 5 Jan 2026 13:31:53 +0100 Subject: [PATCH 5/5] fix(changeset): add proper YAML frontmatter to fix-tsc-compilation-errors.md --- .../orchestrator/.changeset/fix-tsc-compilation-errors.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md b/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md index a5c634917c..4777229dcb 100644 --- a/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md +++ b/workspaces/orchestrator/.changeset/fix-tsc-compilation-errors.md @@ -1,5 +1,9 @@ +--- '@red-hat-developer-hub/backstage-plugin-orchestrator': patch '@red-hat-developer-hub/backstage-plugin-orchestrator-common': patch '@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets': patch '@red-hat-developer-hub/backstage-plugin-orchestrator-form-react': patch '@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator': patch +--- + +Fix TypeScript compilation errors in orchestrator plugins