diff --git a/.changeset/afraid-dingos-own.md b/.changeset/afraid-dingos-own.md
deleted file mode 100644
index 9f7010d330..0000000000
--- a/.changeset/afraid-dingos-own.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/backend-common': patch
----
-
-pass registered logger to requestLoggingHandler
diff --git a/.changeset/afraid-weeks-sort.md b/.changeset/afraid-weeks-sort.md
new file mode 100644
index 0000000000..c5ec608daf
--- /dev/null
+++ b/.changeset/afraid-weeks-sort.md
@@ -0,0 +1,7 @@
+---
+'@backstage/plugin-kubernetes': patch
+---
+
+k8s plugin now surfaces k8s components with only label selector query annotation.
+Previously backstage.io/kubernetes-label-selector catalog entity annotation would only work if you also included backstage.io/kubernetes-id.
+But backstage.io/kubernetes-id value was ignored
diff --git a/.changeset/angry-walls-mate.md b/.changeset/angry-walls-mate.md
deleted file mode 100644
index 5902168b2c..0000000000
--- a/.changeset/angry-walls-mate.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/integration': minor
----
-
-Make `ScmIntegration.resolveUrl` mandatory.
diff --git a/.changeset/blue-lions-worry.md b/.changeset/blue-lions-worry.md
deleted file mode 100644
index 911e1507b2..0000000000
--- a/.changeset/blue-lions-worry.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-sonarqube': patch
----
-
-Fix bug retrieving current theme
diff --git a/.changeset/brown-pumpkins-impress.md b/.changeset/brown-pumpkins-impress.md
deleted file mode 100644
index 5748a9860b..0000000000
--- a/.changeset/brown-pumpkins-impress.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-auth-backend': patch
----
-
-Refactored auth provider factories to accept options along with other internal refactoring of the auth providers.
diff --git a/.changeset/chilly-cars-shout.md b/.changeset/chilly-cars-shout.md
deleted file mode 100644
index 60871b07a3..0000000000
--- a/.changeset/chilly-cars-shout.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-scaffolder': patch
----
-
-Make the `TemplateCard` conform to what material-ui recommends in their examples. This fixes the extra padding around the buttons.
diff --git a/.changeset/cuddly-bags-share.md b/.changeset/cuddly-bags-share.md
deleted file mode 100644
index 6aff6a9404..0000000000
--- a/.changeset/cuddly-bags-share.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@backstage/plugin-catalog': patch
----
-
-Hide the kind of the owner if it's the default kind for the `ownedBy`
-relationship (group).
diff --git a/.changeset/dry-llamas-wave.md b/.changeset/dry-llamas-wave.md
deleted file mode 100644
index fea9b122a6..0000000000
--- a/.changeset/dry-llamas-wave.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@backstage/backend-common': patch
----
-
-Implement `UrlReader.search` for the other providers (Azure, Bitbucket, GitLab) as well.
-
-The `UrlReader` subclasses now are implemented in terms of the respective `Integration` class.
diff --git a/.changeset/eight-doors-matter.md b/.changeset/eight-doors-matter.md
deleted file mode 100644
index 7dbb56b6c3..0000000000
--- a/.changeset/eight-doors-matter.md
+++ /dev/null
@@ -1,19 +0,0 @@
----
-'@backstage/core-api': patch
-'@backstage/plugin-catalog': patch
----
-
-Minor refactoring of BackstageApp.getSystemIcons to support custom registered
-icons. Custom Icons can be added using:
-
-```tsx
-import AlarmIcon from '@material-ui/icons/Alarm';
-import MyPersonIcon from './MyPerson';
-
-const app = createApp({
- icons: {
- user: MyPersonIcon // override system icon
- alert: AlarmIcon, // Custom icon
- },
-});
-```
diff --git a/.changeset/five-guests-promise.md b/.changeset/five-guests-promise.md
deleted file mode 100644
index 1d4d0ae303..0000000000
--- a/.changeset/five-guests-promise.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-catalog': patch
----
-
-Remove the "Move repository" menu entry from the catalog page, as it's just a placeholder.
diff --git a/.changeset/fresh-seals-retire.md b/.changeset/fresh-seals-retire.md
deleted file mode 100644
index f58eebef4e..0000000000
--- a/.changeset/fresh-seals-retire.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@backstage/core-api': patch
-'@backstage/core': patch
----
-
-Export `createExternalRouteRef`, as well as give it an `id` for easier debugging, and fix parameter requirements when used with `useRouteRef`.
diff --git a/.changeset/grumpy-cups-hope.md b/.changeset/grumpy-cups-hope.md
deleted file mode 100644
index 6445c07efa..0000000000
--- a/.changeset/grumpy-cups-hope.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-user-settings': patch
----
-
-Use routed tabs to link to every settings page.
diff --git a/.changeset/hungry-frogs-flow.md b/.changeset/hungry-frogs-flow.md
new file mode 100644
index 0000000000..91a6ab0892
--- /dev/null
+++ b/.changeset/hungry-frogs-flow.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-scaffolder-backend': patch
+---
+
+Consider both authentication methods for both `onprem` and `cloud` BitBucket
diff --git a/.changeset/itchy-camels-grin.md b/.changeset/itchy-camels-grin.md
deleted file mode 100644
index eac3c6a102..0000000000
--- a/.changeset/itchy-camels-grin.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-splunk-on-call': patch
----
-
-Added splunk-on-call plugin.
diff --git a/.changeset/many-bags-sort.md b/.changeset/many-bags-sort.md
deleted file mode 100644
index dbc8df8b0c..0000000000
--- a/.changeset/many-bags-sort.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/backend-common': patch
----
-
-Support globs in `FileReaderProcessor`.
diff --git a/.changeset/mean-grapes-march.md b/.changeset/mean-grapes-march.md
deleted file mode 100644
index 6065fe0892..0000000000
--- a/.changeset/mean-grapes-march.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@backstage/backend-common': patch
-'@backstage/techdocs-common': patch
-'@backstage/plugin-scaffolder-backend': patch
----
-
-Switched to using `'x-access-token'` for authenticating Git over HTTPS towards GitHub.
diff --git a/.changeset/metal-pianos-repeat.md b/.changeset/metal-pianos-repeat.md
new file mode 100644
index 0000000000..e24320938a
--- /dev/null
+++ b/.changeset/metal-pianos-repeat.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-kubernetes': patch
+---
+
+Support AWS auth provider on kubernetes FE plugin
diff --git a/.changeset/new-mangos-tap.md b/.changeset/new-mangos-tap.md
deleted file mode 100644
index 1b57510417..0000000000
--- a/.changeset/new-mangos-tap.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/cli': patch
----
-
-Tweak error message in lockfile parsing to include more information.
diff --git a/.changeset/ninety-lemons-shake.md b/.changeset/ninety-lemons-shake.md
deleted file mode 100644
index 960a4eaffe..0000000000
--- a/.changeset/ninety-lemons-shake.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-catalog-react': patch
----
-
-Limit the props that are forwarded to the `Link` component in the `EntityRefLink`.
diff --git a/.changeset/pink-coins-sniff.md b/.changeset/pink-coins-sniff.md
deleted file mode 100644
index b9714f116a..0000000000
--- a/.changeset/pink-coins-sniff.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-'@backstage/plugin-api-docs': patch
-'@backstage/plugin-catalog': patch
-'@backstage/plugin-catalog-react': patch
----
-
-Introduce new cards to `@backstage/plugin-catalog` that can be added to entity pages:
-
-- `EntityHasSystemsCard` to display systems of a domain.
-- `EntityHasComponentsCard` to display components of a system.
-- `EntityHasSubcomponentsCard` to display subcomponents of a subcomponent.
-- In addition, `EntityHasApisCard` to display APIs of a system is added to `@backstage/plugin-api-docs`.
-
-`@backstage/plugin-catalog-react` now provides an `EntityTable` to build own cards for entities.
-The styling of the tables and new cards was also applied to the existing `EntityConsumedApisCard`,
-`EntityConsumingComponentsCard`, `EntityProvidedApisCard`, and `EntityProvidingComponentsCard`.
diff --git a/.changeset/rich-apricots-lick.md b/.changeset/rich-apricots-lick.md
deleted file mode 100644
index f9daf861d2..0000000000
--- a/.changeset/rich-apricots-lick.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-auth-backend': patch
----
-
-Fixed parsing of OIDC key timestamps when using SQLite.
diff --git a/.changeset/rich-socks-move.md b/.changeset/rich-socks-move.md
new file mode 100644
index 0000000000..5aeb3121f1
--- /dev/null
+++ b/.changeset/rich-socks-move.md
@@ -0,0 +1,6 @@
+---
+'@backstage/core-api': patch
+'@backstage/core': patch
+---
+
+Internal refactor of how component data is access to avoid polluting components and make it possible to bridge across versions.
diff --git a/.changeset/short-pots-report.md b/.changeset/short-pots-report.md
deleted file mode 100644
index 4323a957f3..0000000000
--- a/.changeset/short-pots-report.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@backstage/plugin-org': patch
----
-
-- Fixes padding in `MembersListCard`
-- Fixes email icon size in `GroupProfileCard`
-- Uniform sizing across `GroupProfileCard` and `UserProfileCard`
diff --git a/.changeset/silver-balloons-play.md b/.changeset/silver-balloons-play.md
new file mode 100644
index 0000000000..24a5c8ac46
--- /dev/null
+++ b/.changeset/silver-balloons-play.md
@@ -0,0 +1,5 @@
+---
+'@backstage/core': patch
+---
+
+Added a new useSupportConfig hook that reads a new `app.support` config key. Also updated the SupportButton and ErrorPage components to use the new config.
diff --git a/.changeset/six-elephants-poke.md b/.changeset/six-elephants-poke.md
deleted file mode 100644
index 23e575b67c..0000000000
--- a/.changeset/six-elephants-poke.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-catalog': patch
----
-
-Migrate about card to new composability API, exporting the entity cards as `EntityAboutCard`.
diff --git a/.changeset/soft-rings-obey.md b/.changeset/soft-rings-obey.md
deleted file mode 100644
index 91308bdc50..0000000000
--- a/.changeset/soft-rings-obey.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@backstage/plugin-scaffolder-backend': patch
----
-
-Fixed the `prepare` step for when using local templates that were added to the catalog using the `file:` target configuration.
-No more `EPERM: operation not permitted` error messages.
diff --git a/.changeset/spicy-pants-teach.md b/.changeset/spicy-pants-teach.md
deleted file mode 100644
index 8e16ae089e..0000000000
--- a/.changeset/spicy-pants-teach.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@backstage/plugin-catalog-react': patch
----
-
-Expose `useRelatedEntities` from `@backstage/plugin-catalog-react` to retrieve
-entities references via relations from the API.
diff --git a/.changeset/stale-ducks-sing.md b/.changeset/stale-ducks-sing.md
new file mode 100644
index 0000000000..59eb956fd0
--- /dev/null
+++ b/.changeset/stale-ducks-sing.md
@@ -0,0 +1,56 @@
+---
+'@backstage/create-app': patch
+---
+
+Migrated away from using deprecated routes and router components at top-level in the app, and instead use routable extension pages.
+
+To apply this change to an existing app, make the following changes to `packages/app/src/App.tsx`:
+
+Update imports and remove the usage of the deprecated `app.getRoutes()`.
+
+```diff
+-import { Router as DocsRouter } from '@backstage/plugin-techdocs';
++import { TechdocsPage } from '@backstage/plugin-techdocs';
+ import { CatalogImportPage } from '@backstage/plugin-catalog-import';
+-import { Router as TechRadarRouter } from '@backstage/plugin-tech-radar';
+-import { SearchPage as SearchRouter } from '@backstage/plugin-search';
+-import { Router as SettingsRouter } from '@backstage/plugin-user-settings';
++import { TechRadarPage } from '@backstage/plugin-tech-radar';
++import { SearchPage } from '@backstage/plugin-search';
++import { UserSettingsPage } from '@backstage/plugin-user-settings';
++import { ApiExplorerPage } from '@backstage/plugin-api-docs';
+ import { EntityPage } from './components/catalog/EntityPage';
+ import { scaffolderPlugin, ScaffolderPage } from '@backstage/plugin-scaffolder';
+
+
+ const AppProvider = app.getProvider();
+ const AppRouter = app.getRouter();
+-const deprecatedAppRoutes = app.getRoutes();
+```
+
+As well as update or add the following routes:
+
+```diff
+ } />
+- } />
++ } />
++ } />
+ }
++ element={}
+ />
+ } />
+- }
+- />
+- } />
+- {deprecatedAppRoutes}
++ } />
++ } />
+```
+
+If you have added additional plugins with registered routes or are using `Router` components from other plugins, these should be migrated to use the `*Page` components as well. See [this commit](https://github.com/backstage/backstage/commit/abd655e42d4ed416b70848ffdb1c4b99d189f13b) for more examples of how to migrate.
+
+For more information and the background to this change, see the [composability system migration docs](https://backstage.io/docs/plugins/composability).
diff --git a/.changeset/strange-olives-unite.md b/.changeset/strange-olives-unite.md
deleted file mode 100644
index 7490f6096a..0000000000
--- a/.changeset/strange-olives-unite.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-auth-backend': patch
----
-
-Migrated the package from using moment to Luxon. #4278
diff --git a/.changeset/stupid-maps-do.md b/.changeset/stupid-maps-do.md
deleted file mode 100644
index 1cbac64f68..0000000000
--- a/.changeset/stupid-maps-do.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/core': patch
----
-
-Export Select component
diff --git a/.changeset/sweet-experts-whisper.md b/.changeset/sweet-experts-whisper.md
new file mode 100644
index 0000000000..ca2f89ceb7
--- /dev/null
+++ b/.changeset/sweet-experts-whisper.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-auth-backend': patch
+---
+
+Expose a configuration option for the oidc scope
diff --git a/.changeset/techdocs-fast-foxes-relate.md b/.changeset/techdocs-fast-foxes-relate.md
deleted file mode 100644
index 7377946f86..0000000000
--- a/.changeset/techdocs-fast-foxes-relate.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/techdocs-common': patch
----
-
-After TechDocs generate step, insert build timestamp to techdocs_metadata.json
diff --git a/.changeset/techdocs-spotty-cooks-wait.md b/.changeset/techdocs-spotty-cooks-wait.md
deleted file mode 100644
index 9ec35b9257..0000000000
--- a/.changeset/techdocs-spotty-cooks-wait.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@backstage/techdocs-common': patch
-'@backstage/plugin-techdocs-backend': patch
----
-
-Add etag of the prepared file tree to techdocs_metadata.json in the storage
diff --git a/.changeset/thick-scissors-notice.md b/.changeset/thick-scissors-notice.md
deleted file mode 100644
index ccf78f3abf..0000000000
--- a/.changeset/thick-scissors-notice.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/core': patch
----
-
-Make sure that SidebarItems are also active when on sub route.
diff --git a/.changeset/three-pumpkins-watch.md b/.changeset/three-pumpkins-watch.md
new file mode 100644
index 0000000000..cb059a5381
--- /dev/null
+++ b/.changeset/three-pumpkins-watch.md
@@ -0,0 +1,7 @@
+---
+'@backstage/plugin-jenkins': patch
+---
+
+- Add Jenkins logo to project page.
+- Move to new Backstage breadcrumb component.
+- Change references of deprecated "Job" terminology to "Project" per [Jenkins Glossary](https://www.jenkins.io/doc/book/glossary/).
diff --git a/.changeset/tough-worms-clap.md b/.changeset/tough-worms-clap.md
deleted file mode 100644
index 3a18593549..0000000000
--- a/.changeset/tough-worms-clap.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/plugin-scaffolder-backend': patch
----
-
-Fix parsing of the path to default to empty string not undefined if git-url-parse throws something we don't expect. Fixes the error `The "path" argument must be of type string.` when preparing.
diff --git a/.changeset/twenty-pandas-crash.md b/.changeset/twenty-pandas-crash.md
new file mode 100644
index 0000000000..95ff389406
--- /dev/null
+++ b/.changeset/twenty-pandas-crash.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-catalog-react': patch
+---
+
+Fixed EntityProvider setting 'loading' bool erroneously to true
diff --git a/.changeset/violet-maps-occur.md b/.changeset/violet-maps-occur.md
deleted file mode 100644
index 112095d257..0000000000
--- a/.changeset/violet-maps-occur.md
+++ /dev/null
@@ -1,8 +0,0 @@
----
-'@backstage/core': patch
----
-
-Add support for custom empty state of `Table` components.
-
-You can now optionally pass `emptyContent` to `Table` that is displayed
-if the table has now rows.
diff --git a/.changeset/wicked-forks-sleep.md b/.changeset/wicked-forks-sleep.md
deleted file mode 100644
index 8f7f034094..0000000000
--- a/.changeset/wicked-forks-sleep.md
+++ /dev/null
@@ -1,6 +0,0 @@
----
-'@backstage/cli': patch
-'@backstage/create-app': patch
----
-
-Upgrading to lerna@4.0.0.
diff --git a/.changeset/wise-books-turn.md b/.changeset/wise-books-turn.md
deleted file mode 100644
index 77a42c5304..0000000000
--- a/.changeset/wise-books-turn.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-'@backstage/core': patch
----
-
-Add Breadcrumbs component
diff --git a/.dockerignore b/.dockerignore
index 7f7dee96c5..e34ae2c37d 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,5 +1,8 @@
.git
+docs
+cypress
+microsite
node_modules
-packages/*/node_modules
-plugins/*/node_modules
-plugins/*/dist
+packages
+!packages/backend/dist
+plugins
diff --git a/.github/codecov.yml b/.github/codecov.yml
index d39038615f..a15de165d0 100644
--- a/.github/codecov.yml
+++ b/.github/codecov.yml
@@ -1,5 +1,8 @@
comment: false # Ref: https://docs.codecov.io/docs/pull-request-comments
+ignore:
+ - '**/*.stories.*'
+
coverage:
status:
project:
diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt
index c5a0b02529..2e0bd13962 100644
--- a/.github/styles/vocab.txt
+++ b/.github/styles/vocab.txt
@@ -1,31 +1,116 @@
+Apdex
+Api
+Autoscaling
+Avro
+Balachandran
+Bigtable
+Billett
+Blackbox
+Chai
+Changesets
+Chanwit
+Codecov
+Codehilite
+Config
+Discoverability
+Dockerfile
+Dockerize
+Docusaurus
+Dominik
+Ek
+Env
+Expedia
+Figma
+Firekube
+Fiverr
+Fredrik
+Georgoulas
+GitHub
+GitLab
+Grafana
+GraphQL
+Gustavsson
+Hackathons
+Henneke
+Heroku
+Hostname
+Iain
+Ioannis
+JavaScript
+Kaewkasi
+Knex
+Kumar
+Lerna
+Lundberg
+Luxon
+Malus
+Minikube
+Mkdocs
+Monorepo
+Namespaces
+Niklas
+OAuth
+Okta
+Oldsberg
+Olle
+Onboarding
+Patrik
+Phoen
+Pomaceous
+Preprarer
+Protobuf
+Proxying
+Raghunandan
+Readme
+Recharts
+Redash
+Repo
+Rollbar
+Rollup
+Rosaceae
+Routable
+Scaffolder
+Serverless
+Sinon
+Sneha
+Snyk
+Splunk
+Spotifiers
+Spotify
+Superfences
+Talkdesk
+Telenor
+Templater
+Templaters
+Thauer
+Tolerations
+Tuite
+Voi
+WWW
+Wealthsimple
+Weaveworks
+Webpack
+Zalando
+Zhou
+Zolotusky
abc
+accessors
adamdmharvey
andrewthauer
-Apdex
api
-Api
apis
args
asciidoc
async
-Autoscaling
autoscaling
-Avro
backrub
-Balachandran
benjdlambert
-Bigtable
-Billett
-Blackbox
bool
boolean
builtins
-Chai
changeset
changesets
-Changesets
chanwit
-Chanwit
ci
cisphobia
cissexist
@@ -34,14 +119,11 @@ cli
cloudbuild
cncf
codeblocks
-Codecov
codehilite
-Codehilite
codeowners
composability
composable
config
-Config
configmaps
configs
const
@@ -56,97 +138,62 @@ devops
devs
dhenneke
discoverability
-Discoverability
dls
docgen
-Dockerfile
-Dockerize
dockerode
-Docusaurus
-Dominik
dtuite
dzolotusky
-Ek
-etag
env
-Env
esbuild
eslint
-Expedia
+etag
facto
failover
-Figma
-Firekube
-Fiverr
freben
-Fredrik
-Georgoulas
gitbeaker
-GitHub
-GitLab
-Grafana
-GraphQL
graphql
graphviz
-Gustavsson
-Hackathons
haproxy
-Henneke
-Heroku
horizontalpodautoscalers
-Hostname
hotspots
html
http
https
-Iain
img
incentivised
inlined
inlinehilite
interop
-Ioannis
-JavaScript
jq
js
json
+jsonnet
jsx
-Kaewkasi
-Knex
kubectl
kubernetes
-Kumar
learnings
lerna
-Lerna
lockfile
-Luxon
magiclink
mailto
maintainership
-Malus
md
microsite
middleware
minikube
-Minikube
misconfiguration
misconfigured
misgendering
mkdocs
-Mkdocs
monorepo
-Monorepo
monorepos
msw
namespace
namespaces
-Namespaces
namespacing
neuro
newrelic
nginx
-Niklas
nodegit
nohoist
nonces
@@ -154,49 +201,31 @@ noop
npm
nvarchar
nvm
-OAuth
octokit
oidc
-Okta
-Oldsberg
onboarding
-Onboarding
pagerduty
+pageview
parallelization
-Patrik
-Phoen
plantuml
-Pomaceous
postgres
postpack
pre
prebaked
preconfigured
prepack
-Preprarer
productional
-Protobuf
proxying
-Proxying
pygments
pymdownx
-Raghunandan
rankdir
readme
-Readme
-Recharts
-Redash
replicasets
repo
-Repo
repos
rerender
rollbar
-Rollbar
-Rollup
-Rosaceae
routable
-Routable
rst
rsync
rugvip
@@ -204,19 +233,11 @@ ruleset
sam
scaffolded
scaffolder
-Scaffolder
semlas
semver
-Serverless
-Sinon
-Sneha
-Snyk
sourcemaps
sparklines
-Splunk
-Spotifiers
spotify
-Spotify
sqlite
squidfunk
src
@@ -227,30 +248,22 @@ subcomponents
subkey
subtree
superfences
-Superfences
superset
talkdesk
-Talkdesk
tasklist
techdocs
-Telenor
templated
templater
-Templater
templaters
-Templaters
-Thauer
toc
tolerations
-Tolerations
toolchain
toolsets
tooltip
tooltips
touchpoints
-transpiled
transpilation
-Tuite
+transpiled
ui
unmanaged
unregister
@@ -260,16 +273,8 @@ url
utils
validators
varchar
-Voi
-Wealthsimple
-Weaveworks
-Webpack
winston
www
-WWW
xyz
yaml
-Zalando
-Zhou
-Zolotusky
zoomable
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 08ec67162b..2337a70e2c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -87,7 +87,7 @@ jobs:
- name: build changed packages
if: ${{ steps.yarn-lock.outcome == 'success' }}
- run: yarn lerna -- run build --since origin/master
+ run: yarn lerna -- run build --since origin/master --include-dependencies
- name: build all packages
if: ${{ steps.yarn-lock.outcome == 'failure' }}
diff --git a/ADOPTERS.md b/ADOPTERS.md
index 363c092198..d76e24ef04 100644
--- a/ADOPTERS.md
+++ b/ADOPTERS.md
@@ -19,3 +19,4 @@
| [LegalZoom](https://legalzoom.com) | [@backjo](https://github.com/backjo) | Developer portal - hub for all engineering projects and metadata. |
| [Expedia Group](https://www.expediagroup.com) | [Mike Turner](mailto:miturner@expediagroup.com), [Sneha Kumar](mailto:snkumar@expediagroup.com), [@guillermomanzo](https://github.com/guillermomanzo) | EG Common Developer Toolkit |
| [Paddle.com](https://paddle.com) | [Ioannis Georgoulas](https://github.com/geototti21) | Developer portal (Tech Docs, Service Catalog, Internal Tooling), we use vanilla Backstage FE and custom BE implementation in Go |
+| [Acast.com](https://acast.com) | [Olle Lundberg](https://github.com/lndbrg) | Developer portal with tech docs, service catalog and a bunch of other internal tooling |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d163a42954..ddc5449cd8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -66,7 +66,7 @@ Have you started using Backstage? Adding your company to [ADOPTERS](ADOPTERS.md)
So...feel ready to jump in? Let's do this. 👏🏻💯
-Start by reading our [Getting Started](https://backstage.io/docs/getting-started/) page. If you need help, just jump into our [Discord chatroom](https://discord.gg/MUpMjP2).
+Start by reading our [Getting Started for Contributors](https://backstage.io/docs/getting-started/contributors) page to get yourself setup with a fresh copy of Backstage ready for your contributions. If you need help, just jump into our [Discord chatroom](https://discord.gg/MUpMjP2).
## Coding Guidelines
diff --git a/app-config.yaml b/app-config.yaml
index 672ba26cd2..f68f5a30a2 100644
--- a/app-config.yaml
+++ b/app-config.yaml
@@ -2,6 +2,19 @@ app:
title: Backstage Example App
baseUrl: http://localhost:3000
googleAnalyticsTrackingId: # UA-000000-0
+ support:
+ url: https://github.com/backstage/backstage/issues # Used by common ErrorPage
+ items: # Used by common SupportButton component
+ - title: Issues
+ icon: github
+ links:
+ - url: https://github.com/backstage/backstage/issues
+ title: GitHub Issues
+ - title: Discord Chatroom
+ icon: chat
+ links:
+ - url: https://discord.gg/MUpMjP2
+ title: '#backstage'
backend:
baseUrl: http://localhost:7000
diff --git a/docs/api/utility-apis.md b/docs/api/utility-apis.md
index 5b5656f1b1..308544e0f1 100644
--- a/docs/api/utility-apis.md
+++ b/docs/api/utility-apis.md
@@ -181,7 +181,25 @@ The `IgnoringErrorApi` would then be imported in the app, and wired up like
this:
```ts
-builder.add(errorApiRef, new IgnoringErrorApi());
+const app = createApp({
+ apis: [
+ /* ApiFactories */
+ createApiFactory(errorApiRef, new IgnoringErrorApi()),
+
+ // OR
+ // If your API has dependencies, you use the object form
+ createApiFactory({
+ api: errorApiRef,
+ deps: { configApi: configApiRef },
+ factory({ configApi }) {
+ return new IgnoringErrorApi({
+ reportingUrl: configApi.getString('error.reportingUrl'),
+ });
+ },
+ }),
+ ],
+ // ... other options
+});
```
Note that the above line will cause an error if `IgnoreErrorApi` does not fully
diff --git a/docs/cli/commands.md b/docs/cli/commands.md
index 562604db97..46cca46f78 100644
--- a/docs/cli/commands.md
+++ b/docs/cli/commands.md
@@ -24,7 +24,6 @@ Below is a cleaned up output of `yarn backstage-cli --help`.
```text
app:build Build an app for a production release
-app:diff Diff an existing app with the creation template
app:serve Serve an app for local development
backend:build Build a backend plugin
@@ -113,25 +112,6 @@ Options:
-h, --help display help for command
```
-## app:diff
-
-Scope: `app`
-
-Diff an existing app with the template used in `@backstage/create-app`. This
-will verify that your app package has not diverged from the template, and can be
-useful to run after updating the version of `@backstage/cli` in your app.
-
-This command is experimental and may be removed in the future.
-
-```text
-Usage: backstage-cli app:diff
-
-Options:
- --check Fail if changes are required
- --yes Apply all changes
- -h, --help display help for command
-```
-
## app:serve
Scope: `app`
@@ -207,15 +187,15 @@ The following is an example of a `Dockerfile` that can be used to package the
output of `backstage-cli backend:bundle` into an image:
```Dockerfile
-FROM node:14-buster
+FROM node:14-buster-slim
WORKDIR /app
ADD yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
-RUN yarn install --production --network-timeout 600000 && rm -rf "$(yarn cache dir)"
+RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
ADD packages/backend/dist/bundle.tar.gz app-config.yaml ./
-CMD node packages/backend
+CMD ["node", "packages/backend"]
```
```text
diff --git a/docs/dls/design.md b/docs/dls/design.md
index 3bf283b77f..042312d0a3 100644
--- a/docs/dls/design.md
+++ b/docs/dls/design.md
@@ -33,15 +33,18 @@ our users.
### Transparent
There are a lot of exciting things coming up and we want to keep you in the
-loop! Keep an eye on our Milestones in GitHub to see where we’re headed. We’ll
-also be posting updates in the _#design_ channel on
-[Discord](https://discord.gg/EBHEGzX). Not only that, we want to keep you
-informed on the decisions we’ve made and why we’ve made them.
+loop! Keep an eye on our
+[Milestones in GitHub](https://github.com/backstage/backstage/milestones) to see
+where we're headed and review the
+[open design issues](https://github.com/backstage/backstage/issues?q=is%3Aopen+is%3Aissue+label%3Adesign),
+to see if you can help. We'll also be posting updates in the _#design_ channel
+on [Discord](https://discord.gg/EBHEGzX). Not only that, we want to keep you
+informed on the decisions we've made and why we've made them.
## 🛠 Our Practice
-The chart below details how we work. **_Stay tuned_**: We are currently in the
-process of securing a Figma workspace for Backstage Open Source, and we plan on
+The chart below details how we work. We have a
+[Figma workspace for Backstage Open Source](figma.md), and we plan on
referencing Figma documents to share specs and prototypes with the community.
### Creating a New Design Component
diff --git a/docs/features/software-catalog/installation.md b/docs/features/software-catalog/installation.md
index b2afd62878..ae8c671ed1 100644
--- a/docs/features/software-catalog/installation.md
+++ b/docs/features/software-catalog/installation.md
@@ -30,33 +30,59 @@ it doesn't.
Add the following entry to the head of your `packages/app/src/plugins.ts`:
```ts
-export { plugin as CatalogPlugin } from '@backstage/plugin-catalog';
+export { catalogPlugin } from '@backstage/plugin-catalog';
```
-Add the following to your `packages/app/src/apis.ts`:
+Next we need to install the two pages that the catalog plugin provides. You can
+choose any name for these routes, but we recommend the following:
+
+```tsx
+import {
+ catalogPlugin,
+ CatalogIndexPage,
+ CatalogEntityPage,
+} from '@backstage/plugin-catalog';
+
+// Add to the top-level routes, directly within
+} />
+}>
+ {/*
+ This is the root of the custom entity pages for your app, refer to the example app
+ in the main repo or the output of @backstage/create-app for an example
+ */}
+
+
+```
+
+The catalog plugin also has one external route that needs to be bound for it to
+function: the `createComponent` route which should link to the page where the
+user can create components. In a typical setup the create component route will
+be linked to the Scaffolder plugin's template index page:
```ts
-import { catalogApiRef, CatalogClient } from '@backstage/plugin-catalog';
+import { catalogPlugin } from '@backstage/plugin-catalog';
+import { scaffolderPlugin } from '@backstage/plugin-scaffolder';
-// Inside the ApiRegistry builder function ...
-
-builder.add(
- catalogApiRef,
- new CatalogClient({
- apiOrigin: backendUrl,
- basePath: '/catalog',
- }),
-);
+const app = createApp({
+ // ...
+ bindRoutes({ bind }) {
+ bind(catalogPlugin.externalRoutes, {
+ createComponent: scaffolderPlugin.routes.root,
+ });
+ },
+});
```
-Where `backendUrl` is the `backend.baseUrl` from config, i.e.
-`const backendUrl = config.getString('backend.baseUrl')`.
+You may also want to add a link to the catalog index page to your sidebar:
-The catalog components depend on a number of other
-[Utility APIs](../../api/utility-apis.md) to function, including at least the
-`ErrorApi` and `StorageApi`. You can find an example of how to install these in
-your app
-[here](https://github.com/backstage/backstage/blob/61c3a7e5b750dc7c059ef16b188594d31b2c04c2/packages/app/src/apis.ts#L80).
+```tsx
+import HomeIcon from '@material-ui/icons/Home';
+
+// Somewhere within the
+;
+```
+
+This is all that is needed for the frontend part of the Catalog plugin to work!
## Gotchas that we will fix
diff --git a/docs/features/software-catalog/well-known-annotations.md b/docs/features/software-catalog/well-known-annotations.md
index 2cbb829554..8ec4813799 100644
--- a/docs/features/software-catalog/well-known-annotations.md
+++ b/docs/features/software-catalog/well-known-annotations.md
@@ -70,6 +70,35 @@ The value of this annotation is a location reference string (see above). If this
annotation is specified, it is expected to point to a repository that the
TechDocs system can read and generate docs from.
+### backstage.io/view-url, backstage.io/edit-url
+
+```yaml
+# Example:
+metadata:
+ annotations:
+ backstage.io/view-url: https://some.website/catalog-info.yaml
+ backstage.io/edit-url: https://github.com/my-org/catalog/edit/master/my-service.jsonnet
+```
+
+These annotations allow customising links from the catalog pages. The view URL
+should point to the canonical metadata YAML that governs this entity. The edit
+URL should point to the source file for the metadata. In the example above,
+`my-org` generates its catalog data from Jsonnet files in a monorepo, so the
+view and edit links need changing.
+
+### backstage.io/source-location
+
+```yaml
+# Example:
+metadata:
+ annotations:
+ backstage.io/source-location: github:https://github.com/my-org/my-service
+```
+
+A `Location` reference that points to the source code of the entity (typically a
+`Component`). Useful when catalog files do not get ingested from the source code
+repository itself.
+
### jenkins.io/github-folder
```yaml
diff --git a/docs/features/software-templates/installation.md b/docs/features/software-templates/installation.md
index 8d2fa7727d..9aa1d3bc8f 100644
--- a/docs/features/software-templates/installation.md
+++ b/docs/features/software-templates/installation.md
@@ -33,27 +33,27 @@ it doesn't.
Add the following entry to the head of your `packages/app/src/plugins.ts`:
```ts
-export { plugin as ScaffolderPlugin } from '@backstage/plugin-scaffolder';
+export { scaffolderPlugin } from '@backstage/plugin-scaffolder';
```
-Add the following to your `packages/app/src/apis.ts`:
+Next we need to install the root page that the Scaffolder plugin provides. You
+can choose any path for the route, but we recommend the following:
-```ts
-import { scaffolderApiRef, ScaffolderApi } from '@backstage/plugin-scaffolder';
+```tsx
+import { ScaffolderPage } from '@backstage/plugin-scaffolder';
-// Inside the ApiRegistry builder function ...
-
-builder.add(
- scaffolderApiRef,
- new ScaffolderApi({
- apiOrigin: backendUrl,
- basePath: '/scaffolder/v1',
- }),
-);
+// Add to the top-level routes, directly within
+} />;
```
-Where `backendUrl` is the `backend.baseUrl` from config, i.e.
-`const backendUrl = config.getString('backend.baseUrl')`.
+You may also want to add a link to the template index page to your sidebar:
+
+```tsx
+import CreateComponentIcon from '@material-ui/icons/AddCircleOutline';
+
+// Somewhere within the
+;
+```
This is all that is needed for the frontend part of the Scaffolder plugin to
work!
@@ -85,29 +85,25 @@ following contents to get you up and running quickly.
import {
CookieCutter,
createRouter,
- FilePreparer,
- GithubPreparer,
- GitlabPreparer,
Preparers,
Publishers,
- GithubPublisher,
- GitlabPublisher,
CreateReactAppTemplater,
Templaters,
- RepoVisibilityOptions,
} from '@backstage/plugin-scaffolder-backend';
-import { Octokit } from '@octokit/rest';
-import { Gitlab } from '@gitbeaker/node';
+import { SingleHostDiscovery } from '@backstage/backend-common';
import type { PluginEnvironment } from '../types';
import Docker from 'dockerode';
+import { CatalogClient } from '@backstage/catalog-client';
export default async function createPlugin({
logger,
config,
+ database,
}: PluginEnvironment) {
const cookiecutterTemplater = new CookieCutter();
const craTemplater = new CreateReactAppTemplater();
const templaters = new Templaters();
+
templaters.register('cookiecutter', cookiecutterTemplater);
templaters.register('cra', craTemplater);
@@ -115,12 +111,19 @@ export default async function createPlugin({
const publishers = await Publishers.fromConfig(config, { logger });
const dockerClient = new Docker();
+
+ const discovery = SingleHostDiscovery.fromConfig(config);
+ const catalogClient = new CatalogClient({ discoveryApi: discovery });
+
return await createRouter({
preparers,
templaters,
publishers,
logger,
+ config,
dockerClient,
+ database,
+ catalogClient,
});
}
```
diff --git a/docs/features/techdocs/using-cloud-storage.md b/docs/features/techdocs/using-cloud-storage.md
index de2d505c87..cd4b058644 100644
--- a/docs/features/techdocs/using-cloud-storage.md
+++ b/docs/features/techdocs/using-cloud-storage.md
@@ -142,6 +142,8 @@ variables**
You should follow the
[AWS security best practices guide for authentication](https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html).
+TechDocs needs access to read files and metadata of the S3 bucket.
+
If the environment variables
- `AWS_ACCESS_KEY_ID`
@@ -149,15 +151,21 @@ If the environment variables
- `AWS_REGION`
are set and can be used to access the bucket you created in step 2, they will be
-used by the AWS SDK v3 Node.js client for authentication.
-[Refer to the official documentation.](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html)
+used by the AWS SDK V2 Node.js client for authentication.
+[Refer to the official documentation for loading credentials in Node.js from environment variables](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-environment.html).
If the environment variables are missing, the AWS SDK tries to read the
`~/.aws/credentials` file for credentials.
-[Refer to the official documentation.](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html)
+[Refer to the official documentation.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html)
-Note that the region of the bucket has to be set for the AWS SDK to work.
-[See this](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html).
+If you are using Amazon EC2 instance to deploy Backstage, you do not need to
+obtain the access keys separately. They can be made available in the environment
+automatically by defining appropriate IAM role with access to the bucket. Read
+more in
+[official AWS documentation for using IAM roles.](https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html#use-roles).
+
+The AWS Region of the bucket is optional since TechDocs uses AWS SDK V2 and not
+V3.
**3b. Authentication using app-config.yaml**
@@ -181,13 +189,28 @@ techdocs:
```
Refer to the
-[official AWS documentation for obtaining the credentials](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-your-credentials.html).
+[official AWS documentation for obtaining the credentials](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html).
-Note: If you are using Amazon EC2 instance to deploy Backstage, you do not need
-to obtain the access keys separately. They can be made available in the
-environment automatically by defining appropriate IAM role with access to the
-bucket. Read more
-[here](https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html#use-roles).
+**3c. Authentication using an assumed role** Users with multiple AWS accounts
+may want to use a role for S3 storage that is in a different AWS account. Using
+the `roleArn` parameter as seen below, you can instruct the TechDocs publisher
+to assume a role before accessing S3.
+
+```yaml
+techdocs:
+ publisher:
+ type: 'awsS3'
+ awsS3:
+ bucketName: 'name-of-techdocs-storage-bucket'
+ region:
+ $env: AWS_REGION
+ credentials:
+ roleArn: arn:aws:iam::123456789012:role/my-backstage-role
+```
+
+Note: Assuming a role requires that primary credentials are already configured
+at `AWS.config.credentials`. Read more about
+[assuming roles in AWS](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html).
**4. That's it!**
diff --git a/docs/getting-started/development-environment.md b/docs/getting-started/contributors.md
similarity index 71%
rename from docs/getting-started/development-environment.md
rename to docs/getting-started/contributors.md
index 01fd7bdc24..a0c3f3dc4c 100644
--- a/docs/getting-started/development-environment.md
+++ b/docs/getting-started/contributors.md
@@ -1,6 +1,6 @@
---
-id: development-environment
-title: Development Environment
+id: contributors
+title: Contributors
# prettier-ignore
description: Documentation on how to get set up for doing development on the Backstage repository
---
@@ -10,6 +10,21 @@ repository.
## Cloning the Repository
+Ok. So you're gonna want some code right? Go ahead and fork the repository into
+your own GitHub account and clone that code to your local machine or you can
+grab the one for the origin like so:
+
+```bash
+git clone git@github.com/backstage/backstage --depth 1
+```
+
+If you cloned a fork, you can add the upstream dependency like so:
+
+```bash
+git remote add upstream git@github.com:backstage/backstage
+git pull upstream master
+```
+
After you have cloned the Backstage repository, you should run the following
commands once to set things up for development:
@@ -25,9 +40,11 @@ Open a terminal window and start the web app by using the following command from
the project root. Make sure you have run the above mentioned commands first.
```bash
-$ yarn start
+$ yarn dev
```
+This is going to start two things, the frontend (:3000) and the backend (:7000).
+
This should open a local instance of Backstage in your browser, otherwise open
one of the URLs printed in the terminal.
@@ -38,12 +55,27 @@ setting an environment variable `PORT` on your local machine. e.g.
Once successfully started, you should see the following message in your terminal
window:
+```sh
+$ concurrently "yarn start" "yarn start-backend"
+$ yarn workspace example-app start
+$ yarn workspace example-backend start
+$ backstage-cli app:serve
+$ backstage-cli backend:dev
+[0] Loaded config from app-config.yaml
+[1] Build succeeded
+[0] ℹ 「wds」: Project is running at http://localhost:3000/
+[0] ℹ 「wds」: webpack output is served from /
+[0] ℹ 「wds」: Content not from webpack is served from $BACKSTAGE_DIR/packages/app/public
+[0] ℹ 「wds」: 404s will fallback to /index.html
+[0] ℹ 「wdm」: wait until bundle finished: /
+[1] 2021-02-12T20:58:17.614Z backstage info Loaded config from app-config.yaml
```
-You can now view example-app in the browser.
- Local: http://localhost:8080
- On Your Network: http://192.168.1.224:8080
-```
+You'll see how you get both logs for the frontend `webpack-dev-server` which
+serves the react app ([0]) and the backend ([1]);
+
+Visit http://localhost:3000 and you should see the bleeding edge of Backstage
+ready for contributions!
## Editor
diff --git a/docs/getting-started/create-an-app.md b/docs/getting-started/create-an-app.md
index 0663d3faa1..9abb68d21b 100644
--- a/docs/getting-started/create-an-app.md
+++ b/docs/getting-started/create-an-app.md
@@ -177,20 +177,6 @@ the root directory:
yarn workspace backend start
```
+Now you're free to hack away on your own Backstage installation!
+
### Troubleshooting
-
-#### Cannot find module
-
-You may encounter an error similar to below:
-
-```
-internal/modules/cjs/loader.js:968
- throw err;
- ^
-
-Error: Cannot find module '../build/Debug/nodegit.node'
-```
-
-This can occur if an npm dependency is not completely installed. Because some
-dependencies run a post-install script, ensure that both your npm and yarn
-configs have the `ignore-scripts` flag set to `false`.
diff --git a/docs/getting-started/deployment-docker.md b/docs/getting-started/deployment-docker.md
new file mode 100644
index 0000000000..69158f9104
--- /dev/null
+++ b/docs/getting-started/deployment-docker.md
@@ -0,0 +1,238 @@
+---
+id: deployment-docker
+title: Docker
+description: Documentation on how to deploy Backstage as a Docker image
+---
+
+This section describes how to build a Backstage App into a deployable Docker
+image. It is split into three sections, first covering the host build approach,
+which is recommended due its speed and more efficient and often simpler caching.
+The second section covers a full multi-stage Docker build, and the last section
+covers how to split frontend content into a separate image.
+
+Something that goes for all of these docker deployment strategies is that they
+are stateless, so for a production deployment you will want to set up and
+connect to an external PostgreSQL instance where the backend plugins can store
+their state, rather than using SQLite.
+
+### Host Build
+
+This section describes how to build a Docker image from a Backstage repo with
+most of the build happening outside of Docker. This is almost always the faster
+approach, as the build steps tend to execute faster, and it's possible to have
+more efficient caching of dependencies on the host, where a single change won't
+bust the entire cache.
+
+The required steps in the host build are to install dependencies with
+`yarn install`, generate type definitions using `yarn tsc`, and build all
+packages with `yarn build`.
+
+> NOTE: Using `yarn build` to build packages and bundle the backend assumes that
+> you have migrated to using `backstage-cli backend:bundle` as your build script
+> in the backend package.
+
+In a CI workflow it might look something like this:
+
+```bash
+yarn install --frozen-lockfile
+
+# tsc outputs type definitions to dist-types/ in the repo root, which are then consumed by the build
+yarn tsc
+
+# Build all packages and in the end bundle them all up into the packages/backend/dist folder.
+yarn build
+```
+
+Once the host build is complete, we are ready to build our image. We use the
+following `Dockerfile`, which is also included when creating a new app with
+`@backstage/create-app`:
+
+```Dockerfile
+# This dockerfile builds an image for the backend package.
+# It should be executed with the root of the repo as docker context.
+#
+# Before building this image, be sure to have run the following commands in the repo root:
+#
+# yarn install
+# yarn tsc
+# yarn build
+#
+# Once the commands have been run, you can build the image using `yarn build-image`
+
+FROM node:14-buster-slim
+
+WORKDIR /app
+
+# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
+# The skeleton contains the package.json of each package in the monorepo,
+# and along with yarn.lock and the root package.json, that's enough to run yarn install.
+ADD yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
+
+RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
+
+# Then copy the rest of the backend bundle, along with any other files we might want.
+ADD packages/backend/dist/bundle.tar.gz app-config.yaml ./
+
+CMD ["node", "packages/backend", "--config", "app-config.yaml"]
+```
+
+For more details on how the `backend:bundle` command and the `skeleton.tar.gz`
+file works, see the
+[`backend:bundle` command docs](../cli/commands.md#backendbundle)
+
+The `Dockerfile` is typically placed at `packages/backend/Dockerfile`, but needs
+to be executed with the root of the repo as the build context, in order to get
+access to the root `yarn.lock` and `package.json`, along with any other files
+that might be needed, such as `.npmrc`.
+
+In order to speed up the build we can significantly reduce the build context
+size using the following `.dockerignore` in the root of the repo:
+
+```text
+.git
+node_modules
+packages
+!packages/backend/dist
+plugins
+```
+
+With the project build and the `.dockerignore` and `Dockerfile` in place, we are
+now ready to build the final image. Assuming we're at the root of the repo, we
+execute the build like this:
+
+```bash
+docker image build . -f packages/backend/Dockerfile --tag backstage
+```
+
+To try out the image locally you can run the following:
+
+```sh
+docker run -it -p 7000:7000 backstage
+```
+
+You should then start to get logs in your terminal, and then you can open your
+browser at `http://localhost:7000`
+
+### Multistage Build
+
+This section describes how to set up a multi-stage Docker build that builds the
+entire project within Docker. This is typically slower than a host build, but is
+sometimes desired because Docker in Docker is not available in the build
+environment, or due to other requirements.
+
+The build is split into three different stages, where the first stage finds all
+of the `package.json`s that are relevant for the initial install step enabling
+us to cache the initial `yarn install` that installs all dependencies. The
+second stage executes the build itself, and is similar to the steps we execute
+on the host in the host build. The third and final stage then packages it all
+together into the final image, and is similar to the `Dockerfile` of the host
+build.
+
+The following `Dockerfile` executes the multi-stage build and should be added to
+the repo root:
+
+```Dockerfile
+# Stage 1 - Create yarn install skeleton layer
+FROM node:14-buster-slim AS packages
+
+WORKDIR /app
+COPY package.json yarn.lock ./
+
+COPY packages packages
+COPY plugins plugins
+
+RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -exec rm -rf {} \+
+
+# Stage 2 - Install dependencies and build packages
+FROM node:14-buster-slim AS build
+
+WORKDIR /app
+COPY --from=packages /app .
+
+RUN yarn install --frozen-lockfile --network-timeout 600000 && rm -rf "$(yarn cache dir)"
+
+COPY . .
+
+RUN yarn tsc
+RUN yarn --cwd packages/backend backstage-cli backend:bundle --build-dependencies
+
+# Stage 3 - Build the actual backend image and install production dependencies
+FROM node:14-buster-slim
+
+WORKDIR /app
+
+# Copy the install dependencies from the build stage and context
+COPY --from=build /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton.tar.gz ./
+RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
+
+RUN yarn install --frozen-lockfile --production --network-timeout 600000 && rm -rf "$(yarn cache dir)"
+
+# Copy the built packages from the build stage
+COPY --from=build /app/packages/backend/dist/bundle.tar.gz .
+RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
+
+# Copy any other files that we need at runtime
+COPY app-config.yaml ./
+
+CMD ["node", "packages/backend", "--config", "app-config.yaml"]
+```
+
+Note that a newly created Backstage app will typically not have a `plugins/`
+folder, so you will want to comment that line out. This build also does not work
+in the main repo, since the `backstage-cli` which is used for the build doesn't
+end up being properly installed.
+
+To speed up the build when not running in a fresh clone of the repo you should
+set up a `.dockerignore`. This one is different than the host build one, because
+we want to have access to the source code of all packages for the build, but can
+ignore any existing build output or dependencies:
+
+```text
+node_modules
+packages/*/dist
+packages/*/node_modules
+plugins/*/dist
+plugins/*/node_modules
+```
+
+Once you have added both the `Dockerfile` and `.dockerignore` to the root of
+your project, run the following to build the container under a specified tag.
+
+```sh
+docker image build -t backstage .
+```
+
+To try out the image locally you can run the following:
+
+```sh
+docker run -it -p 7000:7000 backstage
+```
+
+You should then start to get logs in your terminal, and then you can open your
+browser at `http://localhost:7000`
+
+### Separate Frontend
+
+It is sometimes desirable to serve the frontend separately from the backend,
+either from a separate image or for example a static file serving provider. The
+first step in doing so is to remove the `app-backend` plugin from the backend
+package, which is done as follows:
+
+1. Delete `packages/backend/src/plugins/app.ts`
+2. Remove the following lines from `packages/backend/src/index.ts`:
+ ```tsx
+ import app from './plugins/app';
+ // ...
+ const appEnv = useHotMemoize(module, () => createEnv('app'));
+ // ...
+ .addRouter('', await app(appEnv));
+ ```
+3. Remove the `@backstage/plugin-app-backend` and the app package dependency
+ (e.g. `app`) from `packages/backend/packages.json`. If you don't remove the
+ app package dependency the app will still be built and bundled with the
+ backend.
+
+Once the `app-backend` is removed from the backend, you can use your favorite
+static file serving method for serving the frontend. An example of how to set up
+an NGINX image is available in the
+[contrib folder in the main repo](https://github.com/backstage/backstage/blob/master/contrib/docker/frontend-with-nginx/Dockerfile)
diff --git a/docs/getting-started/deployment-other.md b/docs/getting-started/deployment-other.md
index e92b54d08b..cc622d00f5 100644
--- a/docs/getting-started/deployment-other.md
+++ b/docs/getting-started/deployment-other.md
@@ -4,98 +4,6 @@ title: Other
description: Documentation on different ways of Deployment
---
-## Docker
-
-Here we have an example Dockerfile that you can use to build everything together
-in one container. This Dockerfile uses multi-stage builds, and a
-`backend:bundle` command from the CLI.
-
-It also provides caching on the `yarn install`'s so that you don't have to do it
-unless absolutely necessary.
-
-> Note: This Dockerfile assumes that you're running SQLite, or your
-> configuration is setup to connect to an external PostgreSQL Database.
-
-```Dockerfile
-# Stage 1 - Create yarn install skeleton layer
-FROM node:14-buster AS packages
-
-WORKDIR /app
-COPY package.json yarn.lock ./
-
-COPY packages packages
-
-# Uncomment this line if you have a local plugins folder
-# COPY plugins plugins
-
-RUN find packages \! -name "package.json" -mindepth 2 -maxdepth 2 -print | xargs rm -rf
-
-# Stage 2 - Install dependencies and build packages
-FROM node:14-buster AS build
-
-WORKDIR /app
-COPY --from=packages /app .
-
-RUN yarn install --network-timeout 600000 && rm -rf "$(yarn cache dir)"
-
-COPY . .
-
-RUN yarn tsc
-RUN yarn --cwd packages/backend backstage-cli backend:bundle --build-dependencies
-
-# Stage 3 - Build the actual backend image and install production dependencies
-FROM node:14-buster
-
-WORKDIR /app
-
-# Copy from build stage
-COPY --from=build /app/yarn.lock /app/package.json /app/packages/backend/dist/skeleton.tar.gz ./
-RUN tar xzf skeleton.tar.gz && rm skeleton.tar.gz
-
-RUN yarn install --production --network-timeout 600000 && rm -rf "$(yarn cache dir)"
-
-COPY --from=build /app/packages/backend/dist/bundle.tar.gz .
-RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
-
-COPY app-config.yaml app-config.production.yaml ./
-
-CMD ["node", "packages/backend", "--config", "app-config.yaml", "--config", "app-config.production.yaml"]
-```
-
-Before building you should also include a `.dockerignore`. This will greatly
-improve the context boot up time of Docker as we are no longer sending all of
-the `node_modules` into the context. It also helps us avoid some limitations and
-errors that may occur when trying to share the `node_modules` folder to inside
-the build.
-
-You can add the following contents to the root of your repository at
-`.dockerignore` and it might look something like the following:
-
-```dockerignore
-.git
-node_modules
-packages/*/node_modules
-plugins/*/node_modules
-plugins/*/dist
-```
-
-Once you have added both the `Dockerfile` and `.dockerignore` to the root of
-your project, and run the following to build the container under a specified
-tag.
-
-```sh
-$ docker build -t example-deployment .
-```
-
-To run the image locally you can run:
-
-```sh
-$ docker run -it -p 7000:7000 example-deployment
-```
-
-You should then start to get logs in your terminal, and then you can open your
-browser at `http://localhost:7000`
-
## Heroku
Deploying to Heroku is relatively easy following these steps.
diff --git a/docs/getting-started/index.md b/docs/getting-started/index.md
index 16c837d676..b946039dfb 100644
--- a/docs/getting-started/index.md
+++ b/docs/getting-started/index.md
@@ -19,7 +19,7 @@ general, it's easier to fork and clone this project. That will let you stay up
to date with the latest changes, and gives you an easier path to make Pull
Requests towards this repo.
-### Creating a Standalone App
+### Create your Backstage App
Backstage provides the `@backstage/create-app` package to scaffold standalone
instances of Backstage. You will need to have
@@ -46,8 +46,3 @@ look something like this. You can read more about this process in
You can read more in our
[CONTRIBUTING](https://github.com/backstage/backstage/blob/master/CONTRIBUTING.md)
guide, which can help you get setup with a Backstage development environment.
-
-### Next steps
-
-Take a look at the [Running Backstage Locally](./running-backstage-locally.md)
-guide to learn how to set up Backstage, and how to develop on the platform.
diff --git a/docs/getting-started/running-backstage-locally.md b/docs/getting-started/running-backstage-locally.md
index 6de9d234e3..fe68937c4e 100644
--- a/docs/getting-started/running-backstage-locally.md
+++ b/docs/getting-started/running-backstage-locally.md
@@ -104,7 +104,6 @@ The value of Backstage grows with every new plugin that gets added. Here is a
collection of tutorials that will guide you through setting up and extending an
instance of Backstage with your own plugins.
-- [Development Environment](development-environment.md)
- [Create a Backstage Plugin](../plugins/create-a-plugin.md)
- [Structure of a Plugin](../plugins/structure-of-a-plugin.md)
- [Utility APIs](../api/utility-apis.md)
diff --git a/docs/integrations/github/org.md b/docs/integrations/github/org.md
new file mode 100644
index 0000000000..848a306381
--- /dev/null
+++ b/docs/integrations/github/org.md
@@ -0,0 +1,71 @@
+---
+id: org
+title: GitHub Organizational Data
+sidebar_label: Org Data
+# prettier-ignore
+description: Setting up ingestion of organizational data from GitHub
+---
+
+The Backstage catalog can be set up to ingest organizational data - teams and
+users - directly from an organization in GitHub or GitHub Enterprise. The result
+is a hierarchy of
+[`User`](../../features/software-catalog/descriptor-format.md#kind-user) and
+[`Group`](../../features/software-catalog/descriptor-format.md#kind-group) kind
+entities that mirror your org setup.
+
+## Installation
+
+The processor that performs the import, `GithubOrgReaderProcessor`, comes
+installed with the default setup of Backstage.
+
+If you replace the set of processors in your installation using that facility of
+the catalog builder class, you can import and add it as follows.
+
+```ts
+// Typically in packages/backend/src/plugins/catalog.ts
+import { GithubOrgReaderProcessor } from '@backstage/plugin-catalog-backend';
+
+builder.replaceProcessors(
+ GithubOrgReaderProcessor.fromConfig(config, { logger }),
+ // ...
+);
+```
+
+## Configuration
+
+The following configuration enables an import of the teams and users under the
+org `https://github.com/my-org-name` on public GitHub.
+
+```yaml
+catalog:
+ locations:
+ - type: github-org
+ target: https://github.com/my-org-name
+ processors:
+ githubOrg:
+ providers:
+ - target: https://github.com
+ apiBaseUrl: https://api.github.com
+ token:
+ $env: GITHUB_TOKEN
+```
+
+Locations point out the specific org(s) you want to import. The `type` of these
+locations must be `github-org`, and the `target` must point to the exact URL of
+some organization. You can have several such location entries if you want, but
+typically you will have just one.
+
+The processor itself is configured in the other block, under
+`catalog.processors.githubOrg`. There may be many providers, each targeting a
+specific `target` which is supposed to be the address of the home page of GitHub
+or your GitHub Enterprise installation.
+
+The example above assumes that the backend is started with an environment
+variable called `GITHUB_TOKEN` that contains a Personal Access Token. The token
+needs to have at least the scopes `read:org`, `read:user`, and `user:email` in
+the given `target`.
+
+If you want to address your own GitHub Enterprise instance, replace occurrences
+of `https://github.com` in the configuration above with the address of your
+GitHub Enterprise home page, and the `apiBaseUrl` to where your API endpoint
+lives - commonly on the form `https:///api/v3`.
diff --git a/docs/integrations/google-analytics/installation.md b/docs/integrations/google-analytics/installation.md
new file mode 100644
index 0000000000..a0e6f69d13
--- /dev/null
+++ b/docs/integrations/google-analytics/installation.md
@@ -0,0 +1,24 @@
+---
+id: installation
+title: Google Analytics Installation
+sidebar_label: Installation
+# prettier-ignore
+description: Adding Google Analytics to Your App
+---
+
+There is a basic Google Analytics integration built into Backstage. You can
+enable it by adding the following to your app configuration:
+
+```yaml
+app:
+ googleAnalyticsTrackingId: UA-000000-0
+```
+
+Replace the tracking ID with your own.
+
+For more information, learn about Google Analytics
+[here](https://marketingplatform.google.com/about/analytics/).
+
+The default behavior is only to send a pageview hit to Google Analytics. To
+record more, look at the developer documentation
+[here](https://developers.google.com/analytics/devguides/collection/gtagjs).
diff --git a/docs/integrations/ldap/org.md b/docs/integrations/ldap/org.md
new file mode 100644
index 0000000000..dea33e4024
--- /dev/null
+++ b/docs/integrations/ldap/org.md
@@ -0,0 +1,280 @@
+---
+id: org
+title: LDAP Organizational Data
+sidebar_label: Org Data
+# prettier-ignore
+description: Setting up ingestion of organizational data from LDAP
+---
+
+The Backstage catalog can be set up to ingest organizational data - groups and
+users - directly from an LDAP compatible service. The result is a hierarchy of
+[`User`](../../features/software-catalog/descriptor-format.md#kind-user) and
+[`Group`](../../features/software-catalog/descriptor-format.md#kind-group) kind
+entities that mirror your org setup.
+
+## Installation
+
+The processor that performs the import, `LdapOrgReaderProcessor`, comes
+installed with the default setup of Backstage.
+
+If you replace the set of processors in your installation using that facility of
+the catalog builder class, you can import and add it as follows.
+
+```ts
+// Typically in packages/backend/src/plugins/catalog.ts
+import { LdapOrgReaderProcessor } from '@backstage/plugin-catalog-backend';
+
+builder.replaceProcessors(
+ LdapOrgReaderProcessor.fromConfig(config, { logger }),
+ // ...
+);
+```
+
+## Configuration
+
+The following configuration is a small example of how a setup could look for
+importing groups and users from a corporate LDAP server.
+
+```yaml
+catalog:
+ locations:
+ - type: ldap-org
+ target: ldaps://ds.example.net
+ processors:
+ ldapOrg:
+ providers:
+ - target: ldaps://ds.example.net
+ bind:
+ dn: uid=ldap-reader-user,ou=people,ou=example,dc=example,dc=net
+ secret:
+ $env: LDAP_SECRET
+ users:
+ dn: ou=people,ou=example,dc=example,dc=net
+ options:
+ filter: (uid=*)
+ map:
+ description: l
+ set:
+ metadata.customField: 'hello'
+ groups:
+ dn: ou=access,ou=groups,ou=example,dc=example,dc=net
+ options:
+ filter: (&(objectClass=some-group-class)(!(groupType=email)))
+ map:
+ description: l
+ set:
+ metadata.customField: 'hello'
+```
+
+Locations point out the specific org(s) you want to import. The `type` of these
+locations must be `ldap-org`, and the `target` must point to the exact URL
+(starting with `ldap://` or `ldaps://`) of the targeted LDAP server. You can
+have several such location entries if you want, but typically you will have just
+one.
+
+The processor itself is configured in the other block, under
+`catalog.processors.ldapOrg`. There may be many providers, each targeting a
+specific `target` which is supposed to be on the same form as the location
+`target`.
+
+These config blocks have a lot of options in them, so we will describe each
+"root" key within the block separately.
+
+### target
+
+This is the URL of the targeted server, typically on the form
+`ldaps://ds.example.net` for SSL enabled servers or `ldap://ds.example.net`
+without SSL.
+
+### bind
+
+The bind block specifies how the plugin should bind (essentially, to
+authenticate) towards the server. It has the following fields.
+
+```yaml
+dn: uid=ldap-reader-user,ou=people,ou=example,dc=example,dc=net
+secret:
+ $env: LDAP_SECRET
+```
+
+The `dn` is the full LDAP DN (distinguished name) for the user that the plugin
+authenticates itself as. At this point, only regular user based authentication
+is supported.
+
+The `secret` is the password of the same user. In this example, it is given in
+the form of an environment variable `LDAP_SECRET`, that has to be set when the
+backend starts.
+
+### users
+
+The `users` block defines the settings that govern the reading and
+interpretation of users. Its fields are explained in separate sections below.
+
+### users.dn
+
+The DN under which users are stored, e.g.
+`ou=people,ou=example,dc=example,dc=net`.
+
+### users.options
+
+The search options to use when sending the query to the server, when reading all
+users. All of the options are shown below, with their default values, but they
+are all optional.
+
+```yaml
+options:
+ # One of 'base', 'one', or 'sub'.
+ scope: one
+ # The filter is the one that you commonly will want to specify explicitly. It
+ # is a string on the standard LDAP query format. Use it to select out the set
+ # of users that are of actual interest to ingest. For example, you may want
+ # to filter out disabled users.
+ filter: (uid=*)
+ # The attribute selectors for each item, as passed to the LDAP server.
+ attributes: ['*', '+']
+ # This field is either 'false' to disable paging when reading from the
+ # server, or an object on the form '{ pageSize: 100, pagePause: true }' that
+ # specifies the details of how the paging shall work.
+ paged: false
+```
+
+### users.set
+
+This optional piece lets you specify a number of JSON paths (on a.b.c form) and
+hard coded values to set on those paths. This can be useful for example if you
+want to hard code a namespace or similar on the generated entities.
+
+```yaml
+set:
+ # Just an example; the key and value can be anything
+ metadata.namespace: 'ldap'
+```
+
+### users.map
+
+Mappings from well known entity fields, to LDAP attribute names. This is where
+you are able to define how to interpret the attributes of each LDAP result item,
+and to move them into the corresponding entity fields. All of the options are
+shown below, with their default values, but they are all optional.
+
+If you leave out an optional mapping, it will still be copied using that default
+value. For example, even if you do not put in the field `displayName` in your
+config, the processor will still copy the attribute `cn` into the entity field
+`spec.profile.displayName`.
+
+```yaml
+map:
+ # The name of the attribute that holds the relative
+ # distinguished name of each entry.
+ rdn: uid
+ # The name of the attribute that shall be used for the value of
+ # the metadata.name field of the entity.
+ name: uid
+ # The name of the attribute that shall be used for the value of
+ # the metadata.description field of the entity.
+ description: description
+ # The name of the attribute that shall be used for the value of
+ # the spec.profile.displayName field of the entity.
+ displayName: cn
+ # The name of the attribute that shall be used for the value of
+ # the spec.profile.email field of the entity.
+ email: mail
+ # The name of the attribute that shall be used for the value of
+ # the spec.profile.picture field of the entity.
+ picture:
+ # The name of the attribute that shall be used for the values of
+ # the spec.memberOf field of the entity.
+ memberOf: memberOf
+```
+
+### groups
+
+The `groups` block defines the settings that govern the reading and
+interpretation of groups. Its fields are explained in separate sections below.
+
+### groups.dn
+
+The DN under which groups are stored, e.g.
+`ou=people,ou=example,dc=example,dc=net`.
+
+### groups.options
+
+The search options to use when sending the query to the server, when reading all
+groups. All of the options are shown below, with their default values, but they
+are all optional.
+
+```yaml
+options:
+ # One of 'base', 'one', or 'sub'.
+ scope: one
+ # The filter is the one that you commonly will want to specify explicitly. It
+ # is a string on the standard LDAP query format. Use it to select out the set
+ # of groups that are of actual interest to ingest. For example, you may want
+ # to filter out disabled groups.
+ filter: (&(objectClass=some-group-class)(!(groupType=email)))
+ # The attribute selectors for each item, as passed to the LDAP server.
+ attributes: ['*', '+']
+ # This field is either 'false' to disable paging when reading from the
+ # server, or an object on the form '{ pageSize: 100, pagePause: true }' that
+ # specifies the details of how the paging shall work.
+ paged: false
+```
+
+### groups.set
+
+This optional piece lets you specify a number of JSON paths (on a.b.c form) and
+hard coded values to set on those paths. This can be useful for example if you
+want to hard code a namespace or similar on the generated entities.
+
+```yaml
+set:
+ # Just an example; the key and value can be anything
+ metadata.namespace: 'ldap'
+```
+
+### groups.map
+
+Mappings from well known entity fields, to LDAP attribute names. This is where
+you are able to define how to interpret the attributes of each LDAP result item,
+and to move them into the corresponding entity fields. All of the options are
+shown below, with their default values, but they are all optional.
+
+If you leave out an optional mapping, it will still be copied using that default
+value. For example, even if you do not put in the field `displayName` in your
+config, the processor will still copy the attribute `cn` into the entity field
+`spec.profile.displayName`. If the target field is optional, such as the display
+name, the importer will accept missing attributes and just leave the target
+field unset. If the target field is mandatory, such as the name of the entity,
+validation will fail if the source attribute is missing.
+
+```yaml
+map:
+ # The name of the attribute that holds the relative
+ # distinguished name of each entry. This value is copied into a
+ # well known annotation to be able to query by it later.
+ rdn: cn
+ # The name of the attribute that shall be used for the value of
+ # the metadata.name field of the entity.
+ name: cn
+ # The name of the attribute that shall be used for the value of
+ # the metadata.description field of the entity.
+ description: description
+ # The name of the attribute that shall be used for the value of
+ # the spec.type field of the entity.
+ type: groupType
+ # The name of the attribute that shall be used for the value of
+ # the spec.profile.displayName field of the entity.
+ displayName: cn
+ # The name of the attribute that shall be used for the value of
+ # the spec.profile.email field of the entity.
+ email:
+ # The name of the attribute that shall be used for the value of
+ # the spec.profile.picture field of the entity.
+ picture:
+ # The name of the attribute that shall be used for the values of
+ # the spec.parent field of the entity.
+ memberOf: memberOf
+ # The name of the attribute that shall be used for the values of
+ # the spec.children field of the entity.
+ members: member
+```
diff --git a/docs/plugins/observability.md b/docs/plugins/observability.md
index 8b6668606f..de6f4bf988 100644
--- a/docs/plugins/observability.md
+++ b/docs/plugins/observability.md
@@ -10,18 +10,8 @@ Backstage integrator.
## Google Analytics
-There is a basic Google Analytics integration built into Backstage. You can
-enable it by adding the following to your app configuration:
-
-```yaml
-app:
- googleAnalyticsTrackingId: UA-000000-0
-```
-
-Replace the tracking ID with your own.
-
-For more information, learn about Google Analytics
-[here](https://marketingplatform.google.com/about/analytics/).
+See how to install Google Analytics in your app
+[here](../integrations/google-analytics/installation.md)
## Logging
diff --git a/docs/plugins/testing.md b/docs/plugins/testing.md
index 30c3bf0ecc..bd6061be19 100644
--- a/docs/plugins/testing.md
+++ b/docs/plugins/testing.md
@@ -274,7 +274,7 @@ export {
};
```
-**`./\_\_mocks\_\_/MyApi.js`**
+**`./__mocks__/MyApi.js`**
```js
export {
diff --git a/docs/support/project-structure.md b/docs/support/project-structure.md
index 5c8a8cd3bb..55a92da571 100644
--- a/docs/support/project-structure.md
+++ b/docs/support/project-structure.md
@@ -6,8 +6,8 @@ description: Introduction to files and folders in the Backstage Project reposito
---
Backstage is a complex project, and the GitHub repository contains many
-different files and folders. This document aims to clarify what purpose of those
-files and folders are.
+different files and folders. This document aims to clarify the purpose of those
+files and folders.
## General purpose files and folders
@@ -25,7 +25,7 @@ the code.
Standard GitHub folder. It contains - amongst other things - our workflow
definitions and templates. Worth noting is the
[styles](https://github.com/backstage/backstage/tree/master/.github/styles)
- folder which is used for a markdown spellchecker.
+ sub-folder which is used for a markdown spellchecker.
- [`.yarn/`](https://github.com/backstage/backstage/tree/master/.yarn) -
Backstage ships with it's own `yarn` implementation. This allows us to have
@@ -33,7 +33,7 @@ the code.
yarn versioning differences.
- [`contrib/`](https://github.com/backstage/backstage/tree/master/contrib) -
- Collection of examples or resources provided by the community. We really
+ Collection of examples or resources contributed by the community. We really
appreciate contributions in here and encourage them being kept up to date.
- [`docs/`](https://github.com/backstage/backstage/tree/master/docs) - This is
@@ -43,10 +43,11 @@ the code.
file may be needed as sections are added/removed.
- [`.editorconfig`](https://github.com/backstage/backstage/tree/master/.editorconfig) -
- A configuration file used by most common code editors.
+ A configuration file used by most common code editors. Learn more at
+ [EditorConfig.org](https://editorconfig.org/).
- [`.imgbotconfig`](https://github.com/backstage/backstage/tree/master/.imgbotconfig) -
- Configuration for a [bot](https://imgbot.net/)
+ Configuration for a [bot](https://imgbot.net/) which helps reduce image sizes.
## Monorepo packages
@@ -103,16 +104,16 @@ are separated out into their own folder, see further down.
diff, create-plugins and more. In the early days of this project, we started
out with calling tools directly - such as `eslint` - through `package.json`.
But as it was tricky to have a good development experience around that when we
- change named tooling, we opted for wrapping those in our own cli. That way
+ change named tooling, we opted for wrapping those in our own CLI. That way
everything looks the same in `package.json`. Much like
[react-scripts](https://github.com/facebook/create-react-app/tree/master/packages/react-scripts).
- [`cli-common/`](https://github.com/backstage/backstage/tree/master/packages/cli-common) -
This package mainly handles path resolving. It is a separate package to reduce
bugs in
- [cli](https://github.com/backstage/backstage/tree/master/packages/cli). We
+ [CLI](https://github.com/backstage/backstage/tree/master/packages/cli). We
also want as few dependencies as possible to reduce download time when running
- the cli which is another reason this is a separate package.
+ the CLI which is another reason this is a separate package.
- [`config/`](https://github.com/backstage/backstage/tree/master/packages/config) -
The way we read configuration data. This package can take a bunch of config
@@ -139,14 +140,6 @@ are separated out into their own folder, see further down.
detail that we try to hide from our users, and no one should have to depend on
it directly.
-- [`test-utils/`](https://github.com/backstage/backstage/tree/master/packages/test-utils) -
- This package contains specific testing facilities used when testing
- `core-api`.
-
-- [`test-utils-core/`](https://github.com/backstage/backstage/tree/master/packages/test-utils-core) -
- This package contains more general purpose testing facilities for testing a
- Backstage App.
-
- [`create-app/`](https://github.com/backstage/backstage/tree/master/packages/create-app) -
An CLI to specifically scaffold a new Backstage App. It does so by using a
[template](https://github.com/backstage/backstage/tree/master/packages/create-app/templates/default-app).
@@ -161,26 +154,30 @@ are separated out into their own folder, see further down.
to read out definitions and generate documentation for it.
- [`e2e-test/`](https://github.com/backstage/backstage/tree/master/packages/e2e-test) -
- Another CLI that can be run to try out what would happen if you built all the
- packages, publish them, created a new app, and the run it. CI uses this for
+ Another CLI that can be run to try out what would happen if you build all the
+ packages, publish them, create a new app, and then run them. CI uses this for
e2e-tests.
- [`integration/`](https://github.com/backstage/backstage/tree/master/packages/integration) -
Common functionalities of integrations like GitHub, GitLab, etc.
- [`storybook/`](https://github.com/backstage/backstage/tree/master/packages/storybook) -
- This folder contains only the storybook config. Stories are within the core
- package. The Backstage Storybook is found
- [here](https://backstage.io/storybook)
+ This folder contains only the Storybook config which helps visualize our
+ reusable React components. Stories are within the core package, and are
+ published in the [Backstage Storybook](https://backstage.io/storybook).
- [`techdocs-common/`](https://github.com/backstage/backstage/tree/master/packages/techdocs-common) -
Common functionalities for TechDocs, to be shared between
[techdocs-backend](https://github.com/backstage/backstage/tree/master/plugins/techdocs-backend)
plugin and [techdocs-cli](https://github.com/backstage/techdocs-cli).
-- [`test-utils-core/`](https://github.com/backstage/backstage/tree/master/packages/test-utils-core)
+- [`test-utils/`](https://github.com/backstage/backstage/tree/master/packages/test-utils) -
+ This package contains specific testing facilities used when testing
+ `core-api`.
-- [`test-utils/`](https://github.com/backstage/backstage/tree/master/packages/test-utils)
+- [`test-utils-core/`](https://github.com/backstage/backstage/tree/master/packages/test-utils-core) -
+ This package contains more general purpose testing facilities for testing a
+ Backstage App.
- [`theme/`](https://github.com/backstage/backstage/tree/master/packages/theme) -
Holds the Backstage Theme.
@@ -196,10 +193,10 @@ We can categorize plugins into three different types; **Frontend**, **Backend**
and **GraphQL**. We differentiate these types of plugins when we name them, with
a dash-suffix. `-backend` means it’s a backend plugin and so on.
-One reason for splitting a plugin is because of to it's dependencies. Another
-reason is for clear separation of concerns.
+One reason for splitting a plugin is because of its dependencies. Another reason
+is for clear separation of concerns.
-Take a look at our [Plugin Gallery](https://backstage.io/plugins) or browse
+Take a look at our [Plugin Marketplace](https://backstage.io/plugins) or browse
through the
[`plugins/`](https://github.com/backstage/backstage/tree/master/plugins) folder.
@@ -212,7 +209,7 @@ monorepo setup.
This folder contains the source code for backstage.io. It is built with
[Docusaurus](https://docusaurus.io/). This folder is not part of the monorepo
due to dependency reasons. Look at the
- [README](https://github.com/backstage/backstage/blob/master/microsite/README.md)
+ [microsite README](https://github.com/backstage/backstage/blob/master/microsite/README.md)
for instructions on how to run it locally.
## Root files specifically used by the `app`
@@ -222,8 +219,8 @@ Some of these files may be subject to be moved out of the root sometime in the
future.
- [`.npmrc`](https://github.com/backstage/backstage/tree/master/.npmrc) - It's
- common for companies to have their own npm registry, this files makes sure
- that this folder use the public registry.
+ common for companies to have their own npm registry, and this file makes sure
+ that this folder always uses the public registry.
- [`.vale.ini`](https://github.com/backstage/backstage/tree/master/.vale.ini) -
[Spell checker](https://github.com/errata-ai/vale) for Markdown files.
diff --git a/microsite/data/plugins/splunk-on-call.yaml b/microsite/data/plugins/splunk-on-call.yaml
index 2d6deb0180..15ceb86a1b 100644
--- a/microsite/data/plugins/splunk-on-call.yaml
+++ b/microsite/data/plugins/splunk-on-call.yaml
@@ -5,7 +5,7 @@ authorUrl: https://github.com/spotify
category: Monitoring
description: Splunk On-Call offers a simple way to identify incidents and escalation policies.
documentation: https://github.com/backstage/backstage/tree/master/plugins/splunk-on-call
-iconUrl: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIiBjbGFzcz0idm8tbGVhZi1ibGFjayI+PHBhdGggZD0iTTE1Ljk5OTcgMzJDMjQuODM2MSAzMiAzMiAyNC44MzY4IDMyIDE2LjAwMDJDMzIgNy4xNjM1NiAyNC44MzYxIDAgMTUuOTk5NyAwQzcuMTYzNCAwIDAgNy4xNjM1NiAwIDE2LjAwMDJDMCAyNC44MzY4IDcuMTYzNCAzMiAxNS45OTk3IDMyWk0yMi41Njc1IDE0LjY5MDRMMjMuNjI1OSAxNi41MTU4TDE4Ljg4NTEgMTguOTE0NUwxOC44MSAxOS43MTQxTDIyLjQwMzMgMTguNTc2MUwyMC41OTcyIDIwLjg0MzJMMjAuNDQ2MiAyMS41NjI4TDE4LjI0MzkgMjIuNTUyNUwxOC4wMTc2IDIzLjIzMjJMMTkuMDA0NSAyMi44MTU3TDE2LjM0MjIgMjUuOTEwNFYyOS42MDA0SDE1LjY1NzdWMjUuOTEwNEwxMi45OTU5IDIyLjgxNTdMMTMuOTgyOCAyMy4yMzIyTDEzLjc1NjYgMjIuNTUyNUwxMS41NTQ1IDIxLjU2MjhMMTEuNDAzNiAyMC44NDMyTDkuNTk2OTIgMTguNTc2MUwxMy4xOTA2IDE5LjcxNDFMMTMuMTE0OSAxOC45MTQ1TDguMzc0NDkgMTYuNTE1OEw5LjQzMzM5IDE0LjY5MDRMNy4yMDAyIDExLjUxODlMMTMuMzcxOCAxNC41MDA3TDEzLjQ5NyAxMy42MDM3TDExLjY5MzYgMTAuNjYyTDExLjk1MiAxMC4xNzc0TDExLjExOTUgNi43MTg2N0wxNC4zNTUzIDEwLjEyNjdMMTQuNTQ5MyA4LjI0NDU0TDEzLjU4MTggNS40MjI1M0wxNC44NzMgNS44NTYyNEwxNiAyLjQwMDM5TDE3LjEyNzMgNS44NTYyNEwxOC40MTg2IDUuNDIyNTNMMTcuNDUxMiA4LjI0NDU0TDE3LjY0NTQgMTAuMTI2N0wyMC44ODA3IDYuNzE4NjdMMjAuMDQ4MiAxMC4xNzc0TDIwLjMwNjggMTAuNjYyTDE4LjUwMzQgMTMuNjAzN0wxOC42Mjg4IDE0LjUwMDdMMjQuODAwMiAxMS41MTg5TDIyLjU2NzUgMTQuNjkwNFoiIGZpbGw9JyMyQzJDMkMnLz48L3N2Zz4K
+iconUrl: img/splunk-black-white-bg.png
npmPackageName: '@backstage/plugin-splunk-on-call'
tags:
- monitoring
diff --git a/microsite/pages/en/demos.js b/microsite/pages/en/demos.js
index 47ea1ee9ee..86cb6c786d 100644
--- a/microsite/pages/en/demos.js
+++ b/microsite/pages/en/demos.js
@@ -21,6 +21,8 @@ const Background = props => {
To explore the UI and basic features of Backstage firsthand, go
to: demo.backstage.io.
+ (Tip: click “All” to view all the example components in the
+ service catalog.)
Watch the videos below to get an introduction to Backstage and to
diff --git a/microsite/sidebars.json b/microsite/sidebars.json
index ebce8d900c..799433b8ef 100644
--- a/microsite/sidebars.json
+++ b/microsite/sidebars.json
@@ -13,7 +13,7 @@
"Getting Started": [
"getting-started/index",
"getting-started/running-backstage-locally",
- "getting-started/development-environment",
+ "getting-started/contributing",
"getting-started/create-an-app",
{
"type": "subcategory",
@@ -27,6 +27,7 @@
"type": "subcategory",
"label": "Deployment",
"ids": [
+ "getting-started/deployment-docker",
"getting-started/deployment-k8s",
"getting-started/deployment-helm",
"getting-started/deployment-other"
@@ -101,6 +102,23 @@
]
}
],
+ "Integrations": [
+ {
+ "type": "subcategory",
+ "label": "GitHub",
+ "ids": ["integrations/github/org"]
+ },
+ {
+ "type": "subcategory",
+ "label": "LDAP",
+ "ids": ["integrations/ldap/org"]
+ },
+ {
+ "type": "subcategory",
+ "label": "Google Analytics",
+ "ids": ["integrations/google-analytics/installation"]
+ }
+ ],
"Plugins": [
"plugins/index",
"plugins/existing-plugins",
diff --git a/microsite/static/img/splunk-black-white-bg.png b/microsite/static/img/splunk-black-white-bg.png
new file mode 100644
index 0000000000..76eb7ef0f8
Binary files /dev/null and b/microsite/static/img/splunk-black-white-bg.png differ
diff --git a/mkdocs.yml b/mkdocs.yml
index a303fd9978..6b1971ce03 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -16,7 +16,7 @@ nav:
- Getting started:
- Getting Started: 'getting-started/index.md'
- Running Backstage locally: 'getting-started/running-backstage-locally.md'
- - Local development: 'getting-started/development-environment.md'
+ - Contributors: 'getting-started/contributors.md'
- Demo deployment: https://backstage-demo.roadie.io
- Production deployments:
- Create an App: 'getting-started/create-an-app.md'
@@ -24,6 +24,7 @@ nav:
- Configuring App with plugins: 'getting-started/configure-app-with-plugins.md'
- Customize the look-and-feel of your App: 'getting-started/app-custom-theme.md'
- Deployment scenarios:
+ - Docker: 'getting-started/deployment-docker.md'
- Kubernetes: 'getting-started/deployment-k8s.md'
- Kubernetes and Helm: 'getting-started/deployment-helm.md'
- Other: 'getting-started/deployment-other.md'
@@ -64,6 +65,13 @@ nav:
- FAQ: 'features/techdocs/FAQ.md'
- Kubernetes:
- Overview: 'features/kubernetes/index.md'
+ - Integrations:
+ - GitHub:
+ - Org Data: 'integrations/github/org.md'
+ - LDAP:
+ - Org Data: 'integrations/ldap/org.md'
+ - Google Analytics:
+ - Installation: 'integrations/google-analytics/installation.md'
- Plugins:
- Overview: 'plugins/index.md'
- Existing plugins: 'plugins/existing-plugins.md'
diff --git a/package.json b/package.json
index 59fe9d8f18..527304b4f3 100644
--- a/package.json
+++ b/package.json
@@ -20,10 +20,10 @@
"lint:all": "lerna run lint --",
"lint:type-deps": "node scripts/check-type-dependencies.js",
"docgen": "lerna run docgen",
- "docker-build": "yarn tsc && yarn workspace example-backend build-image",
+ "docker-build": "yarn tsc && yarn workspace example-backend build --build-dependencies && yarn workspace example-backend build-image",
"create-plugin": "backstage-cli create-plugin --scope backstage --no-private",
"remove-plugin": "backstage-cli remove-plugin",
- "release": "changeset version && yarn diff --yes && yarn prettier --write '{packages,plugins}/*/{package.json,CHANGELOG.md}' && yarn install --frozen-lockfile",
+ "release": "changeset version && yarn diff --yes && yarn prettier --write '{packages,plugins}/*/{package.json,CHANGELOG.md}' && yarn install",
"prettier:check": "prettier --check .",
"lerna": "lerna",
"storybook": "yarn workspace storybook start",
diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md
index 6190dda9da..f9166939c6 100644
--- a/packages/app/CHANGELOG.md
+++ b/packages/app/CHANGELOG.md
@@ -1,5 +1,112 @@
# example-app
+## 0.2.17
+
+### Patch Changes
+
+- Updated dependencies [3a58084b6]
+- Updated dependencies [a5f42cf66]
+- Updated dependencies [38205492a]
+- Updated dependencies [e488f0502]
+- Updated dependencies [e799e74d4]
+- Updated dependencies [e3bc5aad7]
+- Updated dependencies [a5f42cf66]
+- Updated dependencies [a8953a9c9]
+- Updated dependencies [f37992797]
+- Updated dependencies [347137ccf]
+- Updated dependencies [d0760ecdf]
+- Updated dependencies [1407b34c6]
+- Updated dependencies [88f1f1b60]
+- Updated dependencies [d6593abe6]
+- Updated dependencies [bad21a085]
+- Updated dependencies [e8e35fb5f]
+- Updated dependencies [9615e68fb]
+- Updated dependencies [e780e119c]
+- Updated dependencies [437bac549]
+- Updated dependencies [9f2b3a26e]
+- Updated dependencies [49f9b7346]
+- Updated dependencies [5c2e2863f]
+- Updated dependencies [968b588f7]
+- Updated dependencies [3a58084b6]
+- Updated dependencies [2499f6cde]
+- Updated dependencies [5469a9761]
+- Updated dependencies [60d1bc3e7]
+- Updated dependencies [2c1f2a7c2]
+- Updated dependencies [6266ddd11]
+ - @backstage/core@0.6.3
+ - @backstage/plugin-scaffolder@0.6.0
+ - @backstage/plugin-cost-insights@0.8.2
+ - @backstage/plugin-org@0.3.8
+ - @backstage/plugin-catalog@0.4.0
+ - @backstage/plugin-catalog-import@0.4.2
+ - @backstage/plugin-techdocs@0.5.8
+ - @backstage/plugin-explore@0.2.7
+ - @backstage/plugin-catalog-react@0.1.0
+ - @backstage/plugin-api-docs@0.4.7
+ - @backstage/catalog-model@0.7.2
+ - @backstage/cli@0.6.2
+ - @backstage/plugin-tech-radar@0.3.6
+ - @backstage/plugin-circleci@0.2.10
+ - @backstage/plugin-cloudbuild@0.2.11
+ - @backstage/plugin-github-actions@0.3.4
+ - @backstage/plugin-jenkins@0.3.11
+ - @backstage/plugin-kafka@0.2.4
+ - @backstage/plugin-kubernetes@0.3.11
+ - @backstage/plugin-lighthouse@0.2.12
+ - @backstage/plugin-pagerduty@0.3.1
+ - @backstage/plugin-register-component@0.2.11
+ - @backstage/plugin-rollbar@0.3.2
+ - @backstage/plugin-search@0.3.2
+ - @backstage/plugin-sentry@0.3.7
+
+## 0.2.16
+
+### Patch Changes
+
+- Updated dependencies [6c4a76c59]
+- Updated dependencies [32a950409]
+- Updated dependencies [f10950bd2]
+- Updated dependencies [914c89b13]
+- Updated dependencies [fd3f2a8c0]
+- Updated dependencies [257a753ff]
+- Updated dependencies [d872f662d]
+- Updated dependencies [9337f509d]
+- Updated dependencies [d34d26125]
+- Updated dependencies [0af242b6d]
+- Updated dependencies [f4c2bcf54]
+- Updated dependencies [e8692df4a]
+- Updated dependencies [53b69236d]
+- Updated dependencies [549a859ac]
+- Updated dependencies [10a0124e0]
+- Updated dependencies [07e226872]
+- Updated dependencies [f62e7abe5]
+- Updated dependencies [96f378d10]
+- Updated dependencies [532bc0ec0]
+- Updated dependencies [688b73110]
+ - @backstage/plugin-scaffolder@0.5.1
+ - @backstage/plugin-catalog@0.3.2
+ - @backstage/core@0.6.2
+ - @backstage/cli@0.6.1
+ - @backstage/plugin-user-settings@0.2.6
+ - @backstage/plugin-catalog-react@0.0.4
+ - @backstage/plugin-api-docs@0.4.6
+ - @backstage/plugin-catalog-import@0.4.1
+ - @backstage/plugin-github-actions@0.3.3
+ - @backstage/plugin-jenkins@0.3.10
+ - @backstage/plugin-lighthouse@0.2.11
+ - @backstage/plugin-org@0.3.7
+ - @backstage/plugin-sentry@0.3.6
+ - @backstage/plugin-pagerduty@0.3.0
+ - @backstage/plugin-circleci@0.2.9
+ - @backstage/plugin-cloudbuild@0.2.10
+ - @backstage/plugin-explore@0.2.6
+ - @backstage/plugin-kafka@0.2.3
+ - @backstage/plugin-kubernetes@0.3.10
+ - @backstage/plugin-register-component@0.2.10
+ - @backstage/plugin-rollbar@0.3.1
+ - @backstage/plugin-search@0.3.1
+ - @backstage/plugin-techdocs@0.5.7
+
## 0.2.15
### Patch Changes
diff --git a/packages/app/package.json b/packages/app/package.json
index 88d039e7c8..4882662016 100644
--- a/packages/app/package.json
+++ b/packages/app/package.json
@@ -1,46 +1,46 @@
{
"name": "example-app",
- "version": "0.2.15",
+ "version": "0.2.17",
"private": true,
"bundled": true,
"dependencies": {
- "@backstage/catalog-model": "^0.7.1",
- "@backstage/cli": "^0.6.0",
- "@backstage/core": "^0.6.1",
- "@backstage/plugin-api-docs": "^0.4.5",
- "@backstage/plugin-catalog": "^0.3.1",
- "@backstage/plugin-catalog-react": "^0.0.3",
- "@backstage/plugin-catalog-import": "^0.4.0",
- "@backstage/plugin-circleci": "^0.2.8",
- "@backstage/plugin-cloudbuild": "^0.2.9",
- "@backstage/plugin-cost-insights": "^0.8.1",
- "@backstage/plugin-explore": "^0.2.5",
+ "@backstage/catalog-model": "^0.7.2",
+ "@backstage/cli": "^0.6.2",
+ "@backstage/core": "^0.6.3",
+ "@backstage/plugin-api-docs": "^0.4.7",
+ "@backstage/plugin-catalog": "^0.4.0",
+ "@backstage/plugin-catalog-import": "^0.4.2",
+ "@backstage/plugin-catalog-react": "^0.1.0",
+ "@backstage/plugin-circleci": "^0.2.10",
+ "@backstage/plugin-cloudbuild": "^0.2.11",
+ "@backstage/plugin-cost-insights": "^0.8.2",
+ "@backstage/plugin-explore": "^0.2.7",
"@backstage/plugin-gcp-projects": "^0.2.4",
- "@backstage/plugin-github-actions": "^0.3.2",
+ "@backstage/plugin-github-actions": "^0.3.4",
"@backstage/plugin-gitops-profiles": "^0.2.5",
"@backstage/plugin-graphiql": "^0.2.7",
- "@backstage/plugin-org": "^0.3.6",
- "@backstage/plugin-jenkins": "^0.3.9",
- "@backstage/plugin-kafka": "^0.2.2",
- "@backstage/plugin-kubernetes": "^0.3.9",
- "@backstage/plugin-lighthouse": "^0.2.10",
+ "@backstage/plugin-jenkins": "^0.3.11",
+ "@backstage/plugin-kafka": "^0.2.4",
+ "@backstage/plugin-kubernetes": "^0.3.11",
+ "@backstage/plugin-lighthouse": "^0.2.12",
"@backstage/plugin-newrelic": "^0.2.5",
- "@backstage/plugin-pagerduty": "0.2.8",
- "@backstage/plugin-register-component": "^0.2.9",
- "@backstage/plugin-rollbar": "^0.3.0",
- "@backstage/plugin-scaffolder": "^0.5.0",
- "@backstage/plugin-sentry": "^0.3.5",
- "@backstage/plugin-search": "^0.3.0",
- "@backstage/plugin-tech-radar": "^0.3.5",
- "@backstage/plugin-techdocs": "^0.5.6",
- "@backstage/plugin-user-settings": "^0.2.5",
+ "@backstage/plugin-org": "^0.3.8",
+ "@backstage/plugin-pagerduty": "0.3.1",
+ "@backstage/plugin-register-component": "^0.2.11",
+ "@backstage/plugin-rollbar": "^0.3.2",
+ "@backstage/plugin-scaffolder": "^0.6.0",
+ "@backstage/plugin-sentry": "^0.3.7",
+ "@backstage/plugin-search": "^0.3.2",
+ "@backstage/plugin-tech-radar": "^0.3.6",
+ "@backstage/plugin-techdocs": "^0.5.8",
+ "@backstage/plugin-user-settings": "^0.2.6",
"@backstage/theme": "^0.2.3",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@octokit/rest": "^18.0.12",
"@roadiehq/backstage-plugin-buildkite": "^0.1.3",
"@roadiehq/backstage-plugin-github-insights": "^0.2.16",
- "@roadiehq/backstage-plugin-github-pull-requests": "^0.6.3",
+ "@roadiehq/backstage-plugin-github-pull-requests": "^0.7.6",
"@roadiehq/backstage-plugin-travis-ci": "^0.2.8",
"history": "^5.0.0",
"prop-types": "^15.7.2",
@@ -53,7 +53,7 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/test-utils": "^0.1.7",
+ "@backstage/test-utils": "^0.1.8",
"@testing-library/cypress": "^7.0.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^10.4.1",
diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx
index cc673c7769..9a7c857167 100644
--- a/packages/app/src/App.tsx
+++ b/packages/app/src/App.tsx
@@ -17,20 +17,23 @@
import {
AlertDisplay,
createApp,
- createRouteRef,
FlatRoutes,
OAuthRequestDialog,
SignInPage,
} from '@backstage/core';
-import { Router as CatalogRouter } from '@backstage/plugin-catalog';
+import {
+ catalogPlugin,
+ CatalogIndexPage,
+ CatalogEntityPage,
+} from '@backstage/plugin-catalog';
import { CatalogImportPage } from '@backstage/plugin-catalog-import';
import { ExplorePage } from '@backstage/plugin-explore';
-import { Router as GraphiQLRouter } from '@backstage/plugin-graphiql';
-import { Router as LighthouseRouter } from '@backstage/plugin-lighthouse';
-import { Router as RegisterComponentRouter } from '@backstage/plugin-register-component';
-import { Router as TechRadarRouter } from '@backstage/plugin-tech-radar';
-import { Router as DocsRouter } from '@backstage/plugin-techdocs';
-import { Router as SettingsRouter } from '@backstage/plugin-user-settings';
+import { GraphiQLPage } from '@backstage/plugin-graphiql';
+import { LighthousePage } from '@backstage/plugin-lighthouse';
+import { ScaffolderPage, scaffolderPlugin } from '@backstage/plugin-scaffolder';
+import { TechRadarPage } from '@backstage/plugin-tech-radar';
+import { TechdocsPage } from '@backstage/plugin-techdocs';
+import { UserSettingsPage } from '@backstage/plugin-user-settings';
import React from 'react';
import { hot } from 'react-hot-loader/root';
import { Navigate, Route } from 'react-router';
@@ -40,6 +43,15 @@ import Root from './components/Root';
import { providers } from './identityProviders';
import * as plugins from './plugins';
import AlarmIcon from '@material-ui/icons/Alarm';
+import { ApiExplorerPage } from '@backstage/plugin-api-docs';
+import { GcpProjectsPage } from '@backstage/plugin-gcp-projects';
+import { NewRelicPage } from '@backstage/plugin-newrelic';
+import { SearchPage } from '@backstage/plugin-search';
+import {
+ CostInsightsLabelDataflowInstructionsPage,
+ CostInsightsPage,
+ CostInsightsProjectGrowthInstructionsPage,
+} from '@backstage/plugin-cost-insights';
const app = createApp({
apis,
@@ -60,39 +72,50 @@ const app = createApp({
);
},
},
+ bindRoutes({ bind }) {
+ bind(catalogPlugin.externalRoutes, {
+ createComponent: scaffolderPlugin.routes.root,
+ });
+ },
});
const AppProvider = app.getProvider();
const AppRouter = app.getRouter();
-const deprecatedAppRoutes = app.getRoutes();
-
-const catalogRouteRef = createRouteRef({
- path: '/catalog',
- title: 'Service Catalog',
-});
const routes = (
- } />
+ } />
}
- />
- } />
+ path="/catalog/:namespace/:kind/:name"
+ element={}
+ >
+
+
+ } />
+ } />
+ } />
} />
}
+ element={}
/>
- } />
- } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
+ } />
}
+ path="/cost-insights/investigating-growth"
+ element={}
/>
- } />
- {...deprecatedAppRoutes}
+ }
+ />
+ } />
);
diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx
index 7fb624b9e9..449d018fa3 100644
--- a/packages/app/src/components/catalog/EntityPage.tsx
+++ b/packages/app/src/components/catalog/EntityPage.tsx
@@ -39,7 +39,7 @@ import {
EntityLinksCard,
EntityPageLayout,
} from '@backstage/plugin-catalog';
-import { useEntity } from '@backstage/plugin-catalog-react';
+import { EntityProvider, useEntity } from '@backstage/plugin-catalog-react';
import {
isPluginApplicableToEntity as isCircleCIAvailable,
Router as CircleCIRouter,
@@ -184,7 +184,9 @@ const ComponentOverviewContent = ({ entity }: { entity: Entity }) => (
{isPagerDutyAvailable(entity) && (
-
+
+
+
)}
diff --git a/packages/app/src/plugins.ts b/packages/app/src/plugins.ts
index c62c0435a2..862d821ed6 100644
--- a/packages/app/src/plugins.ts
+++ b/packages/app/src/plugins.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
export { plugin as LighthousePlugin } from '@backstage/plugin-lighthouse';
-export { plugin as CatalogPlugin } from '@backstage/plugin-catalog';
-export { plugin as ScaffolderPlugin } from '@backstage/plugin-scaffolder';
+export { catalogPlugin } from '@backstage/plugin-catalog';
+export { scaffolderPlugin } from '@backstage/plugin-scaffolder';
export { plugin as TechRadar } from '@backstage/plugin-tech-radar';
export { explorePlugin } from '@backstage/plugin-explore';
export { plugin as Circleci } from '@backstage/plugin-circleci';
diff --git a/packages/backend-common/CHANGELOG.md b/packages/backend-common/CHANGELOG.md
index 42f1fa4a42..bb913c8fdb 100644
--- a/packages/backend-common/CHANGELOG.md
+++ b/packages/backend-common/CHANGELOG.md
@@ -1,5 +1,19 @@
# @backstage/backend-common
+## 0.5.4
+
+### Patch Changes
+
+- 16fb1d03a: pass registered logger to requestLoggingHandler
+- 491f3a0ec: Implement `UrlReader.search` for the other providers (Azure, Bitbucket, GitLab) as well.
+
+ The `UrlReader` subclasses now are implemented in terms of the respective `Integration` class.
+
+- 434b4e81a: Support globs in `FileReaderProcessor`.
+- fb28da212: Switched to using `'x-access-token'` for authenticating Git over HTTPS towards GitHub.
+- Updated dependencies [491f3a0ec]
+ - @backstage/integration@0.5.0
+
## 0.5.3
### Patch Changes
diff --git a/packages/backend-common/package.json b/packages/backend-common/package.json
index 7b1c6870ab..3cd817427f 100644
--- a/packages/backend-common/package.json
+++ b/packages/backend-common/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-common",
"description": "Common functionality library for Backstage backends",
- "version": "0.5.3",
+ "version": "0.5.4",
"main": "src/index.ts",
"types": "src/index.ts",
"private": false,
@@ -32,7 +32,7 @@
"@backstage/cli-common": "^0.1.1",
"@backstage/config": "^0.1.2",
"@backstage/config-loader": "^0.5.1",
- "@backstage/integration": "^0.4.0",
+ "@backstage/integration": "^0.5.0",
"@octokit/rest": "^18.0.12",
"@types/cors": "^2.8.6",
"@types/express": "^4.17.6",
@@ -68,7 +68,7 @@
}
},
"devDependencies": {
- "@backstage/cli": "^0.6.0",
+ "@backstage/cli": "^0.6.1",
"@backstage/test-utils": "^0.1.7",
"@types/archiver": "^5.1.0",
"@types/compression": "^1.7.0",
diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md
index 05549b2085..84e51d6bcf 100644
--- a/packages/backend/CHANGELOG.md
+++ b/packages/backend/CHANGELOG.md
@@ -1,5 +1,27 @@
# example-backend
+## 0.2.17
+
+### Patch Changes
+
+- Updated dependencies [a70af22a2]
+- Updated dependencies [ec504e7b4]
+- Updated dependencies [a5f42cf66]
+- Updated dependencies [f37992797]
+- Updated dependencies [bad21a085]
+- Updated dependencies [1c06cb312]
+- Updated dependencies [2499f6cde]
+- Updated dependencies [a1f5e6545]
+ - @backstage/plugin-kubernetes-backend@0.2.7
+ - @backstage/plugin-auth-backend@0.3.2
+ - @backstage/plugin-scaffolder-backend@0.8.0
+ - @backstage/plugin-techdocs-backend@0.6.2
+ - @backstage/catalog-model@0.7.2
+ - @backstage/plugin-app-backend@0.3.8
+ - @backstage/plugin-catalog-backend@0.6.3
+ - @backstage/config@0.1.3
+ - example-app@0.2.17
+
## 0.2.15
### Patch Changes
diff --git a/packages/backend/Dockerfile b/packages/backend/Dockerfile
index f1bc764fd0..acef405c8a 100644
--- a/packages/backend/Dockerfile
+++ b/packages/backend/Dockerfile
@@ -1,16 +1,26 @@
-FROM node:14-buster
+# This dockerfile builds an image for the backend package.
+# It should be executed with the root of the repo as docker context.
+#
+# Before building this image, be sure to have run the following commands in the repo root:
+#
+# yarn install
+# yarn tsc
+# yarn build
+#
+# Once the commands have been run, you can build the image using `yarn build-image`
-WORKDIR /usr/src/app
+FROM node:14-buster-slim
+
+WORKDIR /app
# Copy repo skeleton first, to avoid unnecessary docker cache invalidation.
# The skeleton contains the package.json of each package in the monorepo,
# and along with yarn.lock and the root package.json, that's enough to run yarn install.
-ADD yarn.lock package.json skeleton.tar ./
+ADD yarn.lock package.json packages/backend/dist/skeleton.tar.gz ./
RUN yarn install --frozen-lockfile --production --network-timeout 300000 && rm -rf "$(yarn cache dir)"
-# This will copy the contents of the dist-workspace when running the build-image command.
-# Do not use this Dockerfile outside of that command, as it will copy in the source code instead.
-COPY . .
+# Then copy the rest of the backend bundle, along with any other files we might want.
+ADD packages/backend/dist/bundle.tar.gz app-config.yaml ./
-CMD ["node", "packages/backend"]
+CMD ["node", "packages/backend", "--config", "app-config.yaml"]
diff --git a/packages/backend/package.json b/packages/backend/package.json
index e5271f0109..9220b71866 100644
--- a/packages/backend/package.json
+++ b/packages/backend/package.json
@@ -1,6 +1,6 @@
{
"name": "example-backend",
- "version": "0.2.15",
+ "version": "0.2.17",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -18,8 +18,8 @@
"backstage"
],
"scripts": {
- "build": "backstage-cli backend:build",
- "build-image": "backstage-cli backend:build-image --build --tag example-backend",
+ "build": "backstage-cli backend:bundle",
+ "build-image": "docker build ../.. -f Dockerfile --tag example-backend",
"start": "backstage-cli backend:dev",
"lint": "backstage-cli lint",
"test": "backstage-cli test",
@@ -28,23 +28,24 @@
},
"dependencies": {
"@backstage/backend-common": "^0.5.3",
- "@backstage/catalog-model": "^0.7.1",
- "@backstage/config": "^0.1.2",
- "@backstage/plugin-app-backend": "^0.3.7",
- "@backstage/plugin-auth-backend": "^0.3.0",
- "@backstage/plugin-catalog-backend": "^0.6.1",
+ "@backstage/catalog-client": "^0.3.6",
+ "@backstage/catalog-model": "^0.7.2",
+ "@backstage/config": "^0.1.3",
+ "@backstage/plugin-app-backend": "^0.3.8",
+ "@backstage/plugin-auth-backend": "^0.3.2",
+ "@backstage/plugin-catalog-backend": "^0.6.3",
"@backstage/plugin-graphql-backend": "^0.1.5",
- "@backstage/plugin-kubernetes-backend": "^0.2.6",
+ "@backstage/plugin-kubernetes-backend": "^0.2.7",
"@backstage/plugin-kafka-backend": "^0.2.0",
"@backstage/plugin-proxy-backend": "^0.2.4",
"@backstage/plugin-rollbar-backend": "^0.1.7",
- "@backstage/plugin-scaffolder-backend": "^0.7.0",
- "@backstage/plugin-techdocs-backend": "^0.6.0",
+ "@backstage/plugin-scaffolder-backend": "^0.8.0",
+ "@backstage/plugin-techdocs-backend": "^0.6.2",
"@gitbeaker/node": "^28.0.2",
"@octokit/rest": "^18.0.12",
"azure-devops-node-api": "^10.1.1",
"dockerode": "^3.2.1",
- "example-app": "^0.2.15",
+ "example-app": "^0.2.17",
"express": "^4.17.1",
"express-promise-router": "^3.0.3",
"knex": "^0.21.6",
@@ -54,7 +55,7 @@
"winston": "^3.2.1"
},
"devDependencies": {
- "@backstage/cli": "^0.6.0",
+ "@backstage/cli": "^0.6.2",
"@types/dockerode": "^3.2.1",
"@types/express": "^4.17.6",
"@types/express-serve-static-core": "^4.17.5"
diff --git a/packages/backend/src/plugins/scaffolder.ts b/packages/backend/src/plugins/scaffolder.ts
index 723165ff82..10da5f0e15 100644
--- a/packages/backend/src/plugins/scaffolder.ts
+++ b/packages/backend/src/plugins/scaffolder.ts
@@ -21,11 +21,11 @@ import {
Publishers,
CreateReactAppTemplater,
Templaters,
- CatalogEntityClient,
} from '@backstage/plugin-scaffolder-backend';
import { SingleHostDiscovery } from '@backstage/backend-common';
import type { PluginEnvironment } from '../types';
import Docker from 'dockerode';
+import { CatalogClient } from '@backstage/catalog-client';
export default async function createPlugin({
logger,
@@ -45,7 +45,7 @@ export default async function createPlugin({
const dockerClient = new Docker();
const discovery = SingleHostDiscovery.fromConfig(config);
- const entityClient = new CatalogEntityClient({ discovery });
+ const catalogClient = new CatalogClient({ discoveryApi: discovery });
return await createRouter({
preparers,
@@ -54,7 +54,7 @@ export default async function createPlugin({
logger,
config,
dockerClient,
- entityClient,
database,
+ catalogClient,
});
}
diff --git a/packages/catalog-model/CHANGELOG.md b/packages/catalog-model/CHANGELOG.md
index 8d581dcb0c..3351ed317a 100644
--- a/packages/catalog-model/CHANGELOG.md
+++ b/packages/catalog-model/CHANGELOG.md
@@ -1,5 +1,13 @@
# @backstage/catalog-model
+## 0.7.2
+
+### Patch Changes
+
+- bad21a085: Implement annotations for customising Entity URLs in the Catalog pages.
+- Updated dependencies [a1f5e6545]
+ - @backstage/config@0.1.3
+
## 0.7.1
### Patch Changes
diff --git a/packages/catalog-model/examples/components/petstore-component.yaml b/packages/catalog-model/examples/components/petstore-component.yaml
index 48286f9b74..878fabd551 100644
--- a/packages/catalog-model/examples/components/petstore-component.yaml
+++ b/packages/catalog-model/examples/components/petstore-component.yaml
@@ -2,7 +2,8 @@ apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: petstore
- description: Petstore
+ # This is an extra long description
+ description: The Petstore is an example API used to show features of the OpenAPI spec.
links:
- url: https://github.com/swagger-api/swagger-petstore
title: GitHub Repo
diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json
index af74b78a08..554eea0937 100644
--- a/packages/catalog-model/package.json
+++ b/packages/catalog-model/package.json
@@ -1,6 +1,6 @@
{
"name": "@backstage/catalog-model",
- "version": "0.7.1",
+ "version": "0.7.2",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/config": "^0.1.2",
+ "@backstage/config": "^0.1.3",
"@types/json-schema": "^7.0.5",
"@types/yup": "^0.29.8",
"ajv": "^7.0.3",
@@ -39,7 +39,7 @@
"yup": "^0.29.3"
},
"devDependencies": {
- "@backstage/cli": "^0.6.0",
+ "@backstage/cli": "^0.6.2",
"@types/express": "^4.17.6",
"@types/jest": "^26.0.7",
"@types/lodash": "^4.14.151",
diff --git a/packages/catalog-model/src/entity/constants.ts b/packages/catalog-model/src/entity/constants.ts
index 42ea2ae8ba..c8f88e3b0c 100644
--- a/packages/catalog-model/src/entity/constants.ts
+++ b/packages/catalog-model/src/entity/constants.ts
@@ -27,3 +27,9 @@ export const ENTITY_META_GENERATED_FIELDS = [
'etag',
'generation',
] as const;
+
+/**
+ * Annotations for linking to entity from catalog pages.
+ */
+export const VIEW_URL_ANNOTATION = 'backstage.io/view-url';
+export const EDIT_URL_ANNOTATION = 'backstage.io/edit-url';
diff --git a/packages/catalog-model/src/entity/index.ts b/packages/catalog-model/src/entity/index.ts
index e80e14f7a4..e267c607e1 100644
--- a/packages/catalog-model/src/entity/index.ts
+++ b/packages/catalog-model/src/entity/index.ts
@@ -17,6 +17,8 @@
export {
ENTITY_DEFAULT_NAMESPACE,
ENTITY_META_GENERATED_FIELDS,
+ VIEW_URL_ANNOTATION,
+ EDIT_URL_ANNOTATION,
} from './constants';
export type {
Entity,
diff --git a/packages/catalog-model/src/location/annotation.ts b/packages/catalog-model/src/location/annotation.ts
index 93f2fabea4..ba875c3edf 100644
--- a/packages/catalog-model/src/location/annotation.ts
+++ b/packages/catalog-model/src/location/annotation.ts
@@ -17,3 +17,5 @@
export const LOCATION_ANNOTATION = 'backstage.io/managed-by-location';
export const ORIGIN_LOCATION_ANNOTATION =
'backstage.io/managed-by-origin-location';
+
+export const SOURCE_LOCATION_ANNOTATION = 'backstage.io/source-location';
diff --git a/packages/catalog-model/src/location/index.ts b/packages/catalog-model/src/location/index.ts
index 8fd516120a..6cfb074613 100644
--- a/packages/catalog-model/src/location/index.ts
+++ b/packages/catalog-model/src/location/index.ts
@@ -20,4 +20,8 @@ export {
locationSpecSchema,
analyzeLocationSchema,
} from './validation';
-export { LOCATION_ANNOTATION, ORIGIN_LOCATION_ANNOTATION } from './annotation';
+export {
+ LOCATION_ANNOTATION,
+ ORIGIN_LOCATION_ANNOTATION,
+ SOURCE_LOCATION_ANNOTATION,
+} from './annotation';
diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md
index c40f7605eb..148af6fa8a 100644
--- a/packages/cli/CHANGELOG.md
+++ b/packages/cli/CHANGELOG.md
@@ -1,5 +1,22 @@
# @backstage/cli
+## 0.6.2
+
+### Patch Changes
+
+- e780e119c: Add missing `file-loader` dependency which could cause issues with loading images and other assets.
+- 6266ddd11: The `yarn backstage-cli app:diff` has been broken since a couple of months. The command to perform updates `yarn backstage-cli versions:bump` prints change logs which seems to be a good replacement for this command.
+- Updated dependencies [a1f5e6545]
+ - @backstage/config@0.1.3
+
+## 0.6.1
+
+### Patch Changes
+
+- 257a753ff: Updated transform of `.esm.js` files to be able to handle dynamic imports.
+- 9337f509d: Tweak error message in lockfile parsing to include more information.
+- 532bc0ec0: Upgrading to lerna@4.0.0.
+
## 0.6.0
### Minor Changes
diff --git a/packages/cli/config/jest.js b/packages/cli/config/jest.js
index 61cd83b7b0..94cf059cbd 100644
--- a/packages/cli/config/jest.js
+++ b/packages/cli/config/jest.js
@@ -83,10 +83,8 @@ async function getConfig() {
},
},
- // We build .esm.js files with plugin:build, so to be able to load these in tests they need to be transformed
- // TODO: jest is working on module support, it's possible that we can remove this in the future
transform: {
- '\\.esm\\.js$': require.resolve('jest-esm-transformer'),
+ '\\.esm\\.js$': require.resolve('./jestEsmTransform.js'), // See jestEsmTransform.js
'\\.(js|jsx|ts|tsx)$': require.resolve('ts-jest'),
'\\.(bmp|gif|jpg|jpeg|png|frag|xml|svg)$': require.resolve(
'./jestFileTransform.js',
diff --git a/packages/cli/config/jestEsmTransform.js b/packages/cli/config/jestEsmTransform.js
new file mode 100644
index 0000000000..99f1a600bc
--- /dev/null
+++ b/packages/cli/config/jestEsmTransform.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const babel = require('@babel/core');
+
+// We build .esm.js files with plugin:build, so to be able to load these in tests they need to be transformed
+// TODO: jest is working on module support, it's possible that we can remove this in the future
+module.exports = {
+ process(src) {
+ const result = babel.transform(src, {
+ babelrc: false,
+ compact: false,
+ plugins: [
+ // This transforms the regular ESM syntax, import and export statements
+ require.resolve('@babel/plugin-transform-modules-commonjs'),
+ // This transforms dynamic `import()`, which is not supported yet in the Node.js VM API
+ require.resolve('babel-plugin-dynamic-import-node'),
+ ],
+ });
+
+ return result.code;
+ },
+};
diff --git a/packages/cli/package.json b/packages/cli/package.json
index e54696ce43..4a95df0f38 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/cli",
"description": "CLI for developing Backstage plugins and apps",
- "version": "0.6.0",
+ "version": "0.6.2",
"private": false,
"publishConfig": {
"access": "public"
@@ -28,8 +28,10 @@
"backstage-cli": "bin/backstage-cli"
},
"dependencies": {
+ "@babel/core": "^7.4.4",
+ "@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@backstage/cli-common": "^0.1.1",
- "@backstage/config": "^0.1.2",
+ "@backstage/config": "^0.1.3",
"@backstage/config-loader": "^0.5.1",
"@hot-loader/react-dom": "^16.13.0",
"@lerna/package-graph": "^4.0.0",
@@ -53,6 +55,7 @@
"@typescript-eslint/eslint-plugin": "^v4.14.0",
"@typescript-eslint/parser": "^v4.14.0",
"@yarnpkg/lockfile": "^1.1.0",
+ "babel-plugin-dynamic-import-node": "^2.3.3",
"bfj": "^7.0.2",
"chalk": "^4.0.0",
"chokidar": "^3.3.1",
@@ -71,6 +74,7 @@
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^4.0.0",
"express": "^4.17.1",
+ "file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^4.0.5",
"fs-extra": "^9.0.0",
"handlebars": "^4.7.3",
@@ -78,7 +82,6 @@
"inquirer": "^7.0.4",
"jest": "^26.0.1",
"jest-css-modules": "^2.1.0",
- "jest-esm-transformer": "^1.0.0",
"lodash": "^4.17.19",
"mini-css-extract-plugin": "^0.9.0",
"ora": "^4.0.3",
@@ -113,11 +116,11 @@
"yn": "^4.0.0"
},
"devDependencies": {
- "@backstage/backend-common": "^0.5.2",
- "@backstage/config": "^0.1.2",
- "@backstage/core": "^0.6.0",
- "@backstage/dev-utils": "^0.1.9",
- "@backstage/test-utils": "^0.1.6",
+ "@backstage/backend-common": "^0.5.4",
+ "@backstage/config": "^0.1.3",
+ "@backstage/core": "^0.6.3",
+ "@backstage/dev-utils": "^0.1.12",
+ "@backstage/test-utils": "^0.1.8",
"@backstage/theme": "^0.2.3",
"@types/diff": "^4.0.2",
"@types/express": "^4.17.6",
diff --git a/packages/cli/src/commands/app/diff.ts b/packages/cli/src/commands/app/diff.ts
deleted file mode 100644
index a667407f23..0000000000
--- a/packages/cli/src/commands/app/diff.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2020 Spotify AB
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { Command } from 'commander';
-import {
- diffTemplateFiles,
- handlers,
- handleAllFiles,
- inquirerPromptFunc,
- makeCheckPromptFunc,
- yesPromptFunc,
-} from '../../lib/diff';
-import { version } from '../../lib/version';
-
-const fileHandlers = [
- {
- patterns: ['packages/app/package.json'],
- handler: handlers.appPackageJson,
- },
- {
- patterns: [/tsconfig\.json$/],
- handler: handlers.exactMatch,
- },
- {
- patterns: [
- /README\.md$/,
- /\.eslintrc\.js$/,
- // make sure files in 1st level of src/ and dev/ exist
- /^packages\/app\/(src|dev)\/[^/]+$/,
- ],
- handler: handlers.exists,
- },
- {
- patterns: [
- 'lerna.json',
- /^src\//,
- /^patches\//,
- /^packages\/app\/public\//,
- /^packages\/app\/cypress/,
- // Let plugin:diff take care of the plugins
- /^plugins/,
- /package\.json$/,
- ],
- handler: handlers.skip,
- },
-];
-
-export default async (cmd: Command) => {
- let promptFunc = inquirerPromptFunc;
- let finalize = () => {};
-
- if (cmd.check) {
- [promptFunc, finalize] = makeCheckPromptFunc();
- } else if (cmd.yes) {
- promptFunc = yesPromptFunc;
- }
-
- const templateFiles = await diffTemplateFiles('default-app', { version });
- await handleAllFiles(fileHandlers, templateFiles, promptFunc);
- await finalize();
-};
diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts
index 5fd7817a83..3a8ef36a97 100644
--- a/packages/cli/src/commands/index.ts
+++ b/packages/cli/src/commands/index.ts
@@ -76,13 +76,6 @@ export function registerCommands(program: CommanderStatic) {
.option(...configOption)
.action(lazy(() => import('./backend/dev').then(m => m.default)));
- program
- .command('app:diff')
- .option('--check', 'Fail if changes are required')
- .option('--yes', 'Apply all changes')
- .description('Diff an existing app with the creation template')
- .action(lazy(() => import('./app/diff').then(m => m.default)));
-
program
.command('create-plugin')
.option(
diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json
index 0b024b2c84..b905d3e8a4 100644
--- a/packages/config-loader/package.json
+++ b/packages/config-loader/package.json
@@ -36,7 +36,7 @@
"fs-extra": "^9.0.0",
"json-schema": "^0.2.5",
"json-schema-merge-allof": "^0.7.0",
- "typescript-json-schema": "^0.47.0",
+ "typescript-json-schema": "^0.49.0",
"yaml": "^1.9.2",
"yup": "^0.29.3"
},
diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md
index 06a9d8e4f1..cfc48fe21a 100644
--- a/packages/config/CHANGELOG.md
+++ b/packages/config/CHANGELOG.md
@@ -1,5 +1,19 @@
# @backstage/config
+## 0.1.3
+
+### Patch Changes
+
+- a1f5e6545: Adds an optional type to `config.get` & `config.getOptional`. This avoids the need for casting. For example:
+
+ ```ts
+ const config = useApi(configApiRef);
+
+ const myConfig = config.get('myPlugin.complexConfig');
+ // vs
+ const myConfig config.get('myPlugin.complexConfig') as SomeTypeDefinition;
+ ```
+
## 0.1.2
### Patch Changes
diff --git a/packages/config/package.json b/packages/config/package.json
index 4e6c2f7157..1eadb5d4e5 100644
--- a/packages/config/package.json
+++ b/packages/config/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/config",
"description": "Config API used by Backstage core, backend, and CLI",
- "version": "0.1.2",
+ "version": "0.1.3",
"private": false,
"publishConfig": {
"access": "public",
diff --git a/packages/config/src/reader.ts b/packages/config/src/reader.ts
index c690e0bbc9..99977d19cd 100644
--- a/packages/config/src/reader.ts
+++ b/packages/config/src/reader.ts
@@ -88,22 +88,22 @@ export class ConfigReader implements Config {
return [...new Set([...localKeys, ...fallbackKeys])];
}
- get(key?: string): JsonValue {
+ get(key?: string): T {
const value = this.getOptional(key);
if (value === undefined) {
throw new Error(errors.missing(this.fullKey(key ?? '')));
}
- return value;
+ return value as T;
}
- getOptional(key?: string): JsonValue | undefined {
+ getOptional(key?: string): T | undefined {
const value = this.readValue(key);
- const fallbackValue = this.fallback?.getOptional(key);
+ const fallbackValue = this.fallback?.getOptional(key);
if (value === undefined) {
return fallbackValue;
} else if (fallbackValue === undefined) {
- return value;
+ return value as T;
}
// Avoid merging arrays and primitive values, since that's how merging works for other
@@ -113,7 +113,7 @@ export class ConfigReader implements Config {
{ value: cloneDeep(fallbackValue) },
{ value },
(into, from) => (!isObject(from) || !isObject(into) ? from : undefined),
- ).value;
+ ).value as T;
}
getConfig(key: string): ConfigReader {
diff --git a/packages/config/src/types.ts b/packages/config/src/types.ts
index 840cc36173..92293a3f26 100644
--- a/packages/config/src/types.ts
+++ b/packages/config/src/types.ts
@@ -34,8 +34,8 @@ export type Config = {
keys(): string[];
- get(key?: string): JsonValue;
- getOptional(key?: string): JsonValue | undefined;
+ get(key?: string): T;
+ getOptional(key?: string): T | undefined;
getConfig(key: string): Config;
getOptionalConfig(key: string): Config | undefined;
diff --git a/packages/core-api/CHANGELOG.md b/packages/core-api/CHANGELOG.md
index a40e25b2a8..7fa7e71828 100644
--- a/packages/core-api/CHANGELOG.md
+++ b/packages/core-api/CHANGELOG.md
@@ -1,5 +1,37 @@
# @backstage/core-api
+## 0.2.11
+
+### Patch Changes
+
+- 3a58084b6: The `FlatRoutes` components now renders the not found page of the app if no routes are matched.
+- 1407b34c6: More informative error message for missing ApiContext.
+- b6c4f485d: Fix error when querying Backstage Identity with SAML authentication
+- 3a58084b6: Created separate `AppContext` type to be returned from `useApp` rather than the `BackstageApp` itself. The `AppContext` type includes but deprecates `getPlugins`, `getProvider`, `getRouter`, and `getRoutes`. In addition, the `AppContext` adds a new `getComponents` method which providers access to the app components.
+- Updated dependencies [a1f5e6545]
+ - @backstage/config@0.1.3
+
+## 0.2.10
+
+### Patch Changes
+
+- f10950bd2: Minor refactoring of BackstageApp.getSystemIcons to support custom registered
+ icons. Custom Icons can be added using:
+
+ ```tsx
+ import AlarmIcon from '@material-ui/icons/Alarm';
+ import MyPersonIcon from './MyPerson';
+
+ const app = createApp({
+ icons: {
+ user: MyPersonIcon // override system icon
+ alert: AlarmIcon, // Custom icon
+ },
+ });
+ ```
+
+- fd3f2a8c0: Export `createExternalRouteRef`, as well as give it an `id` for easier debugging, and fix parameter requirements when used with `useRouteRef`.
+
## 0.2.9
### Patch Changes
diff --git a/packages/core-api/package.json b/packages/core-api/package.json
index 927eca3490..d3eb0d7791 100644
--- a/packages/core-api/package.json
+++ b/packages/core-api/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-api",
"description": "Internal Core API used by Backstage plugins and apps",
- "version": "0.2.9",
+ "version": "0.2.11",
"private": false,
"publishConfig": {
"access": "public",
@@ -29,7 +29,7 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/config": "^0.1.2",
+ "@backstage/config": "^0.1.3",
"@backstage/theme": "^0.2.3",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
@@ -42,8 +42,8 @@
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.6.0",
- "@backstage/test-utils": "^0.1.6",
+ "@backstage/cli": "^0.6.2",
+ "@backstage/test-utils": "^0.1.8",
"@backstage/test-utils-core": "^0.1.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^10.4.1",
diff --git a/packages/core-api/src/apis/implementations/auth/saml/SamlAuth.ts b/packages/core-api/src/apis/implementations/auth/saml/SamlAuth.ts
index e05f6266d6..af97ad8f36 100644
--- a/packages/core-api/src/apis/implementations/auth/saml/SamlAuth.ts
+++ b/packages/core-api/src/apis/implementations/auth/saml/SamlAuth.ts
@@ -83,7 +83,7 @@ class SamlAuth implements ProfileInfoApi, BackstageIdentityApi, SessionApi {
}
async getBackstageIdentity(
- options: AuthRequestOptions,
+ options: AuthRequestOptions = {},
): Promise {
const session = await this.sessionManager.getSession(options);
return session?.backstageIdentity;
diff --git a/packages/core-api/src/apis/system/ApiProvider.test.tsx b/packages/core-api/src/apis/system/ApiProvider.test.tsx
index ac64aca3a7..71269697c2 100644
--- a/packages/core-api/src/apis/system/ApiProvider.test.tsx
+++ b/packages/core-api/src/apis/system/ApiProvider.test.tsx
@@ -108,11 +108,11 @@ describe('ApiProvider', () => {
withLogCollector(['error'], () => {
expect(() => {
render();
- }).toThrow('No ApiProvider available in react context');
+ }).toThrow(/^No ApiProvider available in react context. /);
}).error,
).toEqual([
expect.stringMatching(
- /^Error: Uncaught \[Error: No ApiProvider available in react context\]/,
+ /^Error: Uncaught \[Error: No ApiProvider available in react context. /,
),
expect.stringMatching(
/^The above error occurred in the component/,
@@ -123,11 +123,11 @@ describe('ApiProvider', () => {
withLogCollector(['error'], () => {
expect(() => {
render();
- }).toThrow('No ApiProvider available in react context');
+ }).toThrow(/^No ApiProvider available in react context. /);
}).error,
).toEqual([
expect.stringMatching(
- /^Error: Uncaught \[Error: No ApiProvider available in react context\]/,
+ /^Error: Uncaught \[Error: No ApiProvider available in react context. /,
),
expect.stringMatching(
/^The above error occurred in the component/,
diff --git a/packages/core-api/src/apis/system/ApiProvider.tsx b/packages/core-api/src/apis/system/ApiProvider.tsx
index 91d35e5ee7..d41730cb59 100644
--- a/packages/core-api/src/apis/system/ApiProvider.tsx
+++ b/packages/core-api/src/apis/system/ApiProvider.tsx
@@ -24,6 +24,12 @@ import PropTypes from 'prop-types';
import { ApiRef, ApiHolder, TypesToApiRefs } from './types';
import { ApiAggregator } from './ApiAggregator';
+const missingHolderMessage =
+ 'No ApiProvider available in react context. ' +
+ 'A common cause of this error is that multiple versions of @backstage/core-api are installed. ' +
+ `You can check if that is the case using 'yarn backstage-cli versions:check', and can in many cases ` +
+ `fix the issue either with the --fix flag or using 'yarn backstage-cli versions:bump'`;
+
type ApiProviderProps = {
apis: ApiHolder;
children: ReactNode;
@@ -50,7 +56,7 @@ export function useApiHolder(): ApiHolder {
const apiHolder = useContext(Context);
if (!apiHolder) {
- throw new Error('No ApiProvider available in react context');
+ throw new Error(missingHolderMessage);
}
return apiHolder;
@@ -74,7 +80,7 @@ export function withApis(apis: TypesToApiRefs) {
const apiHolder = useContext(Context);
if (!apiHolder) {
- throw new Error('No ApiProvider available in react context');
+ throw new Error(missingHolderMessage);
}
const impls = {} as T;
diff --git a/packages/core-api/src/app/App.tsx b/packages/core-api/src/app/App.tsx
index f50bcdd015..1cf2d892d0 100644
--- a/packages/core-api/src/app/App.tsx
+++ b/packages/core-api/src/app/App.tsx
@@ -64,6 +64,7 @@ import { AppThemeProvider } from './AppThemeProvider';
import {
AppComponents,
AppConfigLoader,
+ AppContext,
AppOptions,
AppRouteBinder,
BackstageApp,
@@ -139,6 +140,42 @@ function useConfigLoader(
return { api: configReader };
}
+class AppContextImpl implements AppContext {
+ constructor(private readonly app: PrivateAppImpl) {}
+
+ getPlugins(): BackstagePlugin[] {
+ // eslint-disable-next-line no-console
+ console.warn('appContext.getPlugins() is deprecated and will be removed');
+ return this.app.getPlugins();
+ }
+
+ getSystemIcon(key: IconKey): IconComponent | undefined {
+ return this.app.getSystemIcon(key);
+ }
+
+ getComponents(): AppComponents {
+ return this.app.getComponents();
+ }
+
+ getProvider(): React.ComponentType<{}> {
+ // eslint-disable-next-line no-console
+ console.warn('appContext.getProvider() is deprecated and will be removed');
+ return this.app.getProvider();
+ }
+
+ getRouter(): React.ComponentType<{}> {
+ // eslint-disable-next-line no-console
+ console.warn('appContext.getRouter() is deprecated and will be removed');
+ return this.app.getRouter();
+ }
+
+ getRoutes(): JSX.Element[] {
+ // eslint-disable-next-line no-console
+ console.warn('appContext.getRoutes() is deprecated and will be removed');
+ return this.app.getRoutes();
+ }
+}
+
export class PrivateAppImpl implements BackstageApp {
private apiHolder?: ApiHolder;
private configApi?: ConfigApi;
@@ -169,15 +206,17 @@ export class PrivateAppImpl implements BackstageApp {
return this.plugins;
}
- getSystemIcon(key: IconKey): IconComponent {
+ getSystemIcon(key: IconKey): IconComponent | undefined {
return this.icons[key];
}
+ getComponents(): AppComponents {
+ return this.components;
+ }
+
getRoutes(): JSX.Element[] {
const routes = new Array();
- const featureFlagsApi = this.getApiHolder().get(featureFlagsApiRef)!;
-
const { NotFoundErrorPage } = this.components;
for (const plugin of this.plugins.values()) {
@@ -211,13 +250,6 @@ export class PrivateAppImpl implements BackstageApp {
routes.push();
break;
}
- case 'feature-flag': {
- featureFlagsApi.registerFlag({
- name: output.name,
- pluginId: plugin.getId(),
- });
- break;
- }
default:
break;
}
@@ -236,6 +268,27 @@ export class PrivateAppImpl implements BackstageApp {
}
getProvider(): ComponentType<{}> {
+ const appContext = new AppContextImpl(this);
+ const apiHolder = this.getApiHolder();
+
+ const featureFlagsApi = this.getApiHolder().get(featureFlagsApiRef)!;
+
+ for (const plugin of this.plugins.values()) {
+ for (const output of plugin.output()) {
+ switch (output.type) {
+ case 'feature-flag': {
+ featureFlagsApi.registerFlag({
+ name: output.name,
+ pluginId: plugin.getId(),
+ });
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+
const Provider = ({ children }: PropsWithChildren<{}>) => {
const appThemeApi = useMemo(
() => AppThemeSelector.createWithStorage(this.themes),
@@ -272,8 +325,8 @@ export class PrivateAppImpl implements BackstageApp {
this.configApi = loadedConfig.api;
return (
-
-
+
+ (undefined);
+const Context = createContext(undefined);
type Props = {
- app: BackstageApp;
+ appContext: AppContext;
};
export const AppContextProvider = ({
- app,
+ appContext,
children,
}: PropsWithChildren) => (
-
+
);
-export const useApp = (): BackstageApp => {
- const app = useContext(Context);
- if (!app) {
+export const useApp = (): AppContext => {
+ const appContext = useContext(Context);
+ if (!appContext) {
throw new Error('No app context available');
}
- return app;
+ return appContext;
};
diff --git a/packages/core-api/src/app/types.ts b/packages/core-api/src/app/types.ts
index 1970868ca6..ec7b70689d 100644
--- a/packages/core-api/src/app/types.ts
+++ b/packages/core-api/src/app/types.ts
@@ -171,7 +171,7 @@ export type BackstageApp = {
/**
* Get a common or custom icon for this app.
*/
- getSystemIcon(key: IconKey): IconComponent;
+ getSystemIcon(key: IconKey): IconComponent | undefined;
/**
* Provider component that should wrap the Router created with getRouter()
@@ -187,6 +187,40 @@ export type BackstageApp = {
/**
* Routes component that contains all routes for plugin pages in the app.
+ *
+ * @deprecated Registering routes in plugins is deprecated and this method will be removed.
+ */
+ getRoutes(): JSX.Element[];
+};
+
+export type AppContext = {
+ /**
+ * @deprecated Will be removed
+ */
+ getPlugins(): BackstagePlugin[];
+
+ /**
+ * Get a common or custom icon for this app.
+ */
+ getSystemIcon(key: IconKey): IconComponent | undefined;
+
+ /**
+ * Get the components registered for various purposes in the app.
+ */
+ getComponents(): AppComponents;
+
+ /**
+ * @deprecated Will be removed
+ */
+ getProvider(): ComponentType<{}>;
+
+ /**
+ * @deprecated Will be removed
+ */
+ getRouter(): ComponentType<{}>;
+
+ /**
+ * @deprecated Will be removed
*/
getRoutes(): JSX.Element[];
};
diff --git a/packages/core-api/src/extensions/componentData.test.tsx b/packages/core-api/src/extensions/componentData.test.tsx
index 6c4abda40f..cb0918b290 100644
--- a/packages/core-api/src/extensions/componentData.test.tsx
+++ b/packages/core-api/src/extensions/componentData.test.tsx
@@ -59,4 +59,63 @@ describe('elementData', () => {
'Attempted to attach duplicate data "my-data" to component "MyComponent"',
);
});
+
+ describe('works across versions', () => {
+ function getDataSymbol() {
+ const Component = () => null;
+ attachComponentData(Component, 'my-data', {});
+ const [symbol] = Object.getOwnPropertySymbols(Component);
+ return symbol;
+ }
+
+ it('should should be able to get data from older versions', () => {
+ const symbol = getDataSymbol();
+
+ const data = { foo: 'bar' };
+ const Component = () => null;
+ attachComponentData(Component, 'my-data', data);
+
+ const element = ;
+ expect((element as any).type[symbol].map.get('my-data')).toBe(data);
+ });
+
+ it('should should be able to attach data for older versions', () => {
+ const symbol = getDataSymbol();
+
+ const data = { foo: 'bar' };
+ const Component = () => null;
+ (Component as any)[symbol] = {
+ map: new Map([['my-data', data]]),
+ };
+
+ const element = ;
+ expect(getComponentData(element, 'my-data')).toBe(data);
+ });
+
+ it('should be able to get data from newer versions', () => {
+ const data = { foo: 'bar' };
+ const Component = () => null;
+ attachComponentData(Component, 'my-data', data);
+
+ const element = ;
+ const container = (global as any)[
+ '__@backstage/component-data-store__'
+ ].store.get(element.type);
+ expect(container.map.get('my-data')).toBe(data);
+ });
+
+ it('should should be able to attach data for newer versions', () => {
+ const data = { foo: 'bar' };
+ const Component = () => null;
+ (global as any)['__@backstage/component-data-store__'].store.set(
+ Component,
+ {
+ map: new Map([['my-data', data]]),
+ },
+ );
+
+ const element = ;
+ expect(getComponentData(element, 'my-data')).toBe(data);
+ });
+ });
});
diff --git a/packages/core-api/src/extensions/componentData.tsx b/packages/core-api/src/extensions/componentData.tsx
index 1f88356a48..3d2558276d 100644
--- a/packages/core-api/src/extensions/componentData.tsx
+++ b/packages/core-api/src/extensions/componentData.tsx
@@ -15,21 +15,40 @@
*/
import { ComponentType, ReactNode } from 'react';
+import { globalObject } from '../lib/globalObject';
+// TODO(Rugvip): Access via symbol is deprecated, remove once on 0.3.x
const DATA_KEY = Symbol('backstage-component-data');
-type DataContainer = {
- map: Map;
-};
-
type ComponentWithData
= ComponentType
& {
[DATA_KEY]?: DataContainer;
};
-type ReactNodeWithData = ReactNode & {
- type?: { [DATA_KEY]?: DataContainer };
+type DataContainer = {
+ map: Map;
};
+type MaybeComponentNode = ReactNode & {
+ type?: ComponentType & { [DATA_KEY]?: DataContainer };
+};
+
+const GLOBAL_KEY = '__@backstage/component-data-store__';
+
+// The store is bridged across versions using the global object
+function getStore() {
+ let storeObj = globalObject[GLOBAL_KEY] as
+ | { store: WeakMap, DataContainer> }
+ | undefined;
+ if (!storeObj) {
+ const store = new WeakMap, DataContainer>();
+ storeObj = { store };
+ globalObject[GLOBAL_KEY] = storeObj;
+ }
+ return storeObj.store;
+}
+
+const store = getStore();
+
export function attachComponentData
(
component: ComponentType
,
type: string,
@@ -37,9 +56,11 @@ export function attachComponentData
(
) {
const dataComponent = component as ComponentWithData
;
- let container = dataComponent[DATA_KEY];
+ let container = store.get(component) || dataComponent[DATA_KEY];
if (!container) {
- container = dataComponent[DATA_KEY] = { map: new Map() };
+ container = { map: new Map() };
+ store.set(component, container);
+ dataComponent[DATA_KEY] = container;
}
if (container.map.has(type)) {
@@ -60,7 +81,12 @@ export function getComponentData(
return undefined;
}
- const container = (node as ReactNodeWithData).type?.[DATA_KEY];
+ const component = (node as MaybeComponentNode).type;
+ if (!component) {
+ return undefined;
+ }
+
+ const container = store.get(component) || component[DATA_KEY];
if (!container) {
return undefined;
}
diff --git a/packages/core-api/src/icons/icons.tsx b/packages/core-api/src/icons/icons.tsx
index 0c2b580ea7..49db90efcc 100644
--- a/packages/core-api/src/icons/icons.tsx
+++ b/packages/core-api/src/icons/icons.tsx
@@ -15,31 +15,46 @@
*/
import { SvgIconProps } from '@material-ui/core';
+import MuiBrokenImageIcon from '@material-ui/icons/BrokenImage';
+import MuiChatIcon from '@material-ui/icons/Chat';
import MuiDashboardIcon from '@material-ui/icons/Dashboard';
+import MuiEmailIcon from '@material-ui/icons/Email';
+import MuiGitHubIcon from '@material-ui/icons/GitHub';
import MuiHelpIcon from '@material-ui/icons/Help';
-import PeopleIcon from '@material-ui/icons/People';
-import PersonIcon from '@material-ui/icons/Person';
+import MuiPeopleIcon from '@material-ui/icons/People';
+import MuiPersonIcon from '@material-ui/icons/Person';
+import MuiWarningIcon from '@material-ui/icons/Warning';
import React from 'react';
import { useApp } from '../app/AppContext';
-import { IconComponent, SystemIconKey, IconComponentMap } from './types';
+import { IconComponent, IconComponentMap, SystemIconKey } from './types';
export const defaultSystemIcons: IconComponentMap = {
- user: PersonIcon,
- group: PeopleIcon,
+ brokenImage: MuiBrokenImageIcon,
+ chat: MuiChatIcon,
dashboard: MuiDashboardIcon,
+ email: MuiEmailIcon,
+ github: MuiGitHubIcon,
+ group: MuiPeopleIcon,
help: MuiHelpIcon,
+ user: MuiPersonIcon,
+ warning: MuiWarningIcon,
};
const overridableSystemIcon = (key: SystemIconKey): IconComponent => {
const Component = (props: SvgIconProps) => {
const app = useApp();
const Icon = app.getSystemIcon(key);
- return ;
+ return Icon ? : ;
};
return Component;
};
+export const BrokenImageIcon = overridableSystemIcon('brokenImage');
+export const ChatIcon = overridableSystemIcon('chat');
export const DashboardIcon = overridableSystemIcon('dashboard');
+export const EmailIcon = overridableSystemIcon('email');
+export const GitHubIcon = overridableSystemIcon('github');
export const GroupIcon = overridableSystemIcon('group');
export const HelpIcon = overridableSystemIcon('help');
export const UserIcon = overridableSystemIcon('user');
+export const WarningIcon = overridableSystemIcon('warning');
diff --git a/packages/core-api/src/icons/types.ts b/packages/core-api/src/icons/types.ts
index be24b223ae..c4634bd00a 100644
--- a/packages/core-api/src/icons/types.ts
+++ b/packages/core-api/src/icons/types.ts
@@ -17,7 +17,16 @@
import { ComponentType } from 'react';
import { SvgIconProps } from '@material-ui/core';
-export type SystemIconKey = 'user' | 'group' | 'dashboard' | 'help';
+export type SystemIconKey =
+ | 'brokenImage'
+ | 'chat'
+ | 'dashboard'
+ | 'email'
+ | 'github'
+ | 'group'
+ | 'help'
+ | 'user'
+ | 'warning';
export type IconComponent = ComponentType;
export type IconKey = SystemIconKey | string;
diff --git a/packages/core-api/src/lib/globalObject.ts b/packages/core-api/src/lib/globalObject.ts
new file mode 100644
index 0000000000..85f16212fe
--- /dev/null
+++ b/packages/core-api/src/lib/globalObject.ts
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2021 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
+function getGlobal() {
+ if (typeof window !== 'undefined' && window.Math === Math) {
+ return window;
+ }
+ if (typeof self !== 'undefined' && self.Math === Math) {
+ return self;
+ }
+ // eslint-disable-next-line no-new-func
+ return Function('return this')();
+}
+
+export const globalObject = getGlobal();
diff --git a/packages/core-api/src/routing/FlatRoutes.tsx b/packages/core-api/src/routing/FlatRoutes.tsx
index cefb347290..3702442811 100644
--- a/packages/core-api/src/routing/FlatRoutes.tsx
+++ b/packages/core-api/src/routing/FlatRoutes.tsx
@@ -14,8 +14,9 @@
* limitations under the License.
*/
-import { ReactNode, Children, isValidElement, Fragment } from 'react';
+import React, { ReactNode, Children, isValidElement, Fragment } from 'react';
import { useRoutes } from 'react-router-dom';
+import { useApp } from '../app';
type RouteObject = {
path: string;
@@ -71,6 +72,15 @@ type FlatRoutesProps = {
};
export const FlatRoutes = (props: FlatRoutesProps): JSX.Element | null => {
+ const app = useApp();
+ const { NotFoundErrorPage } = app.getComponents();
const routes = createRoutesFromChildren(props.children);
+
+ // TODO(Rugvip): Possibly add a way to skip this, like a noNotFoundPage prop
+ routes.push({
+ element: ,
+ path: '/*',
+ });
+
return useRoutes(routes);
};
diff --git a/packages/core-api/src/routing/index.ts b/packages/core-api/src/routing/index.ts
index ad88f8ff02..100158c3c5 100644
--- a/packages/core-api/src/routing/index.ts
+++ b/packages/core-api/src/routing/index.ts
@@ -21,6 +21,10 @@ export type {
MutableRouteRef,
} from './types';
export { FlatRoutes } from './FlatRoutes';
-export { createRouteRef, createExternalRouteRef } from './RouteRef';
+export {
+ createRouteRef,
+ createExternalRouteRef,
+ ExternalRouteRef,
+} from './RouteRef';
export type { RouteRefConfig } from './RouteRef';
export { useRouteRef } from './hooks';
diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md
index a5a56f633a..81fe728101 100644
--- a/packages/core/CHANGELOG.md
+++ b/packages/core/CHANGELOG.md
@@ -1,5 +1,44 @@
# @backstage/core
+## 0.6.3
+
+### Patch Changes
+
+- 3a58084b6: The `FlatRoutes` components now renders the not found page of the app if no routes are matched.
+- e799e74d4: Fix `OverflowTooltip` cutting off the bottom of letters like "g" and "y".
+- 1407b34c6: More informative error message for missing ApiContext.
+- 9615e68fb: Forward link styling of `EntityRefLink` and `EnriryRefLinks` into the underling
+ `Link`.
+- 49f9b7346: Deprecate `type` of `ItemCard` and introduce new `subtitle` which allows passing
+ react nodes.
+- 3a58084b6: Created separate `AppContext` type to be returned from `useApp` rather than the `BackstageApp` itself. The `AppContext` type includes but deprecates `getPlugins`, `getProvider`, `getRouter`, and `getRoutes`. In addition, the `AppContext` adds a new `getComponents` method which providers access to the app components.
+- 2c1f2a7c2: Introduced generic OverflowTooltip component for cases where longer text needs to be truncated with ellipsis and show hover tooltip with full text. This is particularly useful in the cases where longer description text is rendered in table. e.g. CatalogTable and ApiExplorerTable.
+- Updated dependencies [3a58084b6]
+- Updated dependencies [1407b34c6]
+- Updated dependencies [b6c4f485d]
+- Updated dependencies [3a58084b6]
+- Updated dependencies [a1f5e6545]
+ - @backstage/core-api@0.2.11
+ - @backstage/config@0.1.3
+
+## 0.6.2
+
+### Patch Changes
+
+- fd3f2a8c0: Export `createExternalRouteRef`, as well as give it an `id` for easier debugging, and fix parameter requirements when used with `useRouteRef`.
+- f4c2bcf54: Use a more strict type for `variant` of cards.
+- 07e226872: Export Select component
+- f62e7abe5: Make sure that SidebarItems are also active when on sub route.
+- 96f378d10: Add support for custom empty state of `Table` components.
+
+ You can now optionally pass `emptyContent` to `Table` that is displayed
+ if the table has now rows.
+
+- 688b73110: Add Breadcrumbs component
+- Updated dependencies [f10950bd2]
+- Updated dependencies [fd3f2a8c0]
+ - @backstage/core-api@0.2.10
+
## 0.6.1
### Patch Changes
diff --git a/packages/core/config.d.ts b/packages/core/config.d.ts
index a6f95ae71c..9e43c6f3ad 100644
--- a/packages/core/config.d.ts
+++ b/packages/core/config.d.ts
@@ -30,6 +30,41 @@ export interface Config {
* @visibility frontend
*/
title?: string;
+
+ /**
+ * Information about support of this Backstage instance and how to contact the integrator team.
+ */
+ support?: {
+ /**
+ * The primary support url.
+ * @visibility frontend
+ */
+ url: string;
+ /**
+ * A list of categorized support item groupings.
+ */
+ items: {
+ /**
+ * The title of the support item grouping.
+ * @visibility frontend
+ */
+ title: string;
+ /**
+ * An optional icon for the support item grouping.
+ * @visibility frontend
+ */
+ icon?: string;
+ /**
+ * A list of support links for the Backstage instance.
+ */
+ links: {
+ /** @visibility frontend */
+ url: string;
+ /** @visibility frontend */
+ title?: string;
+ }[];
+ }[];
+ };
};
/**
diff --git a/packages/core/package.json b/packages/core/package.json
index c9045c6465..c2fae32d6c 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -1,7 +1,7 @@
{
"name": "@backstage/core",
"description": "Core API used by Backstage plugins and apps",
- "version": "0.6.1",
+ "version": "0.6.3",
"private": false,
"publishConfig": {
"access": "public",
@@ -29,28 +29,29 @@
"clean": "backstage-cli clean"
},
"dependencies": {
- "@backstage/config": "^0.1.2",
- "@backstage/core-api": "^0.2.8",
+ "@backstage/config": "^0.1.3",
+ "@backstage/core-api": "^0.2.11",
"@backstage/theme": "^0.2.3",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"@testing-library/react-hooks": "^3.4.2",
"@types/dagre": "^0.7.44",
+ "@types/prop-types": "^15.7.3",
"@types/react": "^16.9",
"@types/react-sparklines": "^1.7.0",
- "@types/prop-types": "^15.7.3",
+ "@types/react-text-truncate": "^0.14.0",
"classnames": "^2.2.6",
"clsx": "^1.1.0",
"d3-selection": "^2.0.0",
"d3-shape": "^2.0.0",
"d3-zoom": "^2.0.0",
"dagre": "^0.8.5",
- "qs": "^6.9.4",
"immer": "^8.0.1",
"lodash": "^4.17.15",
"material-table": "^1.69.1",
"prop-types": "^15.7.2",
+ "qs": "^6.9.4",
"rc-progress": "^3.0.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
@@ -61,13 +62,14 @@
"react-router-dom": "6.0.0-beta.0",
"react-sparklines": "^1.7.0",
"react-syntax-highlighter": "^13.5.1",
+ "react-text-truncate": "^0.16.0",
"react-use": "^15.3.3",
"remark-gfm": "^1.0.0",
"zen-observable": "^0.8.15"
},
"devDependencies": {
- "@backstage/cli": "^0.6.0",
- "@backstage/test-utils": "^0.1.7",
+ "@backstage/cli": "^0.6.2",
+ "@backstage/test-utils": "^0.1.8",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^10.4.1",
"@testing-library/user-event": "^12.0.7",
diff --git a/packages/core/src/components/Link/Link.tsx b/packages/core/src/components/Link/Link.tsx
index b551b0511d..cd74b681db 100644
--- a/packages/core/src/components/Link/Link.tsx
+++ b/packages/core/src/components/Link/Link.tsx
@@ -14,17 +14,17 @@
* limitations under the License.
*/
-import React, { ElementType } from 'react';
import {
Link as MaterialLink,
LinkProps as MaterialLinkProps,
} from '@material-ui/core';
+import React, { ElementType } from 'react';
import {
Link as RouterLink,
LinkProps as RouterLinkProps,
} from 'react-router-dom';
-type Props = MaterialLinkProps &
+export type LinkProps = MaterialLinkProps &
RouterLinkProps & {
component?: ElementType;
};
@@ -33,7 +33,7 @@ type Props = MaterialLinkProps &
* Thin wrapper on top of material-ui's Link component
* Makes the Link to utilise react-router
*/
-export const Link = React.forwardRef((props, ref) => {
+export const Link = React.forwardRef((props, ref) => {
const to = String(props.to);
return /^https?:\/\//.test(to) ? (
// External links
diff --git a/packages/core/src/components/Link/index.ts b/packages/core/src/components/Link/index.ts
index 18e990181c..9be779feb7 100644
--- a/packages/core/src/components/Link/index.ts
+++ b/packages/core/src/components/Link/index.ts
@@ -15,3 +15,4 @@
*/
export { Link } from './Link';
+export type { LinkProps } from './Link';
diff --git a/packages/core/src/components/OverflowTooltip/OverflowTooltip.stories.tsx b/packages/core/src/components/OverflowTooltip/OverflowTooltip.stories.tsx
new file mode 100644
index 0000000000..e0cbe7c814
--- /dev/null
+++ b/packages/core/src/components/OverflowTooltip/OverflowTooltip.stories.tsx
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { Box } from '@material-ui/core';
+import React from 'react';
+import { OverflowTooltip } from './OverflowTooltip';
+
+export default {
+ title: 'Data Display/OverflowTooltip',
+ component: OverflowTooltip,
+};
+
+const text =
+ 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.';
+
+export const Default = () => (
+
+
+
+);
+
+export const MultiLine = () => (
+
+
+
+);
+
+export const DifferentTitle = () => (
+
+
+
+);
diff --git a/packages/core/src/components/OverflowTooltip/OverflowTooltip.tsx b/packages/core/src/components/OverflowTooltip/OverflowTooltip.tsx
new file mode 100644
index 0000000000..faf064f9f4
--- /dev/null
+++ b/packages/core/src/components/OverflowTooltip/OverflowTooltip.tsx
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { makeStyles, Tooltip, TooltipProps } from '@material-ui/core';
+import React, { useState } from 'react';
+import TextTruncate, { TextTruncateProps } from 'react-text-truncate';
+
+type Props = {
+ text: TextTruncateProps['text'];
+ line?: TextTruncateProps['line'];
+ element?: TextTruncateProps['element'];
+ title?: TooltipProps['title'];
+ placement?: TooltipProps['placement'];
+};
+
+const useStyles = makeStyles({
+ container: {
+ overflow: 'visible !important',
+ },
+});
+
+export const OverflowTooltip = (props: Props) => {
+ const [hover, setHover] = useState(false);
+ const classes = useStyles();
+
+ const handleToggled = (truncated: boolean) => {
+ setHover(truncated);
+ };
+
+ return (
+
+
+
+ );
+};
diff --git a/plugins/scaffolder/src/components/JobStage/index.ts b/packages/core/src/components/OverflowTooltip/index.ts
similarity index 91%
rename from plugins/scaffolder/src/components/JobStage/index.ts
rename to packages/core/src/components/OverflowTooltip/index.ts
index d6d3534a88..fe51e8267f 100644
--- a/plugins/scaffolder/src/components/JobStage/index.ts
+++ b/packages/core/src/components/OverflowTooltip/index.ts
@@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-export { JobStage } from './JobStage';
+export { OverflowTooltip } from './OverflowTooltip';
diff --git a/packages/core/src/components/ProgressBars/GaugeCard.tsx b/packages/core/src/components/ProgressBars/GaugeCard.tsx
index 7f281c67a5..2154619b01 100644
--- a/packages/core/src/components/ProgressBars/GaugeCard.tsx
+++ b/packages/core/src/components/ProgressBars/GaugeCard.tsx
@@ -16,14 +16,14 @@
import React from 'react';
import { makeStyles } from '@material-ui/core';
-import { InfoCard } from '../../layout/InfoCard';
+import { InfoCard, InfoCardVariants } from '../../layout/InfoCard';
import { BottomLinkProps } from '../../layout/BottomLink';
import { Gauge } from './Gauge';
type Props = {
title: string;
subheader?: string;
- variant?: string;
+ variant?: InfoCardVariants;
/** Progress in % specified as decimal, e.g. "0.23" */
progress: number;
deepLink?: BottomLinkProps;
diff --git a/packages/core/src/components/SupportButton/SupportButton.tsx b/packages/core/src/components/SupportButton/SupportButton.tsx
index 2a1b810582..7c532c0f8f 100644
--- a/packages/core/src/components/SupportButton/SupportButton.tsx
+++ b/packages/core/src/components/SupportButton/SupportButton.tsx
@@ -14,35 +14,26 @@
* limitations under the License.
*/
-import React, {
- Fragment,
- useState,
- MouseEventHandler,
- PropsWithChildren,
-} from 'react';
+import { HelpIcon, useApp } from '@backstage/core-api';
import {
Button,
- Link,
List,
ListItem,
ListItemIcon,
- Popover,
- Typography,
- makeStyles,
ListItemText,
+ makeStyles,
+ Popover,
} from '@material-ui/core';
-import GroupIcon from '@material-ui/icons/Group';
-import HelpIcon from '@material-ui/icons/Help';
+import React, {
+ Fragment,
+ MouseEventHandler,
+ PropsWithChildren,
+ useState,
+} from 'react';
+import { SupportItem, SupportItemLink, useSupportConfig } from '../../hooks';
+import { Link } from '../Link';
-// import { EmailIcon, SlackIcon, SupportIcon } from 'shared/icons';
-// import { Button, Link } from 'shared/components';
-// import { StackOverflow, StackOverflowTag } from 'shared/components/layout';
-
-type Props = {
- slackChannel?: string | string[];
- email?: string | string[];
- plugin?: any;
-};
+type Props = {};
const useStyles = makeStyles(theme => ({
leftIcon: {
@@ -50,17 +41,45 @@ const useStyles = makeStyles(theme => ({
},
popoverList: {
minWidth: 260,
- maxWidth: 320,
+ maxWidth: 400,
},
}));
-export const SupportButton = ({
- slackChannel = '#backstage',
- email = [],
- children,
-}: // plugin,
-PropsWithChildren) => {
- // TODO: get plugin manifest with hook
+const SupportIcon = ({ icon }: { icon: string | undefined }) => {
+ const app = useApp();
+ const Icon = icon ? app.getSystemIcon(icon) ?? HelpIcon : HelpIcon;
+ return ;
+};
+
+const SupportLink = ({ link }: { link: SupportItemLink }) => (
+
+ {link.title ?? link.url}
+
+);
+
+const SupportListItem = ({ item }: { item: SupportItem }) => {
+ return (
+
+
+
+
+
+ {item.links &&
+ item.links.map(link => (
+
+ ))}
+ >
+ }
+ />
+
+ );
+};
+
+export const SupportButton = ({ children }: PropsWithChildren) => {
+ const { items } = useSupportConfig();
const [popoverOpen, setPopoverOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState(null);
@@ -75,12 +94,6 @@ PropsWithChildren) => {
setPopoverOpen(false);
};
- // const tags = plugin ? plugin.stackoverflowTags : undefined;
- const slackChannels = Array.isArray(slackChannel)
- ? slackChannel
- : [slackChannel];
- const contactEmails = Array.isArray(email) ? email : [email];
-
return (
diff --git a/packages/core/src/components/index.ts b/packages/core/src/components/index.ts
index 28056b33bf..58d0a8f569 100644
--- a/packages/core/src/components/index.ts
+++ b/packages/core/src/components/index.ts
@@ -29,6 +29,7 @@ export * from './Lifecycle';
export * from './Link';
export * from './MarkdownContent';
export * from './OAuthRequestDialog';
+export * from './OverflowTooltip';
export * from './Progress';
export * from './ProgressBars';
export * from './Select';
diff --git a/packages/core/src/hooks/index.ts b/packages/core/src/hooks/index.ts
index a77a0eb8a4..6408790b8d 100644
--- a/packages/core/src/hooks/index.ts
+++ b/packages/core/src/hooks/index.ts
@@ -15,3 +15,9 @@
*/
export { useQueryParamState } from './useQueryParamState';
+export { useSupportConfig } from './useSupportConfig';
+export type {
+ SupportConfig,
+ SupportItem,
+ SupportItemLink,
+} from './useSupportConfig';
diff --git a/packages/core/src/hooks/useSupportConfig.ts b/packages/core/src/hooks/useSupportConfig.ts
new file mode 100644
index 0000000000..e77c64dd85
--- /dev/null
+++ b/packages/core/src/hooks/useSupportConfig.ts
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2020 Spotify AB
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { useApi, configApiRef } from '@backstage/core-api';
+
+export type SupportItemLink = {
+ url: string;
+ title: string;
+};
+
+export type SupportItem = {
+ title: string;
+ icon?: string;
+ links: SupportItemLink[];
+};
+
+export type SupportConfig = {
+ url: string;
+ items: SupportItem[];
+};
+
+const DEFAULT_SUPPORT_CONFIG: SupportConfig = {
+ url: 'https://github.com/backstage/backstage/issues',
+ items: [
+ {
+ title: 'Support Not Configured',
+ icon: 'warning',
+ links: [
+ {
+ // TODO: Update to dedicated support page on backstage.io/docs
+ title: 'Add `app.support` config key',
+ url:
+ 'https://github.com/andrewthauer/backstage/blob/master/app-config.yaml',
+ },
+ ],
+ },
+ ],
+};
+
+export function useSupportConfig(): SupportConfig {
+ const config = useApi(configApiRef);
+ const supportConfig = config.getOptionalConfig('app.support');
+
+ if (!supportConfig) {
+ return DEFAULT_SUPPORT_CONFIG;
+ }
+
+ return {
+ url: supportConfig.getString('url'),
+ items: supportConfig.getConfigArray('items').flatMap(itemConf => ({
+ title: itemConf.getString('title'),
+ icon: itemConf.getOptionalString('icon'),
+ links: (itemConf.getOptionalConfigArray('links') ?? []).flatMap(
+ linkConf => ({
+ url: linkConf.getString('url'),
+ title: linkConf.getString('title'),
+ }),
+ ),
+ })),
+ };
+}
diff --git a/packages/core/src/layout/ErrorPage/ErrorPage.tsx b/packages/core/src/layout/ErrorPage/ErrorPage.tsx
index 776ed41614..466c2f46b6 100644
--- a/packages/core/src/layout/ErrorPage/ErrorPage.tsx
+++ b/packages/core/src/layout/ErrorPage/ErrorPage.tsx
@@ -20,6 +20,7 @@ import { makeStyles } from '@material-ui/core/styles';
import { BackstageTheme } from '@backstage/theme';
import { MicDrop } from './MicDrop';
import { useNavigate } from 'react-router';
+import { useSupportConfig } from '../../hooks';
interface IErrorPageProps {
status: string;
@@ -53,6 +54,7 @@ export const ErrorPage = ({
}: IErrorPageProps) => {
const classes = useStyles();
const navigate = useNavigate();
+ const support = useSupportConfig();
return (
@@ -71,13 +73,11 @@ export const ErrorPage = ({
navigate(-1)}>
Go back
- ... or if you think this is a bug, please file an{' '}
-
- issue.
-
+ ... or please{' '}
+
+ contact support
+ {' '}
+ if you think this is a bug.
diff --git a/packages/core/src/layout/InfoCard/InfoCard.tsx b/packages/core/src/layout/InfoCard/InfoCard.tsx
index af10010d14..cf06a5f0a1 100644
--- a/packages/core/src/layout/InfoCard/InfoCard.tsx
+++ b/packages/core/src/layout/InfoCard/InfoCard.tsx
@@ -87,6 +87,8 @@ const VARIANT_STYLES = {
},
};
+export type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';
+
/**
* InfoCard is used to display a paper-styled block on the screen, similar to a panel.
*
@@ -111,7 +113,7 @@ type Props = {
divider?: boolean;
deepLink?: BottomLinkProps;
slackChannel?: string;
- variant?: string;
+ variant?: InfoCardVariants;
style?: object;
cardStyle?: object;
children?: ReactNode;
diff --git a/packages/core/src/layout/InfoCard/index.ts b/packages/core/src/layout/InfoCard/index.ts
index d77fcf93c4..35829662d0 100644
--- a/packages/core/src/layout/InfoCard/index.ts
+++ b/packages/core/src/layout/InfoCard/index.ts
@@ -15,3 +15,4 @@
*/
export { InfoCard } from './InfoCard';
+export type { InfoCardVariants } from './InfoCard';
diff --git a/packages/core/src/layout/ItemCard/ItemCard.stories.tsx b/packages/core/src/layout/ItemCard/ItemCard.stories.tsx
index b53fa9eb7a..eea78562e8 100644
--- a/packages/core/src/layout/ItemCard/ItemCard.stories.tsx
+++ b/packages/core/src/layout/ItemCard/ItemCard.stories.tsx
@@ -30,7 +30,7 @@ export const Default = () => (
title="Item Card"
description="This is the description of an Item Card"
label="Button"
- type="Pretitle"
+ subtitle="Pretitle"
onClick={() => {}}
/>
@@ -39,7 +39,7 @@ export const Default = () => (
title="Item Card"
description="This is the description of an Item Card"
label="Button"
- type="Pretitle"
+ subtitle="Pretitle"
onClick={() => {}}
/>
diff --git a/packages/core/src/layout/ItemCard/ItemCard.test.tsx b/packages/core/src/layout/ItemCard/ItemCard.test.tsx
index 6afeb16c5b..30cf95fd85 100644
--- a/packages/core/src/layout/ItemCard/ItemCard.test.tsx
+++ b/packages/core/src/layout/ItemCard/ItemCard.test.tsx
@@ -14,25 +14,35 @@
* limitations under the License.
*/
-import React from 'react';
import { renderInTestApp } from '@backstage/test-utils';
+import React from 'react';
import { ItemCard } from './ItemCard';
const minProps = {
description: 'This is the description of an Item Card',
label: 'Button',
title: 'Item Card',
- type: 'Pretitle',
};
describe('', () => {
it('renders default without exploding', async () => {
- const { description, label, title, type } = minProps;
+ const { description, label, title } = minProps;
const { getByText } = await renderInTestApp();
expect(getByText(description)).toBeInTheDocument();
expect(getByText(title)).toBeInTheDocument();
expect(getByText(label)).toBeInTheDocument();
- expect(getByText(type)).toBeInTheDocument();
+ });
+
+ it('renders with subtitle without exploding', async () => {
+ const { description, label, title } = minProps;
+ const subtitle = 'Pretitle';
+ const { getByText } = await renderInTestApp(
+ ,
+ );
+ expect(getByText(description)).toBeInTheDocument();
+ expect(getByText(title)).toBeInTheDocument();
+ expect(getByText(label)).toBeInTheDocument();
+ expect(getByText(subtitle)).toBeInTheDocument();
});
it('renders with tags without exploding', async () => {
diff --git a/packages/core/src/layout/ItemCard/ItemCard.tsx b/packages/core/src/layout/ItemCard/ItemCard.tsx
index 4242cd6381..9e16def5d3 100644
--- a/packages/core/src/layout/ItemCard/ItemCard.tsx
+++ b/packages/core/src/layout/ItemCard/ItemCard.tsx
@@ -15,7 +15,7 @@
*/
import { Button, Card, Chip, makeStyles, Typography } from '@material-ui/core';
import clsx from 'clsx';
-import React from 'react';
+import React, { ReactNode } from 'react';
import { Link } from '../../components';
const useStyles = makeStyles(theme => ({
@@ -45,7 +45,9 @@ type ItemCardProps = {
description?: string;
tags?: string[];
title: string;
+ /** @deprecated Use subtitle instead */
type?: string;
+ subtitle?: ReactNode;
label: string;
onClick?: () => void;
href?: string;
@@ -56,6 +58,7 @@ export const ItemCard = ({
tags,
title,
type,
+ subtitle,
label,
onClick,
href,
@@ -65,7 +68,9 @@ export const ItemCard = ({
return (