Merge branch 'master' of https://github.com/backstage/backstage into marley/7678-pull-request-dashboard
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# @backstage/app-defaults
|
||||
|
||||
## 0.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
- @backstage/core-app-api@0.1.21
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/app-defaults",
|
||||
"description": "Provides the default wiring of a Backstage App",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -29,9 +29,9 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/core-components": "^0.7.3",
|
||||
"@backstage/core-app-api": "^0.1.20",
|
||||
"@backstage/core-plugin-api": "^0.1.13",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/theme": "^0.2.13",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
@@ -39,8 +39,8 @@
|
||||
"react-router-dom": "6.0.0-beta.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@types/jest": "^26.0.7",
|
||||
|
||||
@@ -1,5 +1,50 @@
|
||||
# example-app
|
||||
|
||||
## 0.2.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-catalog@0.7.3
|
||||
- @backstage/plugin-cost-insights@0.11.11
|
||||
- @backstage/cli@0.9.0
|
||||
- @backstage/plugin-gcp-projects@0.3.9
|
||||
- @backstage/catalog-model@0.9.7
|
||||
- @backstage/plugin-scaffolder@0.11.11
|
||||
- @backstage/plugin-api-docs@0.6.14
|
||||
- @backstage/plugin-azure-devops@0.1.4
|
||||
- @backstage/plugin-badges@0.2.14
|
||||
- @backstage/plugin-catalog-graph@0.2.2
|
||||
- @backstage/plugin-catalog-import@0.7.4
|
||||
- @backstage/plugin-catalog-react@0.6.4
|
||||
- @backstage/plugin-circleci@0.2.29
|
||||
- @backstage/plugin-cloudbuild@0.2.28
|
||||
- @backstage/plugin-code-coverage@0.1.18
|
||||
- @backstage/plugin-explore@0.3.21
|
||||
- @backstage/plugin-github-actions@0.4.24
|
||||
- @backstage/plugin-home@0.4.6
|
||||
- @backstage/plugin-jenkins@0.5.12
|
||||
- @backstage/plugin-kafka@0.2.21
|
||||
- @backstage/plugin-kubernetes@0.4.20
|
||||
- @backstage/plugin-lighthouse@0.2.30
|
||||
- @backstage/plugin-newrelic@0.3.9
|
||||
- @backstage/plugin-pagerduty@0.3.18
|
||||
- @backstage/plugin-rollbar@0.3.19
|
||||
- @backstage/plugin-search@0.4.18
|
||||
- @backstage/plugin-sentry@0.3.29
|
||||
- @backstage/plugin-tech-radar@0.4.12
|
||||
- @backstage/plugin-techdocs@0.12.6
|
||||
- @backstage/plugin-todo@0.1.15
|
||||
- @backstage/plugin-user-settings@0.3.11
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
- @backstage/core-app-api@0.1.21
|
||||
- @backstage/plugin-shortcuts@0.1.14
|
||||
- @backstage/app-defaults@0.1.1
|
||||
- @backstage/integration-react@0.1.14
|
||||
- @backstage/plugin-graphiql@0.2.21
|
||||
- @backstage/plugin-org@0.3.28
|
||||
|
||||
## 0.2.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const API_ENDPOINT = 'http://localhost:7000/api/search/query';
|
||||
const API_ENDPOINT = 'http://localhost:7007/api/search/query';
|
||||
|
||||
describe('SearchPage', () => {
|
||||
describe('Given a search context with a term, results, and filter values', () => {
|
||||
|
||||
+43
-43
@@ -1,48 +1,48 @@
|
||||
{
|
||||
"name": "example-app",
|
||||
"version": "0.2.51",
|
||||
"version": "0.2.53",
|
||||
"private": true,
|
||||
"bundled": true,
|
||||
"dependencies": {
|
||||
"@backstage/app-defaults": "^0.1.0",
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/cli": "^0.8.0",
|
||||
"@backstage/core-app-api": "^0.1.18",
|
||||
"@backstage/core-components": "^0.7.1",
|
||||
"@backstage/core-plugin-api": "^0.1.11",
|
||||
"@backstage/integration-react": "^0.1.12",
|
||||
"@backstage/plugin-api-docs": "^0.6.12",
|
||||
"@backstage/plugin-azure-devops": "^0.1.1",
|
||||
"@backstage/plugin-badges": "^0.2.13",
|
||||
"@backstage/plugin-catalog": "^0.7.2",
|
||||
"@backstage/plugin-catalog-graph": "^0.2.1",
|
||||
"@backstage/plugin-catalog-import": "^0.7.3",
|
||||
"@backstage/plugin-catalog-react": "^0.6.1",
|
||||
"@backstage/plugin-circleci": "^0.2.27",
|
||||
"@backstage/plugin-cloudbuild": "^0.2.27",
|
||||
"@backstage/plugin-code-coverage": "^0.1.15",
|
||||
"@backstage/plugin-cost-insights": "^0.11.10",
|
||||
"@backstage/plugin-explore": "^0.3.20",
|
||||
"@backstage/plugin-gcp-projects": "^0.3.8",
|
||||
"@backstage/plugin-github-actions": "^0.4.22",
|
||||
"@backstage/plugin-graphiql": "^0.2.20",
|
||||
"@backstage/plugin-home": "^0.4.4",
|
||||
"@backstage/plugin-jenkins": "^0.5.11",
|
||||
"@backstage/plugin-kafka": "^0.2.19",
|
||||
"@backstage/plugin-kubernetes": "^0.4.17",
|
||||
"@backstage/plugin-lighthouse": "^0.2.29",
|
||||
"@backstage/plugin-newrelic": "^0.3.8",
|
||||
"@backstage/plugin-org": "^0.3.27",
|
||||
"@backstage/plugin-pagerduty": "0.3.17",
|
||||
"@backstage/plugin-rollbar": "^0.3.18",
|
||||
"@backstage/plugin-scaffolder": "^0.11.8",
|
||||
"@backstage/plugin-search": "^0.4.15",
|
||||
"@backstage/plugin-sentry": "^0.3.26",
|
||||
"@backstage/plugin-shortcuts": "^0.1.12",
|
||||
"@backstage/plugin-tech-radar": "^0.4.11",
|
||||
"@backstage/plugin-techdocs": "^0.12.3",
|
||||
"@backstage/plugin-todo": "^0.1.14",
|
||||
"@backstage/plugin-user-settings": "^0.3.10",
|
||||
"@backstage/app-defaults": "^0.1.1",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/integration-react": "^0.1.14",
|
||||
"@backstage/plugin-api-docs": "^0.6.14",
|
||||
"@backstage/plugin-azure-devops": "^0.1.4",
|
||||
"@backstage/plugin-badges": "^0.2.14",
|
||||
"@backstage/plugin-catalog": "^0.7.3",
|
||||
"@backstage/plugin-catalog-graph": "^0.2.2",
|
||||
"@backstage/plugin-catalog-import": "^0.7.4",
|
||||
"@backstage/plugin-catalog-react": "^0.6.4",
|
||||
"@backstage/plugin-circleci": "^0.2.29",
|
||||
"@backstage/plugin-cloudbuild": "^0.2.28",
|
||||
"@backstage/plugin-code-coverage": "^0.1.18",
|
||||
"@backstage/plugin-cost-insights": "^0.11.11",
|
||||
"@backstage/plugin-explore": "^0.3.21",
|
||||
"@backstage/plugin-gcp-projects": "^0.3.9",
|
||||
"@backstage/plugin-github-actions": "^0.4.24",
|
||||
"@backstage/plugin-graphiql": "^0.2.21",
|
||||
"@backstage/plugin-home": "^0.4.6",
|
||||
"@backstage/plugin-jenkins": "^0.5.12",
|
||||
"@backstage/plugin-kafka": "^0.2.21",
|
||||
"@backstage/plugin-kubernetes": "^0.4.20",
|
||||
"@backstage/plugin-lighthouse": "^0.2.30",
|
||||
"@backstage/plugin-newrelic": "^0.3.9",
|
||||
"@backstage/plugin-org": "^0.3.28",
|
||||
"@backstage/plugin-pagerduty": "0.3.18",
|
||||
"@backstage/plugin-rollbar": "^0.3.19",
|
||||
"@backstage/plugin-scaffolder": "^0.11.11",
|
||||
"@backstage/plugin-search": "^0.4.18",
|
||||
"@backstage/plugin-sentry": "^0.3.29",
|
||||
"@backstage/plugin-shortcuts": "^0.1.14",
|
||||
"@backstage/plugin-tech-radar": "^0.4.12",
|
||||
"@backstage/plugin-techdocs": "^0.12.6",
|
||||
"@backstage/plugin-todo": "^0.1.15",
|
||||
"@backstage/plugin-user-settings": "^0.3.11",
|
||||
"@backstage/search-common": "^0.2.0",
|
||||
"@backstage/theme": "^0.2.11",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
@@ -64,9 +64,9 @@
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/test-utils": "^0.1.19",
|
||||
"@rjsf/core": "^3.0.0",
|
||||
"@testing-library/cypress": "^7.0.1",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@rjsf/core": "^3.2.1",
|
||||
"@testing-library/cypress": "^8.0.2",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
|
||||
@@ -27,14 +27,14 @@ describe('App', () => {
|
||||
data: {
|
||||
app: {
|
||||
title: 'Test',
|
||||
support: { url: 'http://localhost:7000/support' },
|
||||
support: { url: 'http://localhost:7007/support' },
|
||||
},
|
||||
backend: { baseUrl: 'http://localhost:7000' },
|
||||
backend: { baseUrl: 'http://localhost:7007' },
|
||||
lighthouse: {
|
||||
baseUrl: 'http://localhost:3003',
|
||||
},
|
||||
techdocs: {
|
||||
storageUrl: 'http://localhost:7000/api/techdocs/static/docs',
|
||||
storageUrl: 'http://localhost:7007/api/techdocs/static/docs',
|
||||
},
|
||||
},
|
||||
context: 'test',
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
import { EntityLayout } from '@backstage/plugin-catalog';
|
||||
import {
|
||||
DefaultStarredEntitiesApi,
|
||||
@@ -22,7 +21,11 @@ import {
|
||||
starredEntitiesApiRef,
|
||||
} from '@backstage/plugin-catalog-react';
|
||||
import { githubActionsApiRef } from '@backstage/plugin-github-actions';
|
||||
import { MockStorageApi, renderInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
MockStorageApi,
|
||||
renderInTestApp,
|
||||
TestApiProvider,
|
||||
} from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { cicdContent } from './EntityPage';
|
||||
|
||||
@@ -45,22 +48,22 @@ describe('EntityPage Test', () => {
|
||||
|
||||
const mockedApi = {
|
||||
listWorkflowRuns: jest.fn().mockResolvedValue([]),
|
||||
getWorkflow: jest.fn(),
|
||||
getWorkflowRun: jest.fn(),
|
||||
reRunWorkflow: jest.fn(),
|
||||
listJobsForWorkflowRun: jest.fn(),
|
||||
downloadJobLogsForWorkflowRun: jest.fn(),
|
||||
} as jest.Mocked<typeof githubActionsApiRef.T>;
|
||||
|
||||
const apis = ApiRegistry.with(githubActionsApiRef, mockedApi).with(
|
||||
starredEntitiesApiRef,
|
||||
new DefaultStarredEntitiesApi({ storageApi: MockStorageApi.create() }),
|
||||
);
|
||||
};
|
||||
|
||||
describe('cicdContent', () => {
|
||||
it('Should render GitHub Actions View', async () => {
|
||||
const rendered = await renderInTestApp(
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[githubActionsApiRef, mockedApi],
|
||||
[
|
||||
starredEntitiesApiRef,
|
||||
new DefaultStarredEntitiesApi({
|
||||
storageApi: MockStorageApi.create(),
|
||||
}),
|
||||
],
|
||||
]}
|
||||
>
|
||||
<EntityProvider entity={entity}>
|
||||
<EntityLayout>
|
||||
<EntityLayout.Route path="/ci-cd" title="CI-CD">
|
||||
@@ -68,7 +71,7 @@ describe('EntityPage Test', () => {
|
||||
</EntityLayout.Route>
|
||||
</EntityLayout>
|
||||
</EntityProvider>
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(rendered.getByText('ExampleComponent')).toBeInTheDocument();
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# @backstage/backend-common
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- d7c1e0e34a: Added the `isDatabaseConflictError` function.
|
||||
- e21e3c6102: Bumping minimum requirements for `dockerode` and `testcontainers`
|
||||
- 1e99c73c75: Update internal usage of `configLoader.loadConfig` that now returns an object instead of an array of configs.
|
||||
- 1daada3a06: Paths can be specified in backend.reading.allow to further restrict allowed targets
|
||||
- 7ad9a07b27: Adding config prop `pluginDivisionMode` to allow plugins using the `pg` client to create their own management schemas in the db. This allows `pg` client plugins to work in separate schemas in the same db.
|
||||
- 01f74aa878: Add `AbortSignal` support to `UrlReader`
|
||||
- a8732a1200: Make sure that server builder `start()` propagates errors (such as failing to bind to the required port) properly and doesn't resolve the promise prematurely.
|
||||
|
||||
After this change, the backend logger will be able to actually capture the error as it happens:
|
||||
|
||||
```
|
||||
2021-11-11T10:54:21.334Z backstage info Initializing http server
|
||||
2021-11-11T10:54:21.335Z backstage error listen EADDRINUSE: address already in use :::7000 code=EADDRINUSE errno=-48 syscall=listen address=:: port=7000
|
||||
```
|
||||
|
||||
- 26b5da1c1a: Do not redact empty or one-character strings. These imply that it's just a test or local dev, and unnecessarily ruin the log output.
|
||||
- Updated dependencies
|
||||
- @backstage/config-loader@0.8.0
|
||||
- @backstage/cli-common@0.1.6
|
||||
|
||||
## 0.9.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/backend-common",
|
||||
"description": "Common functionality library for Backstage backends",
|
||||
"version": "0.9.9",
|
||||
"version": "0.9.10",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -29,9 +29,9 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.5",
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/config-loader": "^0.7.2",
|
||||
"@backstage/config-loader": "^0.8.0",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"@backstage/integration": "^0.6.9",
|
||||
"@backstage/types": "^0.1.1",
|
||||
@@ -39,7 +39,7 @@
|
||||
"@lerna/project": "^4.0.0",
|
||||
"@octokit/rest": "^18.5.3",
|
||||
"@types/cors": "^2.8.6",
|
||||
"@types/dockerode": "^3.2.1",
|
||||
"@types/dockerode": "^3.3.0",
|
||||
"@types/express": "^4.17.6",
|
||||
"archiver": "^5.0.2",
|
||||
"aws-sdk": "^2.840.0",
|
||||
@@ -47,7 +47,7 @@
|
||||
"concat-stream": "^2.0.0",
|
||||
"cors": "^2.8.5",
|
||||
"cross-fetch": "^3.0.6",
|
||||
"dockerode": "^3.2.1",
|
||||
"dockerode": "^3.3.1",
|
||||
"express": "^4.17.1",
|
||||
"express-promise-router": "^4.1.0",
|
||||
"fs-extra": "9.1.0",
|
||||
@@ -80,8 +80,8 @@
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@types/archiver": "^5.1.0",
|
||||
"@types/compression": "^1.7.0",
|
||||
"@types/concat-stream": "^1.6.0",
|
||||
|
||||
@@ -37,7 +37,7 @@ export class SingleHostDiscovery implements PluginEndpointDiscovery {
|
||||
* for the internal one.
|
||||
*
|
||||
* The basePath defaults to `/api`, meaning the default full internal
|
||||
* path for the `catalog` plugin will be `http://localhost:7000/api/catalog`.
|
||||
* path for the `catalog` plugin will be `http://localhost:7007/api/catalog`.
|
||||
*/
|
||||
static fromConfig(config: Config, options?: { basePath?: string }) {
|
||||
const basePath = options?.basePath ?? '/api';
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
} from './config';
|
||||
import { createHttpServer, createHttpsServer } from './hostFactory';
|
||||
|
||||
export const DEFAULT_PORT = 7000;
|
||||
export const DEFAULT_PORT = 7007;
|
||||
// '' is express default, which listens to all interfaces
|
||||
const DEFAULT_HOST = '';
|
||||
// taken from the helmet source code - don't seem to be exported
|
||||
|
||||
@@ -63,8 +63,8 @@ type CustomOrigin = (
|
||||
* @example
|
||||
* ```json
|
||||
* {
|
||||
* baseUrl: "http://localhost:7000",
|
||||
* listen: "0.0.0.0:7000"
|
||||
* baseUrl: "http://localhost:7007",
|
||||
* listen: "0.0.0.0:7007"
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ export type ServiceBuilder = {
|
||||
*
|
||||
* If no port is specified, the service will first look for an environment
|
||||
* variable named PORT and use that if present, otherwise it picks a default
|
||||
* port (7000).
|
||||
* port (7007).
|
||||
*
|
||||
* @param port - The port to listen on
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.9.8",
|
||||
"@backstage/backend-common": "^0.9.10",
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"@backstage/types": "^0.1.1",
|
||||
@@ -43,8 +43,8 @@
|
||||
"zod": "^3.9.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/backend-test-utils": "^0.1.8",
|
||||
"@backstage/cli": "^0.8.1",
|
||||
"@backstage/backend-test-utils": "^0.1.9",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"jest": "^26.0.1",
|
||||
"wait-for-expect": "^3.0.2"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
# @backstage/backend-test-utils
|
||||
|
||||
## 0.1.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e21e3c6102: Bumping minimum requirements for `dockerode` and `testcontainers`
|
||||
- Updated dependencies
|
||||
- @backstage/cli@0.9.0
|
||||
- @backstage/backend-common@0.9.10
|
||||
|
||||
## 0.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/backend-test-utils",
|
||||
"description": "Test helpers library for Backstage backends",
|
||||
"version": "0.1.8",
|
||||
"version": "0.1.9",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"private": false,
|
||||
@@ -30,18 +30,18 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.9.7",
|
||||
"@backstage/cli": "^0.8.0",
|
||||
"@backstage/backend-common": "^0.9.10",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/config": "^0.1.9",
|
||||
"knex": "^0.95.1",
|
||||
"mysql2": "^2.2.5",
|
||||
"pg": "^8.3.0",
|
||||
"sqlite3": "^5.0.1",
|
||||
"testcontainers": "^7.10.0",
|
||||
"testcontainers": "^7.23.0",
|
||||
"uuid": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.0",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"jest": "^26.0.1"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -37,7 +37,7 @@ Substitute `x` for actual values, or leave them as
|
||||
dummy values just to try out the backend without using the auth or sentry features.
|
||||
You can also, instead of using dummy values for a huge number of environment variables, remove those config directly from app-config.yaml file located in the root folder.
|
||||
|
||||
The backend starts up on port 7000 per default.
|
||||
The backend starts up on port 7007 per default.
|
||||
|
||||
### Debugging
|
||||
|
||||
|
||||
@@ -24,39 +24,39 @@
|
||||
"migrate:create": "knex migrate:make -x ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.9.9",
|
||||
"@backstage/catalog-client": "^0.5.1",
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/backend-common": "^0.9.10",
|
||||
"@backstage/catalog-client": "^0.5.2",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/config": "^0.1.10",
|
||||
"@backstage/integration": "^0.6.8",
|
||||
"@backstage/plugin-app-backend": "^0.3.17",
|
||||
"@backstage/plugin-auth-backend": "^0.4.7",
|
||||
"@backstage/plugin-azure-devops-backend": "^0.2.0",
|
||||
"@backstage/plugin-app-backend": "^0.3.19",
|
||||
"@backstage/plugin-auth-backend": "^0.4.8",
|
||||
"@backstage/plugin-azure-devops-backend": "^0.2.1",
|
||||
"@backstage/plugin-badges-backend": "^0.1.11",
|
||||
"@backstage/plugin-catalog-backend": "^0.17.3",
|
||||
"@backstage/plugin-catalog-backend": "^0.17.4",
|
||||
"@backstage/plugin-code-coverage-backend": "^0.1.14",
|
||||
"@backstage/plugin-graphql-backend": "^0.1.9",
|
||||
"@backstage/plugin-jenkins-backend": "^0.1.7",
|
||||
"@backstage/plugin-kubernetes-backend": "^0.3.18",
|
||||
"@backstage/plugin-kafka-backend": "^0.2.10",
|
||||
"@backstage/plugin-kafka-backend": "^0.2.11",
|
||||
"@backstage/plugin-proxy-backend": "^0.2.13",
|
||||
"@backstage/plugin-rollbar-backend": "^0.1.15",
|
||||
"@backstage/plugin-scaffolder-backend": "^0.15.12",
|
||||
"@backstage/plugin-scaffolder-backend": "^0.15.13",
|
||||
"@backstage/plugin-scaffolder-backend-module-rails": "^0.1.7",
|
||||
"@backstage/plugin-search-backend": "^0.2.6",
|
||||
"@backstage/plugin-search-backend-node": "^0.4.2",
|
||||
"@backstage/plugin-search-backend-module-elasticsearch": "^0.0.5",
|
||||
"@backstage/plugin-search-backend-module-pg": "^0.2.1",
|
||||
"@backstage/plugin-techdocs-backend": "^0.10.5",
|
||||
"@backstage/plugin-tech-insights-backend": "^0.1.0",
|
||||
"@backstage/plugin-techdocs-backend": "^0.10.8",
|
||||
"@backstage/plugin-tech-insights-backend": "^0.1.1",
|
||||
"@backstage/plugin-tech-insights-node": "^0.1.0",
|
||||
"@backstage/plugin-tech-insights-backend-module-jsonfc": "^0.1.0",
|
||||
"@backstage/plugin-todo-backend": "^0.1.13",
|
||||
"@gitbeaker/node": "^30.2.0",
|
||||
"@gitbeaker/node": "^34.6.0",
|
||||
"@octokit/rest": "^18.5.3",
|
||||
"azure-devops-node-api": "^11.0.1",
|
||||
"dockerode": "^3.2.1",
|
||||
"example-app": "^0.2.51",
|
||||
"dockerode": "^3.3.1",
|
||||
"example-app": "^0.2.53",
|
||||
"express": "^4.17.1",
|
||||
"express-promise-router": "^4.1.0",
|
||||
"express-prom-bundle": "^6.3.6",
|
||||
@@ -68,8 +68,8 @@
|
||||
"winston": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@types/dockerode": "^3.2.1",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@types/dockerode": "^3.3.0",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/express-serve-static-core": "^4.17.5"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @backstage/catalog-client
|
||||
|
||||
## 0.5.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 3bf2238187: Update to the right version of @backstage/errors
|
||||
- Updated dependencies
|
||||
- @backstage/catalog-model@0.9.7
|
||||
|
||||
## 0.5.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/catalog-client",
|
||||
"description": "An isomorphic client for the catalog backend",
|
||||
"version": "0.5.1",
|
||||
"version": "0.5.2",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -30,12 +30,12 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"cross-fetch": "^3.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"msw": "^0.35.0"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# @backstage/catalog-model
|
||||
|
||||
## 0.9.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8809b6c0dd: Update the json-schema dependency version.
|
||||
|
||||
## 0.9.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/catalog-model",
|
||||
"description": "Types and validators that help describe the model of a Backstage Catalog",
|
||||
"version": "0.9.6",
|
||||
"version": "0.9.7",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -42,7 +42,7 @@
|
||||
"yup": "^0.32.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.1",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/lodash": "^4.14.151",
|
||||
"yaml": "^1.9.2"
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @backstage/cli-common
|
||||
|
||||
## 0.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 677bfc2dd0: Keep backstage.json in sync
|
||||
|
||||
The `versions:bump` script now takes care about updating the `version` property inside `backstage.json` file. The file is created if is not present.
|
||||
|
||||
## 0.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/cli-common",
|
||||
"description": "Common functionality used by cli, backend, and create-app",
|
||||
"version": "0.1.5",
|
||||
"version": "0.1.6",
|
||||
"private": false,
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,28 @@
|
||||
# @backstage/cli
|
||||
|
||||
## 0.9.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 25f637f39f: Tweaked style insertion logic to make sure that JSS stylesheets always receive the highest priority.
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 677bfc2dd0: Keep backstage.json in sync
|
||||
|
||||
The `versions:bump` script now takes care about updating the `version` property inside `backstage.json` file. The file is created if is not present.
|
||||
|
||||
- 8809b6c0dd: Update the json-schema dependency version.
|
||||
- fdfd2f8a62: remove double config dep
|
||||
- 1e99c73c75: Update internal usage of `configLoader.loadConfig` that now returns an object instead of an array of configs.
|
||||
- 6dcfe227a2: Added a scaffolder backend module template for the `create` command.
|
||||
- 4ca3542fdd: Fixed a bug where calling `backstage-cli backend:bundle --build-dependencies` with no dependencies to be built would cause all monorepo packages to be built instead.
|
||||
- 867ea81d15: bump `@rollup/plugin-commonjs` from 17.1.0 to 21.0.1
|
||||
- 16d06f6ac3: Introduces new `backstage-cli create` command to replace `create-plugin` and make space for creating a wider array of things. The create command also adds a new template for creating isomorphic common plugin packages.
|
||||
- Updated dependencies
|
||||
- @backstage/config-loader@0.8.0
|
||||
- @backstage/cli-common@0.1.6
|
||||
|
||||
## 0.8.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -95,6 +95,7 @@ async function getProjectConfig(targetPath, displayName) {
|
||||
...(displayName && { displayName }),
|
||||
rootDir: path.resolve(targetPath, 'src'),
|
||||
coverageDirectory: path.resolve(targetPath, 'coverage'),
|
||||
coverageProvider: 'v8',
|
||||
collectCoverageFrom: ['**/*.{js,jsx,ts,tsx}', '!**/*.d.ts'],
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less|scss|sss|styl)$': require.resolve('jest-css-modules'),
|
||||
|
||||
@@ -46,7 +46,11 @@ function process(source, filePath) {
|
||||
}
|
||||
|
||||
if (transforms) {
|
||||
return transform(source, { transforms, filePath }).code;
|
||||
return transform(source, {
|
||||
transforms,
|
||||
filePath,
|
||||
disableESTransforms: true,
|
||||
}).code;
|
||||
}
|
||||
|
||||
return source;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/cli",
|
||||
"description": "CLI for developing Backstage plugins and apps",
|
||||
"version": "0.8.2",
|
||||
"version": "0.9.0",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -28,9 +28,9 @@
|
||||
"backstage-cli": "bin/backstage-cli"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.5",
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/config-loader": "^0.7.2",
|
||||
"@backstage/config-loader": "^0.8.0",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@hot-loader/react-dom": "^16.13.0",
|
||||
@@ -117,13 +117,13 @@
|
||||
"yn": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/backend-common": "^0.9.9",
|
||||
"@backstage/backend-common": "^0.9.10",
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/core-components": "^0.7.3",
|
||||
"@backstage/core-plugin-api": "^0.1.13",
|
||||
"@backstage/core-app-api": "^0.1.20",
|
||||
"@backstage/dev-utils": "^0.2.12",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/dev-utils": "^0.2.13",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@backstage/theme": "^0.2.13",
|
||||
"@types/diff": "^5.0.0",
|
||||
"@types/express": "^4.17.6",
|
||||
|
||||
@@ -18,7 +18,7 @@ import { getRootLogger } from '@backstage/backend-common';
|
||||
import yn from 'yn';
|
||||
import { startStandaloneServer } from './service/standaloneServer';
|
||||
|
||||
const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7000;
|
||||
const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7007;
|
||||
const enableCors = yn(process.env.PLUGIN_CORS, { default: false });
|
||||
const logger = getRootLogger();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
title: '{{ id }}',
|
||||
id: '{{ id }}',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @backstage/codemods
|
||||
|
||||
## 0.1.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.6
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
- @backstage/core-app-api@0.1.21
|
||||
|
||||
## 0.1.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/codemods",
|
||||
"description": "A collection of codemods for Backstage projects",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -31,7 +31,7 @@
|
||||
"backstage-codemods": "bin/backstage-codemods"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "0.1.5",
|
||||
"@backstage/cli-common": "0.1.6",
|
||||
"@backstage/core-app-api": "*",
|
||||
"@backstage/core-components": "*",
|
||||
"@backstage/core-plugin-api": "*",
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# @backstage/config-loader
|
||||
|
||||
## 0.8.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 1e99c73c75: Update `loadConfig` to return `LoadConfigResult` instead of an array of `AppConfig`.
|
||||
|
||||
This function is primarily used internally by other config loaders like `loadBackendConfig` which means no changes are required for most users.
|
||||
|
||||
If you use `loadConfig` directly you will need to update your usage from:
|
||||
|
||||
```diff
|
||||
- const appConfigs = await loadConfig(options)
|
||||
+ const { appConfigs } = await loadConfig(options)
|
||||
```
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8809b6c0dd: Update the json-schema dependency version.
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.6
|
||||
|
||||
## 0.7.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/config-loader",
|
||||
"description": "Config loading functionality used by Backstage backend, and CLI",
|
||||
"version": "0.7.2",
|
||||
"version": "0.8.0",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -30,7 +30,7 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.5",
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"@backstage/types": "^0.1.1",
|
||||
|
||||
@@ -1,5 +1,30 @@
|
||||
# @backstage/core-app-api
|
||||
|
||||
## 0.1.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Reverted the `createApp` TypeScript type to match the one before version `0.1.21`, as it was an accidental breaking change.
|
||||
|
||||
## 0.1.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 0b1de52732: Migrated to using new `ErrorApiError` and `ErrorApiErrorContext` names.
|
||||
- ecd1fcb80a: Deprecated the `BackstagePluginWithAnyOutput` type.
|
||||
- 32bfbafb0f: Start exporting and marking several types as public to address errors in the API report.
|
||||
- 014cbf8cb9: The `createApp` function from `@backstage/core-app-api` has been deprecated, with two new options being provided as a replacement.
|
||||
|
||||
The first and most commonly used one is `createApp` from the new `@backstage/app-defaults` package, which behaves just like the existing `createApp`. In the future this method is likely to be expanded to add more APIs and other pieces into the default setup, for example the Utility APIs from `@backstage/integration-react`.
|
||||
|
||||
The other option that we now provide is to use `createSpecializedApp` from `@backstage/core-app-api`. This is a more low-level API where you need to provide a full set of options, including your own `components`, `icons`, `defaultApis`, and `themes`. The `createSpecializedApp` way of creating an app is particularly useful if you are not using `@backstage/core-components` or MUI, as it allows you to avoid those dependencies completely.
|
||||
|
||||
- 475edb5bc5: move the BehaviorSubject init into the constructor
|
||||
- Updated dependencies
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
- @backstage/app-defaults@0.1.1
|
||||
|
||||
## 0.1.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -27,6 +27,7 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
|
||||
import { bitbucketAuthApiRef } from '@backstage/core-plugin-api';
|
||||
import { ComponentType } from 'react';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { createApp as createApp_2 } from '@backstage/app-defaults';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
import { ErrorApi } from '@backstage/core-plugin-api';
|
||||
import { ErrorApiError } from '@backstage/core-plugin-api';
|
||||
@@ -45,7 +46,6 @@ import { Observable } from '@backstage/types';
|
||||
import { oktaAuthApiRef } from '@backstage/core-plugin-api';
|
||||
import { oneloginAuthApiRef } from '@backstage/core-plugin-api';
|
||||
import { OpenIdConnectApi } from '@backstage/core-plugin-api';
|
||||
import { OptionalAppOptions } from '@backstage/app-defaults';
|
||||
import { PendingAuthRequest } from '@backstage/core-plugin-api';
|
||||
import { PluginOutput } from '@backstage/core-plugin-api';
|
||||
import { ProfileInfo } from '@backstage/core-plugin-api';
|
||||
@@ -126,7 +126,7 @@ export type ApiProviderProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export class ApiRegistry implements ApiHolder {
|
||||
constructor(apis: Map<string, unknown>);
|
||||
// Warning: (ae-forgotten-export) The symbol "ApiRegistryBuilder" needs to be exported by the entry point index.d.ts
|
||||
@@ -332,7 +332,9 @@ export type BootErrorPageProps = {
|
||||
export { ConfigReader };
|
||||
|
||||
// @public @deprecated
|
||||
export function createApp(options?: OptionalAppOptions): BackstageApp;
|
||||
export function createApp(
|
||||
options?: Parameters<typeof createApp_2>[0],
|
||||
): BackstageApp & AppContext;
|
||||
|
||||
// @public
|
||||
export function createSpecializedApp(options: AppOptions): BackstageApp;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/core-app-api",
|
||||
"description": "Core app API used by Backstage apps",
|
||||
"version": "0.1.20",
|
||||
"version": "0.1.22",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -29,10 +29,10 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/app-defaults": "^0.1.0",
|
||||
"@backstage/core-components": "^0.7.3",
|
||||
"@backstage/app-defaults": "^0.1.1",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/core-plugin-api": "^0.1.13",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/theme": "^0.2.13",
|
||||
"@backstage/types": "^0.1.1",
|
||||
"@backstage/version-bridge": "^0.1.0",
|
||||
@@ -47,8 +47,8 @@
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
|
||||
+2
-2
@@ -26,10 +26,10 @@ describe('UrlPatternDiscovery', () => {
|
||||
|
||||
it('should use a plain pattern', async () => {
|
||||
const discoveryApi = UrlPatternDiscovery.compile(
|
||||
'http://localhost:7000/{{ pluginId }}',
|
||||
'http://localhost:7007/{{ pluginId }}',
|
||||
);
|
||||
await expect(discoveryApi.getBaseUrl('my-plugin')).resolves.toBe(
|
||||
'http://localhost:7000/my-plugin',
|
||||
'http://localhost:7007/my-plugin',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export class UrlPatternDiscovery implements DiscoveryApi {
|
||||
* interpolation done for the template is to replace instances of `{{pluginId}}`
|
||||
* with the ID of the plugin being requested.
|
||||
*
|
||||
* Example pattern: `http://localhost:7000/api/{{ pluginId }}`
|
||||
* Example pattern: `http://localhost:7007/api/{{ pluginId }}`
|
||||
*/
|
||||
static compile(pattern: string): UrlPatternDiscovery {
|
||||
const parts = pattern.split(/\{\{\s*pluginId\s*\}\}/);
|
||||
|
||||
@@ -36,6 +36,7 @@ class ApiRegistryBuilder {
|
||||
* A registry for utility APIs.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Will be removed, use {@link @backstage/test-utils#TestApiProvider} or {@link @backstage/test-utils#TestApiRegistry} instead.
|
||||
*/
|
||||
export class ApiRegistry implements ApiHolder {
|
||||
static builder() {
|
||||
|
||||
@@ -349,6 +349,78 @@ describe('Integration Test', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('getFeatureFlags should return feature flags', async () => {
|
||||
const storageFlags = new LocalStorageFeatureFlags();
|
||||
jest.spyOn(storageFlags, 'registerFlag');
|
||||
|
||||
const apis = [
|
||||
noOpAnalyticsApi,
|
||||
createApiFactory({
|
||||
api: featureFlagsApiRef,
|
||||
deps: { configApi: configApiRef },
|
||||
factory() {
|
||||
return storageFlags;
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
const app = new AppManager({
|
||||
apis,
|
||||
defaultApis: [],
|
||||
themes: [
|
||||
{
|
||||
id: 'light',
|
||||
title: 'Light Theme',
|
||||
variant: 'light',
|
||||
Provider: ({ children }) => <>{children}</>,
|
||||
},
|
||||
],
|
||||
icons,
|
||||
plugins: [
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
featureFlags: [
|
||||
{
|
||||
name: 'foo',
|
||||
},
|
||||
],
|
||||
register: p => p.featureFlags.register('name'),
|
||||
}),
|
||||
],
|
||||
components,
|
||||
configLoader: async () => [],
|
||||
bindRoutes: ({ bind }) => {
|
||||
bind(plugin1.externalRoutes, {
|
||||
extRouteRef1: plugin1RouteRef,
|
||||
extRouteRef2: plugin2RouteRef,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const Provider = app.getProvider();
|
||||
const Router = app.getRouter();
|
||||
|
||||
await renderWithEffects(
|
||||
<Provider>
|
||||
<Router>
|
||||
<Routes>
|
||||
<Route path="/" element={<ExposedComponent />} />
|
||||
<Route path="/foo" element={<HiddenComponent />} />
|
||||
</Routes>
|
||||
</Router>
|
||||
</Provider>,
|
||||
);
|
||||
|
||||
expect(storageFlags.registerFlag).toHaveBeenCalledWith({
|
||||
name: 'name',
|
||||
pluginId: 'test',
|
||||
});
|
||||
expect(storageFlags.registerFlag).toHaveBeenCalledWith({
|
||||
name: 'foo',
|
||||
pluginId: 'test',
|
||||
});
|
||||
});
|
||||
|
||||
it('should track route changes via analytics api', async () => {
|
||||
const mockAnalyticsApi = new MockAnalyticsApi();
|
||||
const apis = [createApiFactory(analyticsApiRef, mockAnalyticsApi)];
|
||||
|
||||
@@ -272,17 +272,26 @@ export class AppManager implements BackstageApp {
|
||||
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;
|
||||
if ('getFeatureFlags' in plugin) {
|
||||
for (const flag of plugin.getFeatureFlags()) {
|
||||
featureFlagsApi.registerFlag({
|
||||
name: flag.name,
|
||||
pluginId: plugin.getId(),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
for (const output of plugin.output()) {
|
||||
switch (output.type) {
|
||||
case 'feature-flag': {
|
||||
featureFlagsApi.registerFlag({
|
||||
name: output.name,
|
||||
pluginId: plugin.getId(),
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
createApp as createDefaultApp,
|
||||
OptionalAppOptions,
|
||||
} from '@backstage/app-defaults';
|
||||
import { createApp as createDefaultApp } from '@backstage/app-defaults';
|
||||
import { AppContext, BackstageApp } from './types';
|
||||
|
||||
/**
|
||||
* Creates a new Backstage App.
|
||||
@@ -26,7 +24,9 @@ import {
|
||||
* @param options - A set of options for creating the app
|
||||
* @public
|
||||
*/
|
||||
export function createApp(options?: OptionalAppOptions) {
|
||||
export function createApp(
|
||||
options?: Parameters<typeof createDefaultApp>[0],
|
||||
): BackstageApp & AppContext {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'DEPRECATION WARNING: The createApp function from @backstage/core-app-api will soon be removed, ' +
|
||||
@@ -34,5 +34,5 @@ export function createApp(options?: OptionalAppOptions) {
|
||||
'If you do not wish to use a standard app configuration but instead supply all options yourself ' +
|
||||
' you can use createSpecializedApp from @backstage/core-app-api instead.',
|
||||
);
|
||||
return createDefaultApp(options);
|
||||
return createDefaultApp(options) as BackstageApp & AppContext;
|
||||
}
|
||||
|
||||
@@ -121,34 +121,37 @@ export class PublishSubject<T>
|
||||
*
|
||||
* See http://reactivex.io/documentation/subject.html
|
||||
*/
|
||||
|
||||
export class BehaviorSubject<T>
|
||||
implements Observable<T>, ZenObservable.SubscriptionObserver<T>
|
||||
{
|
||||
private isClosed = false;
|
||||
private isClosed: boolean;
|
||||
private currentValue: T;
|
||||
private terminatingError?: Error;
|
||||
private terminatingError: Error | undefined;
|
||||
private readonly observable: Observable<T>;
|
||||
|
||||
constructor(value: T) {
|
||||
this.isClosed = false;
|
||||
this.currentValue = value;
|
||||
}
|
||||
|
||||
private readonly observable = new ObservableImpl<T>(subscriber => {
|
||||
if (this.isClosed) {
|
||||
if (this.terminatingError) {
|
||||
subscriber.error(this.terminatingError);
|
||||
} else {
|
||||
subscriber.complete();
|
||||
this.terminatingError = undefined;
|
||||
this.observable = new ObservableImpl<T>(subscriber => {
|
||||
if (this.isClosed) {
|
||||
if (this.terminatingError) {
|
||||
subscriber.error(this.terminatingError);
|
||||
} else {
|
||||
subscriber.complete();
|
||||
}
|
||||
return () => {};
|
||||
}
|
||||
return () => {};
|
||||
}
|
||||
|
||||
subscriber.next(this.currentValue);
|
||||
subscriber.next(this.currentValue);
|
||||
|
||||
this.subscribers.add(subscriber);
|
||||
return () => {
|
||||
this.subscribers.delete(subscriber);
|
||||
};
|
||||
});
|
||||
this.subscribers.add(subscriber);
|
||||
return () => {
|
||||
this.subscribers.delete(subscriber);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
private readonly subscribers = new Set<
|
||||
ZenObservable.SubscriptionObserver<T>
|
||||
|
||||
@@ -16,14 +16,15 @@
|
||||
import React from 'react';
|
||||
import { FeatureFlagged } from './FeatureFlagged';
|
||||
import { render } from '@testing-library/react';
|
||||
import { ApiProvider, ApiRegistry, LocalStorageFeatureFlags } from '../apis';
|
||||
import { LocalStorageFeatureFlags } from '../apis';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
import { featureFlagsApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
const mockFeatureFlagsApi = new LocalStorageFeatureFlags();
|
||||
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={ApiRegistry.with(featureFlagsApiRef, mockFeatureFlagsApi)}>
|
||||
<TestApiProvider apis={[[featureFlagsApiRef, mockFeatureFlagsApi]]}>
|
||||
{children}
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
);
|
||||
|
||||
describe('FeatureFlagged', () => {
|
||||
|
||||
@@ -17,17 +17,18 @@
|
||||
import { render, RenderResult } from '@testing-library/react';
|
||||
import React, { ReactNode } from 'react';
|
||||
import { MemoryRouter, Route, Routes, useOutlet } from 'react-router-dom';
|
||||
import { ApiProvider, ApiRegistry, LocalStorageFeatureFlags } from '../apis';
|
||||
import { LocalStorageFeatureFlags } from '../apis';
|
||||
import { featureFlagsApiRef } from '@backstage/core-plugin-api';
|
||||
import { AppContext } from '../app';
|
||||
import { AppContextProvider } from '../app/AppContext';
|
||||
import { FlatRoutes } from './FlatRoutes';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
|
||||
const mockFeatureFlagsApi = new LocalStorageFeatureFlags();
|
||||
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={ApiRegistry.with(featureFlagsApiRef, mockFeatureFlagsApi)}>
|
||||
<TestApiProvider apis={[[featureFlagsApiRef, mockFeatureFlagsApi]]}>
|
||||
{children}
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
);
|
||||
|
||||
function makeRouteRenderer(node: ReactNode) {
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# @backstage/core-components
|
||||
|
||||
## 0.7.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 274a4fc633: Add Props Icon for Sidebar Item SidebarSearchField and Settings
|
||||
- 682945e233: Changing the `Header` styles to use more theme variables. With this the title `font-size` will not change on resizing the window.
|
||||
- 892c1d9202: Update OAuthAdapter to create identity.token from identity.idToken if it does not exist, and prevent overwrites to identity.toke. Update login page commonProvider to prefer .token over .idToken
|
||||
- Updated dependencies
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
|
||||
## 0.7.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/core-components",
|
||||
"description": "Core components used by Backstage plugins and apps",
|
||||
"version": "0.7.3",
|
||||
"version": "0.7.4",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/core-plugin-api": "^0.1.13",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/errors": "^0.1.4",
|
||||
"@backstage/theme": "^0.2.13",
|
||||
"@material-table/core": "^3.1.0",
|
||||
@@ -67,9 +67,9 @@
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/core-app-api": "^0.1.20",
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
|
||||
@@ -17,78 +17,66 @@
|
||||
import React from 'react';
|
||||
import { AlertDisplay } from './AlertDisplay';
|
||||
import { alertApiRef } from '@backstage/core-plugin-api';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
AlertApiForwarder,
|
||||
} from '@backstage/core-app-api';
|
||||
import { AlertApiForwarder } from '@backstage/core-app-api';
|
||||
import Observable from 'zen-observable';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
|
||||
const TEST_MESSAGE = 'TEST_MESSAGE';
|
||||
|
||||
describe('<AlertDisplay />', () => {
|
||||
it('renders without exploding', async () => {
|
||||
const apiRegistry = ApiRegistry.from([
|
||||
[alertApiRef, new AlertApiForwarder()],
|
||||
]);
|
||||
|
||||
const { queryByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={[[alertApiRef, new AlertApiForwarder()]]}>
|
||||
<AlertDisplay />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
expect(queryByText(TEST_MESSAGE)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders with message', async () => {
|
||||
const apiRegistry = ApiRegistry.from([
|
||||
[
|
||||
alertApiRef,
|
||||
{
|
||||
post() {},
|
||||
alert$() {
|
||||
return Observable.of({ message: TEST_MESSAGE });
|
||||
},
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
const { queryByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider
|
||||
apis={[
|
||||
[
|
||||
alertApiRef,
|
||||
{
|
||||
post() {},
|
||||
alert$() {
|
||||
return Observable.of({ message: TEST_MESSAGE });
|
||||
},
|
||||
},
|
||||
],
|
||||
]}
|
||||
>
|
||||
<AlertDisplay />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(queryByText(TEST_MESSAGE)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe('with multiple messages', () => {
|
||||
let apiRegistry: ApiRegistry;
|
||||
|
||||
beforeEach(() => {
|
||||
apiRegistry = ApiRegistry.from([
|
||||
[
|
||||
alertApiRef,
|
||||
{
|
||||
post() {},
|
||||
alert$() {
|
||||
return Observable.of(
|
||||
{ message: 'message one' },
|
||||
{ message: 'message two' },
|
||||
{ message: 'message three' },
|
||||
);
|
||||
},
|
||||
const apis = [
|
||||
[
|
||||
alertApiRef,
|
||||
{
|
||||
post() {},
|
||||
alert$() {
|
||||
return Observable.of(
|
||||
{ message: 'message one' },
|
||||
{ message: 'message two' },
|
||||
{ message: 'message three' },
|
||||
);
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
},
|
||||
] as const,
|
||||
] as const;
|
||||
|
||||
it('renders first message', async () => {
|
||||
const { queryByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<AlertDisplay />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(queryByText('message one')).toBeInTheDocument();
|
||||
@@ -96,9 +84,9 @@ describe('<AlertDisplay />', () => {
|
||||
|
||||
it('renders a count of remaining messages', async () => {
|
||||
const { queryByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<AlertDisplay />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(queryByText('(2 older messages)')).toBeInTheDocument();
|
||||
|
||||
@@ -17,10 +17,9 @@
|
||||
import React from 'react';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { CopyTextButton } from './CopyTextButton';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
import { errorApiRef, ErrorApi } from '@backstage/core-plugin-api';
|
||||
import { errorApiRef } from '@backstage/core-plugin-api';
|
||||
import { useCopyToClipboard } from 'react-use';
|
||||
|
||||
jest.mock('popper.js', () => {
|
||||
@@ -51,22 +50,18 @@ const props = {
|
||||
tooltipText: 'mockTooltip',
|
||||
};
|
||||
|
||||
const apiRegistry = ApiRegistry.from([
|
||||
[
|
||||
errorApiRef,
|
||||
{
|
||||
post: jest.fn(),
|
||||
error$: jest.fn(),
|
||||
} as ErrorApi,
|
||||
],
|
||||
]);
|
||||
const mockErrorApi = {
|
||||
post: jest.fn(),
|
||||
error$: jest.fn(),
|
||||
};
|
||||
const apis = [[errorApiRef, mockErrorApi] as const] as const;
|
||||
|
||||
describe('<CopyTextButton />', () => {
|
||||
it('renders without exploding', async () => {
|
||||
const { getByTitle, queryByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<CopyTextButton {...props} />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
expect(getByTitle('mockTooltip')).toBeInTheDocument();
|
||||
expect(queryByText('mockTooltip')).not.toBeInTheDocument();
|
||||
@@ -80,9 +75,9 @@ describe('<CopyTextButton />', () => {
|
||||
spy.mockReturnValue([{}, copy]);
|
||||
|
||||
const rendered = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<CopyTextButton {...props} />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
const button = rendered.getByTitle('mockTooltip');
|
||||
fireEvent.click(button);
|
||||
@@ -101,10 +96,10 @@ describe('<CopyTextButton />', () => {
|
||||
spy.mockReturnValue([{ error }, jest.fn()]);
|
||||
|
||||
await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<CopyTextButton {...props} />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
expect(apiRegistry.get(errorApiRef)?.post).toHaveBeenCalledWith(error);
|
||||
expect(mockErrorApi.post).toHaveBeenCalledWith(error);
|
||||
});
|
||||
});
|
||||
|
||||
+15
-14
@@ -18,12 +18,13 @@ import React from 'react';
|
||||
import { DismissableBanner } from './DismissableBanner';
|
||||
import Link from '@material-ui/core/Link';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import { ApiProvider, ApiRegistry, WebStorage } from '@backstage/core-app-api';
|
||||
import { WebStorage } from '@backstage/core-app-api';
|
||||
import {
|
||||
ErrorApi,
|
||||
storageApiRef,
|
||||
StorageApi,
|
||||
} from '@backstage/core-plugin-api';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
|
||||
export default {
|
||||
title: 'Feedback/DismissableBanner',
|
||||
@@ -37,47 +38,47 @@ const createWebStorage = (): StorageApi => {
|
||||
return WebStorage.create({ errorApi });
|
||||
};
|
||||
|
||||
const apis = ApiRegistry.from([[storageApiRef, createWebStorage()]]);
|
||||
const apis = [[storageApiRef, createWebStorage()] as const];
|
||||
|
||||
export const Default = () => (
|
||||
<div style={containerStyle}>
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<DismissableBanner
|
||||
message="This is a dismissable banner"
|
||||
variant="info"
|
||||
id="default_dismissable"
|
||||
/>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const Error = () => (
|
||||
<div style={containerStyle}>
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<DismissableBanner
|
||||
message="This is a dismissable banner with an error message"
|
||||
variant="error"
|
||||
id="error_dismissable"
|
||||
/>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const EmojisIncluded = () => (
|
||||
<div style={containerStyle}>
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<DismissableBanner
|
||||
message="This is a dismissable banner with emojis: 🚀 💚 😆 "
|
||||
variant="info"
|
||||
id="emojis_dismissable"
|
||||
/>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
export const WithLink = () => (
|
||||
<div style={containerStyle}>
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<DismissableBanner
|
||||
message={
|
||||
<Typography>
|
||||
@@ -90,29 +91,29 @@ export const WithLink = () => (
|
||||
variant="info"
|
||||
id="linked_dismissable"
|
||||
/>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</div>
|
||||
);
|
||||
export const Fixed = () => (
|
||||
<div style={containerStyle}>
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<DismissableBanner
|
||||
message="This is a dismissable banner with a fixed position fixed at the bottom of the page"
|
||||
variant="info"
|
||||
id="fixed_dismissable"
|
||||
fixed
|
||||
/>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</div>
|
||||
);
|
||||
export const Warning = () => (
|
||||
<div style={containerStyle}>
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<DismissableBanner
|
||||
message="This is a dismissable banner with a warning message"
|
||||
variant="warning"
|
||||
id="warning_dismissable"
|
||||
/>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</div>
|
||||
);
|
||||
|
||||
+8
-4
@@ -16,13 +16,17 @@
|
||||
|
||||
import React from 'react';
|
||||
import { fireEvent } from '@testing-library/react';
|
||||
import { renderWithEffects, wrapInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
renderWithEffects,
|
||||
TestApiRegistry,
|
||||
wrapInTestApp,
|
||||
} from '@backstage/test-utils';
|
||||
import { DismissableBanner } from './DismissableBanner';
|
||||
import { ApiRegistry, ApiProvider, WebStorage } from '@backstage/core-app-api';
|
||||
import { ApiProvider, WebStorage } from '@backstage/core-app-api';
|
||||
import { storageApiRef, StorageApi } from '@backstage/core-plugin-api';
|
||||
|
||||
describe('<DismissableBanner />', () => {
|
||||
let apis: ApiRegistry;
|
||||
let apis: TestApiRegistry;
|
||||
const mockErrorApi = { post: jest.fn(), error$: jest.fn() };
|
||||
const createWebStorage = (): StorageApi => {
|
||||
return WebStorage.create({
|
||||
@@ -31,7 +35,7 @@ describe('<DismissableBanner />', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
apis = ApiRegistry.from([[storageApiRef, createWebStorage()]]);
|
||||
apis = TestApiRegistry.from([storageApiRef, createWebStorage()]);
|
||||
});
|
||||
|
||||
it('renders the message and the popover', async () => {
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
|
||||
import React from 'react';
|
||||
import { render, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { MockAnalyticsApi, wrapInTestApp } from '@backstage/test-utils';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
import {
|
||||
MockAnalyticsApi,
|
||||
TestApiProvider,
|
||||
wrapInTestApp,
|
||||
} from '@backstage/test-utils';
|
||||
import { analyticsApiRef } from '@backstage/core-plugin-api';
|
||||
import { isExternalUri, Link } from './Link';
|
||||
import { Route, Routes } from 'react-router';
|
||||
@@ -48,11 +51,11 @@ describe('<Link />', () => {
|
||||
|
||||
const { getByText } = render(
|
||||
wrapInTestApp(
|
||||
<ApiProvider apis={ApiRegistry.from([[analyticsApiRef, analyticsApi]])}>
|
||||
<TestApiProvider apis={[[analyticsApiRef, analyticsApi]]}>
|
||||
<Link to="/test" onClick={customOnClick}>
|
||||
{linkText}
|
||||
</Link>
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ import { ErrorBoundary } from './ErrorBoundary';
|
||||
import {
|
||||
MockErrorApi,
|
||||
renderInTestApp,
|
||||
TestApiProvider,
|
||||
withLogCollector,
|
||||
} from '@backstage/test-utils';
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
import { errorApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
type BombProps = {
|
||||
@@ -41,25 +41,25 @@ const Bomb = ({ shouldThrow }: BombProps) => {
|
||||
describe('<ErrorBoundary/>', () => {
|
||||
it('should render error boundary with and without error', async () => {
|
||||
const { error } = await withLogCollector(['error'], async () => {
|
||||
const apis = ApiRegistry.with(errorApiRef, new MockErrorApi());
|
||||
const errorApi = new MockErrorApi();
|
||||
const { rerender, queryByRole, getByRole, getByText } =
|
||||
await renderInTestApp(
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={[[errorApiRef, errorApi]]}>
|
||||
<ErrorBoundary>
|
||||
<Bomb />
|
||||
</ErrorBoundary>
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(queryByRole('alert')).not.toBeInTheDocument();
|
||||
expect(getByText(/working component/i)).toBeInTheDocument();
|
||||
|
||||
rerender(
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={[[errorApiRef, errorApi]]}>
|
||||
<ErrorBoundary>
|
||||
<Bomb shouldThrow />
|
||||
</ErrorBoundary>
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
expect(getByRole('alert')).toBeInTheDocument();
|
||||
|
||||
@@ -15,13 +15,9 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { Header } from './Header';
|
||||
import {
|
||||
ApiRegistry,
|
||||
ConfigReader,
|
||||
ApiProvider,
|
||||
} from '@backstage/core-app-api';
|
||||
import { ConfigReader } from '@backstage/core-app-api';
|
||||
import { configApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
jest.mock('react-helmet', () => {
|
||||
@@ -72,14 +68,12 @@ describe('<Header/>', () => {
|
||||
});
|
||||
|
||||
it('should use app.title', async () => {
|
||||
const apiRegistry = ApiRegistry.with(
|
||||
configApiRef,
|
||||
new ConfigReader({ app: { title: 'Blah' } }),
|
||||
);
|
||||
const rendered = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider
|
||||
apis={[[configApiRef, new ConfigReader({ app: { title: 'Blah' } })]]}
|
||||
>
|
||||
<Header title="Title" type="tool" typeLink="/tool" />,
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
rendered.getAllByText(/Title | Blah/);
|
||||
});
|
||||
|
||||
@@ -14,16 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { renderWithEffects } from '@backstage/test-utils';
|
||||
import { renderWithEffects, TestApiProvider } from '@backstage/test-utils';
|
||||
import { HomepageTimer } from './HomepageTimer';
|
||||
import React from 'react';
|
||||
import { lightTheme } from '@backstage/theme';
|
||||
import { ThemeProvider } from '@material-ui/core/styles';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
ConfigReader,
|
||||
} from '@backstage/core-app-api';
|
||||
import { ConfigReader } from '@backstage/core-app-api';
|
||||
import { ConfigApi, configApiRef } from '@backstage/core-plugin-api';
|
||||
|
||||
it('changes default timezone to GMT', async () => {
|
||||
@@ -41,9 +37,9 @@ it('changes default timezone to GMT', async () => {
|
||||
|
||||
const rendered = await renderWithEffects(
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<ApiProvider apis={ApiRegistry.from([[configApiRef, configApi]])}>
|
||||
<TestApiProvider apis={[[configApiRef, configApi]]}>
|
||||
<HomepageTimer />
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
</ThemeProvider>,
|
||||
);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ export type SidebarPinStateContextType = {
|
||||
|
||||
export const SidebarPinStateContext = createContext<SidebarPinStateContextType>(
|
||||
{
|
||||
isPinned: false,
|
||||
isPinned: true,
|
||||
toggleSidebarPinState: () => {},
|
||||
},
|
||||
);
|
||||
|
||||
@@ -24,10 +24,10 @@ export const LocalStorage = {
|
||||
try {
|
||||
value = JSON.parse(
|
||||
window.localStorage.getItem(LocalStorageKeys.SIDEBAR_PIN_STATE) ||
|
||||
'false',
|
||||
'true',
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return !!value;
|
||||
},
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
# @backstage/core-plugin-api
|
||||
|
||||
## 0.2.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- 7e18ed7f29: Removed the unused `UserFlags` type.
|
||||
- 7df99cdb77: Remove exports of unused types(`RouteOptions` and `RoutePath`).
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 37ebea2d68: Add deprecation warnings around `title` `icon` and `path` as they are no longer controlled when creating `routeRefs`
|
||||
- 2dd2a7b2cc: Deprecated the `theme` property on `AppTheme`, replacing it with `Provider`. See https://backstage.io/docs/api/deprecations#app-theme for more details.
|
||||
- b6a4bacdc4: Deprecated the `Error` and `ErrorContext` types, replacing them with identical `ErrorApiError` and `ErrorApiErrorContext` types.
|
||||
|
||||
## 0.1.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -258,6 +258,7 @@ export type BackstagePlugin<
|
||||
getId(): string;
|
||||
output(): PluginOutput[];
|
||||
getApis(): Iterable<AnyApiFactory>;
|
||||
getFeatureFlags(): Iterable<PluginFeatureFlagConfig>;
|
||||
provide<T>(extension: Extension<T>): T;
|
||||
routes: Routes;
|
||||
externalRoutes: ExternalRoutes;
|
||||
@@ -463,7 +464,7 @@ export type FeatureFlag = {
|
||||
pluginId: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type FeatureFlagOutput = {
|
||||
type: 'feature-flag';
|
||||
name: string;
|
||||
@@ -682,14 +683,20 @@ export type PluginConfig<
|
||||
register?(hooks: PluginHooks): void;
|
||||
routes?: Routes;
|
||||
externalRoutes?: ExternalRoutes;
|
||||
featureFlags?: PluginFeatureFlagConfig[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export type PluginFeatureFlagConfig = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type PluginHooks = {
|
||||
featureFlags: FeatureFlagsHooks;
|
||||
};
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type PluginOutput = FeatureFlagOutput;
|
||||
|
||||
// @public
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/core-plugin-api",
|
||||
"description": "Core API used by Backstage plugins",
|
||||
"version": "0.1.13",
|
||||
"version": "0.2.0",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -43,9 +43,9 @@
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/core-app-api": "^0.1.20",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/react-hooks": "^7.0.2",
|
||||
|
||||
@@ -18,11 +18,8 @@ import { useElementFilter } from './useElementFilter';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { attachComponentData } from './componentData';
|
||||
import { featureFlagsApiRef } from '../apis';
|
||||
import {
|
||||
ApiProvider,
|
||||
ApiRegistry,
|
||||
LocalStorageFeatureFlags,
|
||||
} from '@backstage/core-app-api';
|
||||
import { LocalStorageFeatureFlags } from '@backstage/core-app-api';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
|
||||
const WRAPPING_COMPONENT_KEY = 'core.blob.testing';
|
||||
const INNER_COMPONENT_KEY = 'core.blob2.testing';
|
||||
@@ -45,9 +42,9 @@ const FeatureFlagComponent = (_props: {
|
||||
attachComponentData(FeatureFlagComponent, 'core.featureFlagged', true);
|
||||
const mockFeatureFlagsApi = new LocalStorageFeatureFlags();
|
||||
const Wrapper = ({ children }: { children?: React.ReactNode }) => (
|
||||
<ApiProvider apis={ApiRegistry.with(featureFlagsApiRef, mockFeatureFlagsApi)}>
|
||||
<TestApiProvider apis={[[featureFlagsApiRef, mockFeatureFlagsApi]]}>
|
||||
{children}
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
);
|
||||
|
||||
describe('useElementFilter', () => {
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright 2021 The Backstage Authors
|
||||
*
|
||||
* 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 { createPlugin } from './Plugin';
|
||||
|
||||
describe('Plugin Feature Flag', () => {
|
||||
it('should be able to register and receive feature flags', () => {
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
featureFlags: [{ name: 'test' }],
|
||||
}).getFeatureFlags(),
|
||||
).toEqual([{ name: 'test' }]);
|
||||
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
register({ featureFlags }) {
|
||||
featureFlags.register('blob');
|
||||
},
|
||||
}).getFeatureFlags(),
|
||||
).toEqual([{ name: 'blob' }]);
|
||||
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
register({ featureFlags }) {
|
||||
featureFlags.register('blob');
|
||||
},
|
||||
featureFlags: [{ name: 'test' }],
|
||||
}).getFeatureFlags(),
|
||||
).toEqual([{ name: 'test' }, { name: 'blob' }]);
|
||||
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
}).getFeatureFlags(),
|
||||
).toEqual([]);
|
||||
|
||||
/* deprecated tests */
|
||||
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
featureFlags: [{ name: 'test' }],
|
||||
}).output(),
|
||||
).toEqual([{ name: 'test', type: 'feature-flag' }]);
|
||||
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
register({ featureFlags }) {
|
||||
featureFlags.register('blob');
|
||||
},
|
||||
}).output(),
|
||||
).toEqual([{ name: 'blob', type: 'feature-flag' }]);
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
register({ featureFlags }) {
|
||||
featureFlags.register('blob');
|
||||
},
|
||||
featureFlags: [{ name: 'test' }],
|
||||
}).output(),
|
||||
).toEqual([
|
||||
{ name: 'test', type: 'feature-flag' },
|
||||
{ name: 'blob', type: 'feature-flag' },
|
||||
]);
|
||||
|
||||
expect(
|
||||
createPlugin({
|
||||
id: 'test',
|
||||
}).output(),
|
||||
).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
Extension,
|
||||
AnyRoutes,
|
||||
AnyExternalRoutes,
|
||||
PluginFeatureFlagConfig,
|
||||
} from './types';
|
||||
import { AnyApiFactory } from '../apis';
|
||||
|
||||
@@ -44,6 +45,14 @@ export class PluginImpl<
|
||||
return this.config.apis ?? [];
|
||||
}
|
||||
|
||||
getFeatureFlags(): Iterable<PluginFeatureFlagConfig> {
|
||||
const registeredFlags = this.output()
|
||||
.filter(({ type }) => type === 'feature-flag')
|
||||
.map(({ name }) => ({ name }));
|
||||
|
||||
return registeredFlags;
|
||||
}
|
||||
|
||||
get routes(): Routes {
|
||||
return this.config.routes ?? ({} as Routes);
|
||||
}
|
||||
@@ -56,11 +65,18 @@ export class PluginImpl<
|
||||
if (this.storedOutput) {
|
||||
return this.storedOutput;
|
||||
}
|
||||
if (!this.config.register) {
|
||||
return [];
|
||||
const outputs = new Array<PluginOutput>();
|
||||
this.storedOutput = outputs;
|
||||
|
||||
if (this.config.featureFlags) {
|
||||
for (const flag of this.config.featureFlags) {
|
||||
outputs.push({ type: 'feature-flag', name: flag.name });
|
||||
}
|
||||
}
|
||||
|
||||
const outputs = new Array<PluginOutput>();
|
||||
if (!this.config.register) {
|
||||
return outputs;
|
||||
}
|
||||
|
||||
this.config.register({
|
||||
featureFlags: {
|
||||
@@ -70,7 +86,6 @@ export class PluginImpl<
|
||||
},
|
||||
});
|
||||
|
||||
this.storedOutput = outputs;
|
||||
return this.storedOutput;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,4 +25,5 @@ export type {
|
||||
PluginConfig,
|
||||
PluginHooks,
|
||||
PluginOutput,
|
||||
PluginFeatureFlagConfig,
|
||||
} from './types';
|
||||
|
||||
@@ -19,7 +19,7 @@ import { AnyApiFactory } from '../apis/system';
|
||||
|
||||
/**
|
||||
* Replace with using {@link RouteRef}s.
|
||||
*
|
||||
* @deprecated will be removed
|
||||
* @public
|
||||
*/
|
||||
export type FeatureFlagOutput = {
|
||||
@@ -31,6 +31,7 @@ export type FeatureFlagOutput = {
|
||||
* {@link FeatureFlagOutput} type.
|
||||
*
|
||||
* @public
|
||||
* @deprecated Use {@link BackstagePlugin.getFeatureFlags} instead.
|
||||
*/
|
||||
export type PluginOutput = FeatureFlagOutput;
|
||||
|
||||
@@ -71,13 +72,30 @@ export type BackstagePlugin<
|
||||
ExternalRoutes extends AnyExternalRoutes = {},
|
||||
> = {
|
||||
getId(): string;
|
||||
/**
|
||||
* @deprecated use getFeatureFlags instead.
|
||||
* */
|
||||
output(): PluginOutput[];
|
||||
getApis(): Iterable<AnyApiFactory>;
|
||||
/**
|
||||
* Returns all registered feature flags for this plugin.
|
||||
*/
|
||||
getFeatureFlags(): Iterable<PluginFeatureFlagConfig>;
|
||||
provide<T>(extension: Extension<T>): T;
|
||||
routes: Routes;
|
||||
externalRoutes: ExternalRoutes;
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin feature flag configuration.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type PluginFeatureFlagConfig = {
|
||||
/** Feature flag name */
|
||||
name: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Plugin descriptor type.
|
||||
*
|
||||
@@ -89,14 +107,17 @@ export type PluginConfig<
|
||||
> = {
|
||||
id: string;
|
||||
apis?: Iterable<AnyApiFactory>;
|
||||
/** @deprecated use featureFlags property instead for defining feature flags */
|
||||
register?(hooks: PluginHooks): void;
|
||||
routes?: Routes;
|
||||
externalRoutes?: ExternalRoutes;
|
||||
featureFlags?: PluginFeatureFlagConfig[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Holds hooks registered by the plugin.
|
||||
*
|
||||
* @deprecated - feature flags are now registered in plugin config under featureFlags
|
||||
* @public
|
||||
*/
|
||||
export type PluginHooks = {
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
# @backstage/create-app
|
||||
|
||||
## 0.4.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4ebc9fd277: Create backstage.json file
|
||||
|
||||
`@backstage/create-app` will create a new `backstage.json` file. At this point, the file will contain a `version` property, representing the version of `@backstage/create-app` used for creating the application. If the backstage's application has been bootstrapped using an older version of `@backstage/create-app`, the `backstage.json` file can be created and kept in sync, together with all the changes of the latest version of backstage, by running the following script:
|
||||
|
||||
```bash
|
||||
yarn backstage-cli versions:bump
|
||||
```
|
||||
|
||||
- e21e3c6102: Bumping minimum requirements for `dockerode` and `testcontainers`
|
||||
- 014cbf8cb9: Migrated the app template use the new `@backstage/app-defaults` for the `createApp` import, since the `createApp` exported by `@backstage/app-core-api` will be removed in the future.
|
||||
|
||||
To migrate an existing application, add the latest version of `@backstage/app-defaults` as a dependency in `packages/app/package.json`, and make the following change to `packages/app/src/App.tsx`:
|
||||
|
||||
```diff
|
||||
-import { createApp, FlatRoutes } from '@backstage/core-app-api';
|
||||
+import { createApp } from '@backstage/app-defaults';
|
||||
+import { FlatRoutes } from '@backstage/core-app-api';
|
||||
```
|
||||
|
||||
- 2163e83fa2: Refactor and add regression tests for create-app tasks
|
||||
- Updated dependencies
|
||||
- @backstage/cli-common@0.1.6
|
||||
|
||||
## 0.4.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/create-app",
|
||||
"description": "A CLI that helps you create your own Backstage app",
|
||||
"version": "0.4.3",
|
||||
"version": "0.4.4",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -28,7 +28,7 @@
|
||||
"start": "nodemon --"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/cli-common": "^0.1.5",
|
||||
"@backstage/cli-common": "^0.1.6",
|
||||
"chalk": "^4.0.0",
|
||||
"commander": "^6.1.0",
|
||||
"fs-extra": "9.1.0",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
app:
|
||||
# Should be the same as backend.baseUrl when using the `app-backend` plugin
|
||||
baseUrl: http://localhost:7000
|
||||
baseUrl: http://localhost:7007
|
||||
|
||||
backend:
|
||||
baseUrl: http://localhost:7000
|
||||
baseUrl: http://localhost:7007
|
||||
listen:
|
||||
port: 7000
|
||||
port: 7007
|
||||
|
||||
@@ -6,9 +6,9 @@ organization:
|
||||
name: My Company
|
||||
|
||||
backend:
|
||||
baseUrl: http://localhost:7000
|
||||
baseUrl: http://localhost:7007
|
||||
listen:
|
||||
port: 7000
|
||||
port: 7007
|
||||
csp:
|
||||
connect-src: ["'self'", 'http:', 'https:']
|
||||
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
|
||||
@@ -32,7 +32,9 @@ backend:
|
||||
user: ${POSTGRES_USER}
|
||||
password: ${POSTGRES_PASSWORD}
|
||||
# https://node-postgres.com/features/ssl
|
||||
# ssl: require # see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
|
||||
# you can set the sslmode configuration option via the `PGSSLMODE` environment variable
|
||||
# see https://www.postgresql.org/docs/current/libpq-ssl.html Table 33.1. SSL Mode Descriptions (e.g. require)
|
||||
# ssl:
|
||||
# ca: # if you have a CA file and want to verify it you can uncomment this section
|
||||
# $file: <file-path>/ca/server.crt
|
||||
{{/if}}
|
||||
|
||||
@@ -10,9 +10,9 @@ describe('App', () => {
|
||||
{
|
||||
data: {
|
||||
app: { title: 'Test' },
|
||||
backend: { baseUrl: 'http://localhost:7000' },
|
||||
backend: { baseUrl: 'http://localhost:7007' },
|
||||
techdocs: {
|
||||
storageUrl: 'http://localhost:7000/api/techdocs/static/docs',
|
||||
storageUrl: 'http://localhost:7007/api/techdocs/static/docs',
|
||||
},
|
||||
},
|
||||
context: 'test',
|
||||
|
||||
+15
@@ -2,10 +2,13 @@ import React from 'react';
|
||||
import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core';
|
||||
|
||||
import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
import { DocsResultListItem } from '@backstage/plugin-techdocs';
|
||||
|
||||
import {
|
||||
SearchBar,
|
||||
SearchFilter,
|
||||
SearchResult,
|
||||
SearchType,
|
||||
DefaultResultListItem,
|
||||
} from '@backstage/plugin-search';
|
||||
import { Content, Header, Page } from '@backstage/core-components';
|
||||
@@ -39,6 +42,11 @@ const SearchPage = () => {
|
||||
</Grid>
|
||||
<Grid item xs={3}>
|
||||
<Paper className={classes.filters}>
|
||||
<SearchType
|
||||
values={['techdocs', 'software-catalog']}
|
||||
name="type"
|
||||
defaultValue="software-catalog"
|
||||
/>
|
||||
<SearchFilter.Select
|
||||
className={classes.filter}
|
||||
name="kind"
|
||||
@@ -64,6 +72,13 @@ const SearchPage = () => {
|
||||
result={document}
|
||||
/>
|
||||
);
|
||||
case 'techdocs':
|
||||
return (
|
||||
<DocsResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return (
|
||||
<DefaultResultListItem
|
||||
|
||||
@@ -36,7 +36,7 @@ yarn start
|
||||
Substitute `x` for actual values, or leave them as dummy values just to try out
|
||||
the backend without using the auth or sentry features.
|
||||
|
||||
The backend starts up on port 7000 per default.
|
||||
The backend starts up on port 7007 per default.
|
||||
|
||||
## Populating The Catalog
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
"@backstage/plugin-search-backend": "^{{version '@backstage/plugin-search-backend'}}",
|
||||
"@backstage/plugin-search-backend-node": "^{{version '@backstage/plugin-search-backend-node'}}",
|
||||
"@backstage/plugin-techdocs-backend": "^{{version '@backstage/plugin-techdocs-backend'}}",
|
||||
"@gitbeaker/node": "^30.2.0",
|
||||
"@gitbeaker/node": "^34.6.0",
|
||||
"@octokit/rest": "^18.5.3",
|
||||
"dockerode": "^3.2.1",
|
||||
"dockerode": "^3.3.1",
|
||||
"express": "^4.17.1",
|
||||
"express-promise-router": "^4.1.0",
|
||||
"knex": "^0.21.6",
|
||||
@@ -43,7 +43,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^{{version '@backstage/cli'}}",
|
||||
"@types/dockerode": "^3.2.1",
|
||||
"@types/dockerode": "^3.3.0",
|
||||
"@types/express": "^4.17.6",
|
||||
"@types/express-serve-static-core": "^4.17.5"
|
||||
},
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
} from '@backstage/plugin-search-backend-node';
|
||||
import { PluginEnvironment } from '../types';
|
||||
import { DefaultCatalogCollator } from '@backstage/plugin-catalog-backend';
|
||||
import { DefaultTechDocsCollator } from '@backstage/plugin-techdocs-backend';
|
||||
|
||||
export default async function createPlugin({
|
||||
logger,
|
||||
@@ -17,12 +18,18 @@ export default async function createPlugin({
|
||||
const indexBuilder = new IndexBuilder({ logger, searchEngine });
|
||||
|
||||
// Collators are responsible for gathering documents known to plugins. This
|
||||
// particular collator gathers entities from the software catalog.
|
||||
// collator gathers entities from the software catalog.
|
||||
indexBuilder.addCollator({
|
||||
defaultRefreshIntervalSeconds: 600,
|
||||
collator: DefaultCatalogCollator.fromConfig(config, { discovery }),
|
||||
});
|
||||
|
||||
// collator gathers entities from techdocs.
|
||||
indexBuilder.addCollator({
|
||||
defaultRefreshIntervalSeconds: 600,
|
||||
collator: DefaultTechDocsCollator.fromConfig(config, { discovery, logger }),
|
||||
});
|
||||
|
||||
// The scheduler controls when documents are gathered from collators and sent
|
||||
// to the search engine for indexing.
|
||||
const { scheduler } = await indexBuilder.build();
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
# @backstage/dev-utils
|
||||
|
||||
## 0.2.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 58a4e67ded: Add theme switcher to sidebar of dev app.
|
||||
- 014cbf8cb9: Migrated to using `@backstage/app-defaults`.
|
||||
- Updated dependencies
|
||||
- @backstage/catalog-model@0.9.7
|
||||
- @backstage/plugin-catalog-react@0.6.4
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
- @backstage/core-app-api@0.1.21
|
||||
- @backstage/test-utils@0.1.22
|
||||
- @backstage/app-defaults@0.1.1
|
||||
- @backstage/integration-react@0.1.14
|
||||
|
||||
## 0.2.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/dev-utils",
|
||||
"description": "Utilities for developing Backstage plugins.",
|
||||
"version": "0.2.12",
|
||||
"version": "0.2.13",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
@@ -29,14 +29,14 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/app-defaults": "^0.1.0",
|
||||
"@backstage/core-app-api": "^0.1.18",
|
||||
"@backstage/core-components": "^0.7.1",
|
||||
"@backstage/core-plugin-api": "^0.1.11",
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/integration-react": "^0.1.12",
|
||||
"@backstage/plugin-catalog-react": "^0.6.1",
|
||||
"@backstage/test-utils": "^0.1.19",
|
||||
"@backstage/app-defaults": "^0.1.1",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/integration-react": "^0.1.14",
|
||||
"@backstage/plugin-catalog-react": "^0.6.4",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@backstage/theme": "^0.2.11",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
@@ -53,7 +53,7 @@
|
||||
"zen-observable": "^0.8.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.0",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/node": "^14.14.32"
|
||||
},
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ApiProvider, ApiRegistry } from '@backstage/core-app-api';
|
||||
|
||||
import { AppThemeApi, appThemeApiRef } from '@backstage/core-plugin-api';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
|
||||
import { BackstageTheme } from '@backstage/theme';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
@@ -24,7 +24,6 @@ import { SidebarThemeSwitcher } from './SidebarThemeSwitcher';
|
||||
|
||||
describe('SidebarThemeSwitcher', () => {
|
||||
let appThemeApi: jest.Mocked<AppThemeApi>;
|
||||
let apiRegistry: ApiRegistry;
|
||||
|
||||
beforeEach(() => {
|
||||
appThemeApi = {
|
||||
@@ -51,15 +50,13 @@ describe('SidebarThemeSwitcher', () => {
|
||||
theme: {} as unknown as BackstageTheme,
|
||||
},
|
||||
]);
|
||||
|
||||
apiRegistry = ApiRegistry.with(appThemeApiRef, appThemeApi);
|
||||
});
|
||||
|
||||
it('should display current theme', async () => {
|
||||
const { getByLabelText, getByRole, getByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={[[appThemeApiRef, appThemeApi]]}>
|
||||
<SidebarThemeSwitcher />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
const button = getByLabelText('Switch Theme');
|
||||
@@ -76,9 +73,9 @@ describe('SidebarThemeSwitcher', () => {
|
||||
|
||||
it('should select different theme', async () => {
|
||||
const { getByLabelText, getByRole, getByText } = await renderInTestApp(
|
||||
<ApiProvider apis={apiRegistry}>
|
||||
<TestApiProvider apis={[[appThemeApiRef, appThemeApi]]}>
|
||||
<SidebarThemeSwitcher />
|
||||
</ApiProvider>,
|
||||
</TestApiProvider>,
|
||||
);
|
||||
|
||||
const button = getByLabelText('Switch Theme');
|
||||
|
||||
@@ -471,7 +471,7 @@ async function testBackendStart(appDir: string, isPostgres: boolean) {
|
||||
|
||||
print('Try to fetch entities from the backend');
|
||||
// Try fetch entities, should be ok
|
||||
await fetch('http://localhost:7000/api/catalog/entities').then(res =>
|
||||
await fetch('http://localhost:7007/api/catalog/entities').then(res =>
|
||||
res.json(),
|
||||
);
|
||||
print('Entities fetched successfully');
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# embedded-techdocs-app
|
||||
|
||||
## 0.2.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/plugin-catalog@0.7.3
|
||||
- @backstage/cli@0.9.0
|
||||
- @backstage/catalog-model@0.9.7
|
||||
- @backstage/plugin-techdocs@0.12.6
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
- @backstage/core-app-api@0.1.21
|
||||
- @backstage/test-utils@0.1.22
|
||||
- @backstage/app-defaults@0.1.1
|
||||
- @backstage/integration-react@0.1.14
|
||||
@@ -5,8 +5,8 @@ app:
|
||||
baseUrl: http://localhost:3000
|
||||
|
||||
backend:
|
||||
baseUrl: http://localhost:7000
|
||||
baseUrl: http://localhost:7007
|
||||
|
||||
techdocs:
|
||||
builder: 'external'
|
||||
requestUrl: http://localhost:7000/api
|
||||
requestUrl: http://localhost:7007/api
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
{
|
||||
"name": "embedded-techdocs-app",
|
||||
"version": "0.0.0",
|
||||
"version": "0.2.53",
|
||||
"private": true,
|
||||
"bundled": true,
|
||||
"dependencies": {
|
||||
"@backstage/app-defaults": "^0.1.0",
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/cli": "^0.8.0",
|
||||
"@backstage/app-defaults": "^0.1.1",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/config": "^0.1.10",
|
||||
"@backstage/core-app-api": "^0.1.18",
|
||||
"@backstage/core-components": "^0.7.1",
|
||||
"@backstage/core-plugin-api": "^0.1.11",
|
||||
"@backstage/integration-react": "^0.1.12",
|
||||
"@backstage/plugin-catalog": "^0.7.2",
|
||||
"@backstage/plugin-techdocs": "^0.12.3",
|
||||
"@backstage/test-utils": "^0.1.19",
|
||||
"@backstage/core-app-api": "^0.1.21",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/integration-react": "^0.1.14",
|
||||
"@backstage/plugin-catalog": "^0.7.3",
|
||||
"@backstage/plugin-techdocs": "^0.12.6",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@backstage/theme": "^0.2.11",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
@@ -26,7 +26,7 @@
|
||||
"react-use": "^17.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
|
||||
@@ -26,9 +26,9 @@ describe('App', () => {
|
||||
{
|
||||
data: {
|
||||
app: { title: 'Test' },
|
||||
backend: { baseUrl: 'http://localhost:7000' },
|
||||
backend: { baseUrl: 'http://localhost:7007' },
|
||||
techdocs: {
|
||||
storageUrl: 'http://localhost:7000/api/techdocs/static/docs',
|
||||
storageUrl: 'http://localhost:7007/api/techdocs/static/docs',
|
||||
},
|
||||
},
|
||||
context: 'test',
|
||||
|
||||
@@ -33,8 +33,11 @@ export type ErrorLike = {
|
||||
[unknownKeys: string]: unknown;
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
export type ErrorResponse = ErrorResponseBody;
|
||||
|
||||
// @public
|
||||
export type ErrorResponse = {
|
||||
export type ErrorResponseBody = {
|
||||
error: SerializedError;
|
||||
request?: {
|
||||
method: string;
|
||||
@@ -65,19 +68,27 @@ export class NotFoundError extends CustomErrorBase {}
|
||||
// @public
|
||||
export class NotModifiedError extends CustomErrorBase {}
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export function parseErrorResponse(response: Response): Promise<ErrorResponse>;
|
||||
|
||||
// @public
|
||||
export function parseErrorResponseBody(
|
||||
response: Response,
|
||||
): Promise<ErrorResponseBody>;
|
||||
|
||||
// @public
|
||||
export class ResponseError extends Error {
|
||||
// @deprecated
|
||||
constructor(props: {
|
||||
message: string;
|
||||
response: Response;
|
||||
data: ErrorResponse;
|
||||
data: ErrorResponseBody;
|
||||
cause: Error;
|
||||
});
|
||||
readonly body: ErrorResponseBody;
|
||||
readonly cause: Error;
|
||||
readonly data: ErrorResponse;
|
||||
// @deprecated
|
||||
get data(): ErrorResponseBody;
|
||||
static fromResponse(response: Response): Promise<ResponseError>;
|
||||
readonly response: Response;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
"serialize-error": "^8.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.1",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@types/jest": "^26.0.7"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { deserializeError } from '../serialization';
|
||||
import {
|
||||
parseErrorResponse,
|
||||
ErrorResponse,
|
||||
deserializeError,
|
||||
} from '../serialization';
|
||||
ErrorResponseBody,
|
||||
parseErrorResponseBody,
|
||||
} from '../serialization/response';
|
||||
|
||||
/**
|
||||
* An error thrown as the result of a failed server request.
|
||||
*
|
||||
* The server is expected to respond on the ErrorResponse format.
|
||||
* The server is expected to respond on the ErrorResponseBody format.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
@@ -39,7 +39,7 @@ export class ResponseError extends Error {
|
||||
/**
|
||||
* The parsed JSON error body, as sent by the server.
|
||||
*/
|
||||
readonly data: ErrorResponse;
|
||||
readonly body: ErrorResponseBody;
|
||||
|
||||
/**
|
||||
* The Error cause, as seen by the remote server. This is parsed out of the
|
||||
@@ -60,7 +60,7 @@ export class ResponseError extends Error {
|
||||
* been consumed before.
|
||||
*/
|
||||
static async fromResponse(response: Response): Promise<ResponseError> {
|
||||
const data = await parseErrorResponse(response);
|
||||
const data = await parseErrorResponseBody(response);
|
||||
|
||||
const status = data.response.statusCode || response.status;
|
||||
const statusText = data.error.name || response.statusText;
|
||||
@@ -75,16 +75,28 @@ export class ResponseError extends Error {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated will be removed.
|
||||
**/
|
||||
constructor(props: {
|
||||
message: string;
|
||||
response: Response;
|
||||
data: ErrorResponse;
|
||||
data: ErrorResponseBody;
|
||||
cause: Error;
|
||||
}) {
|
||||
super(props.message);
|
||||
this.name = 'ResponseError';
|
||||
this.response = props.response;
|
||||
this.data = props.data;
|
||||
this.body = props.data;
|
||||
this.cause = props.cause;
|
||||
}
|
||||
/**
|
||||
* The parsed JSON error body, as sent by the server.
|
||||
* @deprecated use body instead.
|
||||
*/
|
||||
get data(): ErrorResponseBody {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('ErrorResponse.data is deprecated, use .body instead.');
|
||||
return this.body;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
|
||||
export { deserializeError, serializeError, stringifyError } from './error';
|
||||
export type { SerializedError } from './error';
|
||||
export { parseErrorResponse } from './response';
|
||||
export type { ErrorResponse } from './response';
|
||||
export { parseErrorResponse, parseErrorResponseBody } from './response';
|
||||
export type { ErrorResponse, ErrorResponseBody } from './response';
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { parseErrorResponse, ErrorResponse } from './response';
|
||||
import { parseErrorResponseBody, ErrorResponseBody } from './response';
|
||||
|
||||
describe('parseErrorResponse', () => {
|
||||
describe('parseErrorResponseBody', () => {
|
||||
it('handles the happy path', async () => {
|
||||
const body: ErrorResponse = {
|
||||
const body: ErrorResponseBody = {
|
||||
error: { name: 'Fours', message: 'Expected fives', stack: 'lines' },
|
||||
request: { method: 'GET', url: '/' },
|
||||
response: { statusCode: 444 },
|
||||
@@ -31,13 +31,13 @@ describe('parseErrorResponse', () => {
|
||||
headers: new Headers({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
await expect(parseErrorResponse(response as Response)).resolves.toEqual(
|
||||
await expect(parseErrorResponseBody(response as Response)).resolves.toEqual(
|
||||
body,
|
||||
);
|
||||
});
|
||||
|
||||
it('uses request header and text body when wrong content type, even if parsable', async () => {
|
||||
const body: ErrorResponse = {
|
||||
const body: ErrorResponseBody = {
|
||||
error: { name: 'Threes', message: 'Expected twos' },
|
||||
request: { method: 'GET', url: '/' },
|
||||
response: { statusCode: 333 },
|
||||
@@ -50,19 +50,21 @@ describe('parseErrorResponse', () => {
|
||||
headers: new Headers({ 'Content-Type': 'not-application/not-json' }),
|
||||
};
|
||||
|
||||
await expect(parseErrorResponse(response as Response)).resolves.toEqual({
|
||||
error: {
|
||||
name: 'Unknown',
|
||||
message: `Request failed with status 444 Fours, ${JSON.stringify(
|
||||
body,
|
||||
)}`,
|
||||
await expect(parseErrorResponseBody(response as Response)).resolves.toEqual(
|
||||
{
|
||||
error: {
|
||||
name: 'Error',
|
||||
message: `Request failed with status 444 Fours, ${JSON.stringify(
|
||||
body,
|
||||
)}`,
|
||||
},
|
||||
response: { statusCode: 444 },
|
||||
},
|
||||
response: { statusCode: 444 },
|
||||
});
|
||||
);
|
||||
});
|
||||
|
||||
it('uses request header and text body when not parsable', async () => {
|
||||
const body: ErrorResponse = {
|
||||
const body: ErrorResponseBody = {
|
||||
error: { name: 'Threes', message: 'Expected twos' },
|
||||
request: { method: 'GET', url: '/' },
|
||||
response: { statusCode: 333 },
|
||||
@@ -75,15 +77,17 @@ describe('parseErrorResponse', () => {
|
||||
headers: new Headers({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
await expect(parseErrorResponse(response as Response)).resolves.toEqual({
|
||||
error: {
|
||||
name: 'Unknown',
|
||||
message: `Request failed with status 444 Fours, ${JSON.stringify(
|
||||
body,
|
||||
).substring(1)}`,
|
||||
await expect(parseErrorResponseBody(response as Response)).resolves.toEqual(
|
||||
{
|
||||
error: {
|
||||
name: 'Error',
|
||||
message: `Request failed with status 444 Fours, ${JSON.stringify(
|
||||
body,
|
||||
).substring(1)}`,
|
||||
},
|
||||
response: { statusCode: 444 },
|
||||
},
|
||||
response: { statusCode: 444 },
|
||||
});
|
||||
);
|
||||
});
|
||||
|
||||
it('uses request header when failing to get body', async () => {
|
||||
@@ -96,12 +100,14 @@ describe('parseErrorResponse', () => {
|
||||
headers: new Headers({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
await expect(parseErrorResponse(response as Response)).resolves.toEqual({
|
||||
error: {
|
||||
name: 'Unknown',
|
||||
message: `Request failed with status 444 Fours`,
|
||||
await expect(parseErrorResponseBody(response as Response)).resolves.toEqual(
|
||||
{
|
||||
error: {
|
||||
name: 'Error',
|
||||
message: `Request failed with status 444 Fours`,
|
||||
},
|
||||
response: { statusCode: 444 },
|
||||
},
|
||||
response: { statusCode: 444 },
|
||||
});
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,8 +20,16 @@ import { SerializedError } from './error';
|
||||
* A standard shape of JSON data returned as the body of backend errors.
|
||||
*
|
||||
* @public
|
||||
* @deprecated - Use {@link ErrorResponseBody} instead.
|
||||
*/
|
||||
export type ErrorResponse = {
|
||||
export type ErrorResponse = ErrorResponseBody;
|
||||
|
||||
/**
|
||||
* A standard shape of JSON data returned as the body of backend errors.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type ErrorResponseBody = {
|
||||
/** Details of the error that was caught */
|
||||
error: SerializedError;
|
||||
|
||||
@@ -51,10 +59,29 @@ export type ErrorResponse = {
|
||||
*
|
||||
* @public
|
||||
* @param response - The response of a failed request
|
||||
* @deprecated - Use {@link parseErrorResponseBody} instead.
|
||||
*/
|
||||
export async function parseErrorResponse(
|
||||
response: Response,
|
||||
): Promise<ErrorResponse> {
|
||||
return parseErrorResponseBody(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to construct an ErrorResponseBody out of a failed server request.
|
||||
* Assumes that the response has already been checked to be not ok. This
|
||||
* function consumes the body of the response, and assumes that it hasn't
|
||||
* been consumed before.
|
||||
*
|
||||
* The code is forgiving, and constructs a useful synthetic body as best it can
|
||||
* if the response body wasn't on the expected form.
|
||||
*
|
||||
* @public
|
||||
* @param response - The response of a failed request
|
||||
*/
|
||||
export async function parseErrorResponseBody(
|
||||
response: Response,
|
||||
): Promise<ErrorResponseBody> {
|
||||
try {
|
||||
const text = await response.text();
|
||||
if (text) {
|
||||
@@ -73,7 +100,7 @@ export async function parseErrorResponse(
|
||||
|
||||
return {
|
||||
error: {
|
||||
name: 'Unknown',
|
||||
name: 'Error',
|
||||
message: `Request failed with status ${response.status} ${response.statusText}, ${text}`,
|
||||
},
|
||||
response: {
|
||||
@@ -87,7 +114,7 @@ export async function parseErrorResponse(
|
||||
|
||||
return {
|
||||
error: {
|
||||
name: 'Unknown',
|
||||
name: 'Error',
|
||||
message: `Request failed with status ${response.status} ${response.statusText}`,
|
||||
},
|
||||
response: {
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# @backstage/integration-react
|
||||
|
||||
## 0.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
|
||||
## 0.1.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/integration-react",
|
||||
"description": "Frontend package for managing integrations towards external systems",
|
||||
"version": "0.1.13",
|
||||
"version": "0.1.14",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -22,8 +22,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/config": "^0.1.11",
|
||||
"@backstage/core-components": "^0.7.2",
|
||||
"@backstage/core-plugin-api": "^0.1.12",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/integration": "^0.6.9",
|
||||
"@backstage/theme": "^0.2.12",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
@@ -34,9 +34,9 @@
|
||||
"react-use": "^17.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.1",
|
||||
"@backstage/dev-utils": "^0.2.12",
|
||||
"@backstage/test-utils": "^0.1.20",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/dev-utils": "^0.2.13",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.1",
|
||||
"@backstage/config-loader": "^0.7.1",
|
||||
"@backstage/test-utils": "^0.1.20",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/config-loader": "^0.8.0",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@types/jest": "^26.0.7",
|
||||
"@types/luxon": "^2.0.4",
|
||||
"msw": "^0.35.0"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"@backstage/types": "^0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.1"
|
||||
"@backstage/cli": "^0.9.0"
|
||||
},
|
||||
"jest": {
|
||||
"roots": [
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
AlertApiForwarder,
|
||||
ApiRegistry,
|
||||
ErrorAlerter,
|
||||
ErrorApiForwarder,
|
||||
GithubAuth,
|
||||
@@ -27,78 +26,57 @@ import {
|
||||
configApiRef,
|
||||
} from '@backstage/core-plugin-api';
|
||||
|
||||
const builder = ApiRegistry.builder();
|
||||
|
||||
builder.add(configApiRef, new ConfigReader({}));
|
||||
|
||||
const alertApi = builder.add(alertApiRef, new AlertApiForwarder());
|
||||
|
||||
builder.add(errorApiRef, new ErrorAlerter(alertApi, new ErrorApiForwarder()));
|
||||
|
||||
builder.add(identityApiRef, {
|
||||
const configApi = new ConfigReader({});
|
||||
const alertApi = new AlertApiForwarder();
|
||||
const errorApi = new ErrorAlerter(alertApi, new ErrorApiForwarder());
|
||||
const identityApi = {
|
||||
getUserId: () => 'guest',
|
||||
getProfile: () => ({ email: 'guest@example.com' }),
|
||||
getIdToken: () => undefined,
|
||||
signOut: async () => {},
|
||||
};
|
||||
const oauthRequestApi = new OAuthRequestManager();
|
||||
const googleAuthApi = GoogleAuth.create({
|
||||
apiOrigin: 'http://localhost:7007',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
});
|
||||
const githubAuthApi = GithubAuth.create({
|
||||
apiOrigin: 'http://localhost:7007',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
});
|
||||
const gitlabAuthApi = GitlabAuth.create({
|
||||
apiOrigin: 'http://localhost:7007',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
});
|
||||
const oktaAuthApi = OktaAuth.create({
|
||||
apiOrigin: 'http://localhost:7007',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
});
|
||||
const auth0AuthApi = Auth0Auth.create({
|
||||
apiOrigin: 'http://localhost:7007',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
});
|
||||
const oauth2Api = OAuth2.create({
|
||||
apiOrigin: 'http://localhost:7007',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
});
|
||||
|
||||
const oauthRequestApi = builder.add(
|
||||
oauthRequestApiRef,
|
||||
new OAuthRequestManager(),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
googleAuthApiRef,
|
||||
GoogleAuth.create({
|
||||
apiOrigin: 'http://localhost:7000',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
}),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
githubAuthApiRef,
|
||||
GithubAuth.create({
|
||||
apiOrigin: 'http://localhost:7000',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
}),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
gitlabAuthApiRef,
|
||||
GitlabAuth.create({
|
||||
apiOrigin: 'http://localhost:7000',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
}),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
oktaAuthApiRef,
|
||||
OktaAuth.create({
|
||||
apiOrigin: 'http://localhost:7000',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
}),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
auth0AuthApiRef,
|
||||
Auth0Auth.create({
|
||||
apiOrigin: 'http://localhost:7000',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
}),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
oauth2ApiRef,
|
||||
OAuth2.create({
|
||||
apiOrigin: 'http://localhost:7000',
|
||||
basePath: '/auth/',
|
||||
oauthRequestApi,
|
||||
}),
|
||||
);
|
||||
|
||||
export const apis = builder.build();
|
||||
export const apis = [
|
||||
[configApiRef, configApi],
|
||||
[alertApiRef, alertApi],
|
||||
[errorApiRef, errorApi],
|
||||
[identityApiRef, identityApi],
|
||||
[oauthRequestApiRef, oauthRequestApi],
|
||||
[googleAuthApiRef, googleAuthApi],
|
||||
[githubAuthApiRef, githubAuthApi],
|
||||
[gitlabAuthApiRef, gitlabAuthApi],
|
||||
[oktaAuthApiRef, oktaAuthApi],
|
||||
[auth0AuthApiRef, auth0AuthApi],
|
||||
[oauth2ApiRef, oauth2Api],
|
||||
];
|
||||
|
||||
@@ -6,17 +6,17 @@ import { useDarkMode } from 'storybook-dark-mode';
|
||||
import { apis } from './apis';
|
||||
|
||||
import { Content, AlertDisplay } from '@backstage/core-components';
|
||||
import { ApiProvider } from '@backstage/core-app-api';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
|
||||
addDecorator(story => (
|
||||
<ApiProvider apis={apis}>
|
||||
<TestApiProvider apis={apis}>
|
||||
<ThemeProvider theme={useDarkMode() ? darkTheme : lightTheme}>
|
||||
<CssBaseline>
|
||||
<AlertDisplay />
|
||||
<Content>{story()}</Content>
|
||||
</CssBaseline>
|
||||
</ThemeProvider>
|
||||
</ApiProvider>
|
||||
</TestApiProvider>
|
||||
));
|
||||
|
||||
addParameters({
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||
version: v1.22.1
|
||||
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
|
||||
ignore:
|
||||
SNYK-JS-BROWSERSLIST-1090194:
|
||||
- '*':
|
||||
reason: Developer tools are not a valid target for ReDoS attacks
|
||||
expires: 2022-05-20T00:00:00.000Z
|
||||
created: 2021-11-20T00:00:00.000Z
|
||||
|
||||
SNYK-JS-IMMER-1540542:
|
||||
- '*':
|
||||
reason: Prototype pollution is not an effective attack against a CLI as it already executes arbitrary code
|
||||
expires: 2022-05-20T00:00:00.000Z
|
||||
created: 2021-11-20T00:00:00.000Z
|
||||
|
||||
patch: {}
|
||||
@@ -1,5 +1,17 @@
|
||||
# @techdocs/cli
|
||||
|
||||
## 0.8.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- e21e3c6102: Bumping minimum requirements for `dockerode` and `testcontainers`
|
||||
- 1578ad341b: Add support for specifying bucketRootPath for AWS and GCS publishers
|
||||
- f2694e3750: Adds ability to use encrypted S3 buckets by utilizing the SSE option in the AWS SDK
|
||||
- Updated dependencies
|
||||
- @backstage/catalog-model@0.9.7
|
||||
- @backstage/backend-common@0.9.10
|
||||
- @backstage/techdocs-common@0.10.7
|
||||
|
||||
## 0.8.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@techdocs/cli",
|
||||
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
||||
"version": "0.8.5",
|
||||
"version": "0.8.6",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -32,7 +32,7 @@
|
||||
"techdocs-cli": "bin/techdocs-cli"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.0",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@types/commander": "^2.12.2",
|
||||
"@types/fs-extra": "^9.0.6",
|
||||
"@types/http-proxy": "^1.17.4",
|
||||
@@ -41,7 +41,7 @@
|
||||
"@types/react-dev-utils": "^9.0.4",
|
||||
"@types/serve-handler": "^6.1.0",
|
||||
"@types/webpack-env": "^1.15.3",
|
||||
"embedded-techdocs-app": "0.0.0",
|
||||
"embedded-techdocs-app": "0.2.53",
|
||||
"find-process": "^1.4.5",
|
||||
"nodemon": "^2.0.2",
|
||||
"ts-node": "^10.0.0"
|
||||
@@ -56,13 +56,13 @@
|
||||
"ext": "ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/backend-common": "^0.9.7",
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/backend-common": "^0.9.10",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/config": "^0.1.10",
|
||||
"@backstage/techdocs-common": "^0.10.4",
|
||||
"@types/dockerode": "^3.2.1",
|
||||
"@backstage/techdocs-common": "^0.10.7",
|
||||
"@types/dockerode": "^3.3.0",
|
||||
"commander": "^6.1.0",
|
||||
"dockerode": "^3.2.1",
|
||||
"dockerode": "^3.3.1",
|
||||
"fs-extra": "^9.0.1",
|
||||
"http-proxy": "^1.18.1",
|
||||
"react-dev-utils": "^11.0.4",
|
||||
|
||||
@@ -36,7 +36,7 @@ export default async function serve(cmd: Command) {
|
||||
// a backstage app, we define app.baseUrl in the app-config.yaml.
|
||||
// Hence, it is complicated to make this configurable.
|
||||
const backstagePort = 3000;
|
||||
const backstageBackendPort = 7000;
|
||||
const backstageBackendPort = 7007;
|
||||
|
||||
const mkdocsDockerAddr = `http://0.0.0.0:${cmd.mkdocsPort}`;
|
||||
const mkdocsLocalAddr = `http://127.0.0.1:${cmd.mkdocsPort}`;
|
||||
|
||||
@@ -55,9 +55,9 @@ export class PublisherConfig {
|
||||
return new ConfigReader({
|
||||
// This backend config is not used at all. Just something needed a create a mock discovery instance.
|
||||
backend: {
|
||||
baseUrl: 'http://localhost:7000',
|
||||
baseUrl: 'http://localhost:7007',
|
||||
listen: {
|
||||
port: 7000,
|
||||
port: 7007,
|
||||
},
|
||||
},
|
||||
techdocs: {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user