From 09d930c2eba3d9ac8313b5ee3d665b6401ca3973 Mon Sep 17 00:00:00 2001 From: Aramis Sennyey Date: Tue, 29 Nov 2022 12:56:20 -0500 Subject: [PATCH] Add changesets and remove routing changes. Signed-off-by: Aramis Sennyey --- .changeset/quick-islands-tease.md | 9 --------- .changeset/short-games-march.md | 5 +++++ .changeset/spotty-numbers-occur.md | 11 +++++++++++ .changeset/young-apples-hide.md | 5 +++++ .github/vale/Vocab/Backstage/accept.txt | 4 ---- packages/app/src/App.tsx | 2 +- packages/core-app-api/src/app/AppManager.tsx | 2 +- 7 files changed, 23 insertions(+), 15 deletions(-) delete mode 100644 .changeset/quick-islands-tease.md create mode 100644 .changeset/short-games-march.md create mode 100644 .changeset/spotty-numbers-occur.md create mode 100644 .changeset/young-apples-hide.md diff --git a/.changeset/quick-islands-tease.md b/.changeset/quick-islands-tease.md deleted file mode 100644 index 9498e67539..0000000000 --- a/.changeset/quick-islands-tease.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@backstage/app-defaults': minor -'@backstage/cli': minor -'@backstage/config-loader': minor -'@backstage/core-app-api': minor -'@backstage/core-components': minor ---- - -Added support for adding CLI options for setting frontend public path (for example, /backstage) as well as the backend url that the front end uses to communicate with the backend. Both of these can now be specified as relative. diff --git a/.changeset/short-games-march.md b/.changeset/short-games-march.md new file mode 100644 index 0000000000..54c40b943e --- /dev/null +++ b/.changeset/short-games-march.md @@ -0,0 +1,5 @@ +--- +'@backstage/app-defaults': minor +--- + +Added support for parsing relative backend urls to the api factory. Allows relative backend urls to be specified in config options. diff --git a/.changeset/spotty-numbers-occur.md b/.changeset/spotty-numbers-occur.md new file mode 100644 index 0000000000..1b69516617 --- /dev/null +++ b/.changeset/spotty-numbers-occur.md @@ -0,0 +1,11 @@ +--- +'@backstage/cli': minor +--- + +Adds support for two new CLI options on the `repo build` and `package build` commands. Both options are only available to frontend components. Backend config continues to be supplied at runtime. + +CLI options take precedent over any provided config. + +The new options are meant to add greater support for running the same bundle in multiple environments, ex: test, stage and prod. +`--publicPath`: Frontend subroute to host the app on, can be relative or absolute. +`--backendUrl`: Backend url that the {backend.basePath}, e.g. /api, endpoint can be reached on. Can be relative or absolute. diff --git a/.changeset/young-apples-hide.md b/.changeset/young-apples-hide.md new file mode 100644 index 0000000000..c445c45ead --- /dev/null +++ b/.changeset/young-apples-hide.md @@ -0,0 +1,5 @@ +--- +'@backstage/config-loader': minor +--- + +Added new CLI parsing that overrides all other config options, like env and yaml. Currently supports --publicPath and --backendUrl. diff --git a/.github/vale/Vocab/Backstage/accept.txt b/.github/vale/Vocab/Backstage/accept.txt index 3278176bee..ca031c24ca 100644 --- a/.github/vale/Vocab/Backstage/accept.txt +++ b/.github/vale/Vocab/Backstage/accept.txt @@ -32,7 +32,6 @@ boolean Brex builtins callout -CDNs Chai changeset changesets @@ -157,7 +156,6 @@ JaCoCo JavaScript jenkins Jira -JWTs jq js json @@ -167,7 +165,6 @@ JWTs Kaewkasi Keyv Knex -KPIs kubectl kubernetes kubernetes @@ -397,7 +394,6 @@ widget's winston www WWW -XCMetrics XML xyz yaml diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index fd73e99bcb..e766df868d 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -150,7 +150,7 @@ const AppRouter = app.getRouter(); const routes = ( - } /> + } /> {/* TODO(rubenl): Move this to / once its more mature and components exist */} }> {homePage} diff --git a/packages/core-app-api/src/app/AppManager.tsx b/packages/core-app-api/src/app/AppManager.tsx index 571eaf72e0..bbd27f84ce 100644 --- a/packages/core-app-api/src/app/AppManager.tsx +++ b/packages/core-app-api/src/app/AppManager.tsx @@ -116,7 +116,7 @@ function getBasePath(configApi: Config) { function readBasePath(configApi: ConfigApi) { let { pathname } = new URL( configApi.getOptionalString('app.baseUrl') ?? '/', - document.location.origin, // baseUrl can be specified as just a path + 'http://dummy.dev', // baseUrl can be specified as just a path ); pathname = pathname.replace(/\/*$/, ''); return pathname;