Merge branch 'backstage:master' into delete-icon-playlist-color

This commit is contained in:
AmbrishRamachandiran
2023-08-18 21:38:08 +05:30
committed by GitHub
206 changed files with 1745 additions and 789 deletions
+60
View File
@@ -0,0 +1,60 @@
---
'@backstage/plugin-api-docs-module-protoc-gen-doc': patch
'@backstage/plugin-catalog-unprocessed-entities': patch
'@backstage/plugin-github-pull-requests-board': patch
'@backstage/integration-react': patch
'@backstage/plugin-github-deployments': patch
'@backstage/plugin-microsoft-calendar': patch
'@backstage/plugin-newrelic-dashboard': patch
'@backstage/plugin-entity-validation': patch
'@backstage/plugin-apollo-explorer': patch
'@backstage/plugin-gitops-profiles': patch
'@backstage/plugin-graphql-voyager': patch
'@backstage/plugin-apache-airflow': patch
'@backstage/plugin-github-actions': patch
'@backstage/plugin-octopus-deploy': patch
'@backstage/plugin-splunk-on-call': patch
'@backstage/plugin-config-schema': patch
'@backstage/plugin-github-issues': patch
'@backstage/plugin-azure-devops': patch
'@backstage/plugin-code-climate': patch
'@backstage/plugin-gcp-projects': patch
'@backstage/plugin-azure-sites': patch
'@backstage/plugin-firehydrant': patch
'@backstage/plugin-cloudbuild': patch
'@backstage/plugin-home-react': patch
'@backstage/plugin-lighthouse': patch
'@backstage/plugin-tech-radar': patch
'@backstage/plugin-codescene': patch
'@backstage/plugin-dynatrace': patch
'@backstage/plugin-gcalendar': patch
'@backstage/plugin-org-react': patch
'@backstage/plugin-shortcuts': patch
'@backstage/plugin-sonarqube': patch
'@backstage/plugin-xcmetrics': patch
'@backstage/plugin-airbrake': patch
'@backstage/plugin-circleci': patch
'@backstage/plugin-graphiql': patch
'@backstage/plugin-linguist': patch
'@backstage/plugin-newrelic': patch
'@backstage/plugin-opencost': patch
'@backstage/plugin-periskop': patch
'@backstage/plugin-playlist': patch
'@backstage/plugin-puppetdb': patch
'@backstage/plugin-bitrise': patch
'@backstage/plugin-jenkins': patch
'@backstage/plugin-rollbar': patch
'@backstage/plugin-allure': patch
'@backstage/plugin-badges': patch
'@backstage/plugin-bazaar': patch
'@backstage/plugin-sentry': patch
'@backstage/plugin-fossa': patch
'@backstage/plugin-ilert': patch
'@backstage/plugin-kafka': patch
'@backstage/plugin-nomad': patch
'@backstage/plugin-vault': patch
'@backstage/plugin-todo': patch
'@backstage/plugin-org': patch
---
Moved `@types/react` to be a regular dependency
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Added title to props for `Has<kind>Cards`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Added the ability to create a plain backend module with the `new` command.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Added `authPlugin` export for the new backend system. The plugin does not include any built-in auth providers, they must instead be added by installing additional modules, for example `authModuleGoogleProvider` from `@backstage/plugin-auth-backend-module-google-provider`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog': patch
---
Fixed an issue where `EntitySwitch` was preventing the display of entity errors.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Fixed a link to the frontend Backstage plugin that had pointed to itself.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Added the ability to disable the built-in auth providers by passing `disableDefaultProviderFactories` to `createRouter`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-linguist-backend': patch
---
When creating the router using `createRouterFromConfig` or using the plugin for the new backend system the `linguist.useSourceLocation` configuration is now optional.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-code-coverage': patch
---
Use fetchApi to ensure authorization is used when fetching code-coverage data
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
The algorithm used when generating Backstage tokens can be configured via `auth.identityTokenAlgorithm`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
Extended `mockService` to also include mocked variants, for example `mockServices.lifecycle.mock()`. The returned mocked implementation will have a `factory` property which is a service factory for itself. You can also pass a partial implementation of the service to the mock function to use a mock implementation of specific methods.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Added support for the `dev/index` entry point for backend plugins and modules.
@@ -85,6 +85,8 @@ declare a dependency on the plugin package itself. This is to avoid a direct
dependency and potentially cause duplicate installations of the plugin package,
while duplicate installations of library packages should always be supported.
To create a Backend module, run `yarn new`, select `backend-module`, and fill out the rest of the prompts. This will create a new package at `plugins/<pluginId>-backend-module-<moduleId>`.
The following is an example of how to create a module that adds a new processor
using the `catalogProcessingExtensionPoint`:
+2 -2
View File
@@ -23,9 +23,9 @@ compound reference structure.
## String References
This is the most common alternative, that is used in almost all circumstances.
This is the most common alternative and is used in almost all circumstances.
The string is on the form `[<kind>:][<namespace>/]<name>`, that is, it is
The string is of the form `[<kind>:][<namespace>/]<name>`. That is, it is
composed of between one and three parts in this specific order, without any
additional encoding:
+63
View File
@@ -3,6 +3,8 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="jest" />
import { Backend } from '@backstage/backend-app-api';
import { BackendFeature } from '@backstage/backend-plugin-api';
import { CacheService } from '@backstage/backend-plugin-api';
@@ -19,6 +21,7 @@ import { LoggerService } from '@backstage/backend-plugin-api';
import { PermissionsService } from '@backstage/backend-plugin-api';
import { RootConfigService } from '@backstage/backend-plugin-api';
import { RootLifecycleService } from '@backstage/backend-plugin-api';
import { RootLoggerService } from '@backstage/backend-plugin-api';
import { SchedulerService } from '@backstage/backend-plugin-api';
import { ServiceFactory } from '@backstage/backend-plugin-api';
import { TokenManagerService } from '@backstage/backend-plugin-api';
@@ -33,11 +36,19 @@ export namespace mockServices {
export namespace cache {
const // (undocumented)
factory: () => ServiceFactory<CacheService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<CacheService> | undefined,
) => ServiceMock<CacheService>;
}
// (undocumented)
export namespace database {
const // (undocumented)
factory: () => ServiceFactory<DatabaseService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<DatabaseService> | undefined,
) => ServiceMock<DatabaseService>;
}
// (undocumented)
export namespace httpRouter {
@@ -45,6 +56,10 @@ export namespace mockServices {
factory: (
options?: HttpRouterFactoryOptions | undefined,
) => ServiceFactory<HttpRouterService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<HttpRouterService> | undefined,
) => ServiceMock<HttpRouterService>;
}
// (undocumented)
export function identity(): IdentityService;
@@ -52,21 +67,37 @@ export namespace mockServices {
export namespace identity {
const // (undocumented)
factory: () => ServiceFactory<IdentityService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<IdentityService> | undefined,
) => ServiceMock<IdentityService>;
}
// (undocumented)
export namespace lifecycle {
const // (undocumented)
factory: () => ServiceFactory<LifecycleService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<LifecycleService> | undefined,
) => ServiceMock<LifecycleService>;
}
// (undocumented)
export namespace logger {
const // (undocumented)
factory: () => ServiceFactory<LoggerService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<LoggerService> | undefined,
) => ServiceMock<LoggerService>;
}
// (undocumented)
export namespace permissions {
const // (undocumented)
factory: () => ServiceFactory<PermissionsService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<PermissionsService> | undefined,
) => ServiceMock<PermissionsService>;
}
// (undocumented)
export function rootConfig(options?: rootConfig.Options): RootConfigService;
@@ -85,6 +116,10 @@ export namespace mockServices {
export namespace rootLifecycle {
const // (undocumented)
factory: () => ServiceFactory<RootLifecycleService, 'root'>;
const // (undocumented)
mock: (
partialImpl?: Partial<RootLifecycleService> | undefined,
) => ServiceMock<RootLifecycleService>;
}
// (undocumented)
export function rootLogger(options?: rootLogger.Options): LoggerService;
@@ -98,11 +133,19 @@ export namespace mockServices {
factory: (
options?: Options | undefined,
) => ServiceFactory<LoggerService, 'root'>;
const // (undocumented)
mock: (
partialImpl?: Partial<RootLoggerService> | undefined,
) => ServiceMock<RootLoggerService>;
}
// (undocumented)
export namespace scheduler {
const // (undocumented)
factory: () => ServiceFactory<SchedulerService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<SchedulerService> | undefined,
) => ServiceMock<SchedulerService>;
}
// (undocumented)
export function tokenManager(): TokenManagerService;
@@ -110,14 +153,34 @@ export namespace mockServices {
export namespace tokenManager {
const // (undocumented)
factory: () => ServiceFactory<TokenManagerService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<TokenManagerService> | undefined,
) => ServiceMock<TokenManagerService>;
}
// (undocumented)
export namespace urlReader {
const // (undocumented)
factory: () => ServiceFactory<UrlReaderService, 'plugin'>;
const // (undocumented)
mock: (
partialImpl?: Partial<UrlReaderService> | undefined,
) => ServiceMock<UrlReaderService>;
}
}
// @public (undocumented)
export type ServiceMock<TService> = {
factory: ServiceFactory<TService>;
} & {
[Key in keyof TService]: TService[Key] extends (
this: infer This,
...args: infer Args
) => infer Return
? TService[Key] & jest.MockInstance<Return, Args, This>
: TService[Key];
};
// @public
export function setupRequestMockHandlers(worker: {
listen: (t: any) => void;
+3
View File
@@ -57,6 +57,9 @@
"testcontainers": "^8.1.2",
"uuid": "^8.0.0"
},
"peerDependencies": {
"@types/jest": "*"
},
"devDependencies": {
"@backstage/cli": "workspace:^",
"@types/supertest": "^2.0.8",
@@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { mockServices } from './mockServices';
export { mockServices, type ServiceMock } from './mockServices';
@@ -40,6 +40,7 @@ import { JsonObject } from '@backstage/types';
import { MockIdentityService } from './MockIdentityService';
import { MockRootLoggerService } from './MockRootLoggerService';
/** @internal */
function simpleFactory<
TService,
TScope extends 'root' | 'plugin',
@@ -57,6 +58,44 @@ function simpleFactory<
})) as (...options: TOptions) => ServiceFactory<TService, any>;
}
/** @public */
export type ServiceMock<TService> = {
factory: ServiceFactory<TService>;
} & {
[Key in keyof TService]: TService[Key] extends (
this: infer This,
...args: infer Args
) => infer Return
? TService[Key] & jest.MockInstance<Return, Args, This>
: TService[Key];
};
/** @internal */
function simpleMock<TService>(
ref: ServiceRef<TService, any>,
mockFactory: () => jest.Mocked<TService>,
): (partialImpl?: Partial<TService>) => ServiceMock<TService> {
return partialImpl => {
const mock = mockFactory();
if (partialImpl) {
for (const [key, impl] of Object.entries(partialImpl)) {
if (typeof impl === 'function') {
(mock as any)[key].mockImplementation(impl);
} else {
(mock as any)[key] = impl;
}
}
}
return Object.assign(mock, {
factory: createServiceFactory({
service: ref,
deps: {},
factory: () => mock,
})(),
}) as ServiceMock<TService>;
};
}
/**
* @public
*/
@@ -79,6 +118,13 @@ export namespace mockServices {
};
export const factory = simpleFactory(coreServices.rootLogger, rootLogger);
export const mock = simpleMock(coreServices.rootLogger, () => ({
child: jest.fn(),
debug: jest.fn(),
error: jest.fn(),
info: jest.fn(),
warn: jest.fn(),
}));
}
export function tokenManager(): TokenManagerService {
@@ -98,6 +144,10 @@ export namespace mockServices {
coreServices.tokenManager,
tokenManager,
);
export const mock = simpleMock(coreServices.tokenManager, () => ({
authenticate: jest.fn(),
getToken: jest.fn(),
}));
}
export function identity(): IdentityService {
@@ -105,6 +155,9 @@ export namespace mockServices {
}
export namespace identity {
export const factory = simpleFactory(coreServices.identity, identity);
export const mock = simpleMock(coreServices.identity, () => ({
getIdentity: jest.fn(),
}));
}
// TODO(Rugvip): Not all core services have implementations available here yet.
@@ -112,29 +165,71 @@ export namespace mockServices {
// re-implement functioning mock versions here.
export namespace cache {
export const factory = cacheServiceFactory;
export const mock = simpleMock(coreServices.cache, () => ({
delete: jest.fn(),
get: jest.fn(),
set: jest.fn(),
withOptions: jest.fn(),
}));
}
export namespace database {
export const factory = databaseServiceFactory;
export const mock = simpleMock(coreServices.database, () => ({
getClient: jest.fn(),
}));
}
export namespace httpRouter {
export const factory = httpRouterServiceFactory;
export const mock = simpleMock(coreServices.httpRouter, () => ({
use: jest.fn(),
}));
}
export namespace lifecycle {
export const factory = lifecycleServiceFactory;
export const mock = simpleMock(coreServices.lifecycle, () => ({
addShutdownHook: jest.fn(),
addStartupHook: jest.fn(),
}));
}
export namespace logger {
export const factory = loggerServiceFactory;
export const mock = simpleMock(coreServices.logger, () => ({
child: jest.fn(),
debug: jest.fn(),
error: jest.fn(),
info: jest.fn(),
warn: jest.fn(),
}));
}
export namespace permissions {
export const factory = permissionsServiceFactory;
export const mock = simpleMock(coreServices.permissions, () => ({
authorize: jest.fn(),
authorizeConditional: jest.fn(),
}));
}
export namespace rootLifecycle {
export const factory = rootLifecycleServiceFactory;
export const mock = simpleMock(coreServices.rootLifecycle, () => ({
addShutdownHook: jest.fn(),
addStartupHook: jest.fn(),
}));
}
export namespace scheduler {
export const factory = schedulerServiceFactory;
export const mock = simpleMock(coreServices.scheduler, () => ({
createScheduledTaskRunner: jest.fn(),
getScheduledTasks: jest.fn(),
scheduleTask: jest.fn(),
triggerTask: jest.fn(),
}));
}
export namespace urlReader {
export const factory = urlReaderServiceFactory;
export const mock = simpleMock(coreServices.urlReader, () => ({
readTree: jest.fn(),
readUrl: jest.fn(),
search: jest.fn(),
}));
}
}
+2
View File
@@ -140,6 +140,8 @@
},
"devDependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/backend-test-utils": "workspace:^",
"@backstage/config": "workspace:^",
"@backstage/core-app-api": "workspace:^",
"@backstage/core-components": "workspace:^",
@@ -26,7 +26,17 @@ interface StartBackendOptions {
}
export async function startBackend(options: StartBackendOptions) {
if (process.env.EXPERIMENTAL_BACKEND_START) {
const hasDev = await fs.pathExists(paths.resolveTarget('dev'));
if (hasDev) {
const waitForExit = await startBackendExperimental({
entry: 'dev/index',
checksEnabled: false, // not supported
inspectEnabled: options.inspectEnabled,
inspectBrkEnabled: options.inspectBrkEnabled,
});
await waitForExit();
} else if (process.env.EXPERIMENTAL_BACKEND_START) {
const waitForExit = await startBackendExperimental({
entry: 'src/index',
checksEnabled: false, // not supported
@@ -0,0 +1,121 @@
/*
* 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 fs from 'fs-extra';
import mockFs from 'mock-fs';
import { sep, resolve as resolvePath } from 'path';
import { paths } from '../../paths';
import { Task } from '../../tasks';
import { FactoryRegistry } from '../FactoryRegistry';
import { createMockOutputStream, mockPaths } from './common/testUtils';
import { backendModule } from './backendModule';
describe('backendModule factory', () => {
beforeEach(() => {
mockPaths({
targetRoot: '/root',
});
});
afterEach(() => {
mockFs.restore();
jest.resetAllMocks();
});
it('should create a backend plugin', async () => {
mockFs({
'/root': {
packages: {
backend: {
'package.json': JSON.stringify({}),
},
},
plugins: mockFs.directory(),
},
[paths.resolveOwn('templates')]: mockFs.load(
paths.resolveOwn('templates'),
),
});
const options = await FactoryRegistry.populateOptions(backendModule, {
id: 'test',
moduleId: 'tester-two',
});
let modified = false;
const [output, mockStream] = createMockOutputStream();
jest.spyOn(process, 'stderr', 'get').mockReturnValue(mockStream);
jest.spyOn(Task, 'forCommand').mockResolvedValue();
await backendModule.create(options, {
private: true,
isMonoRepo: true,
defaultVersion: '1.0.0',
markAsModified: () => {
modified = true;
},
createTemporaryDirectory: () => fs.mkdtemp('test'),
});
expect(modified).toBe(true);
expect(output).toEqual([
'',
'Creating backend module backstage-plugin-test-backend-module-tester-two',
'Checking Prerequisites:',
`availability plugins${sep}test-backend-module-tester-two`,
'creating temp dir',
'Executing Template:',
'copying .eslintrc.js',
'templating README.md.hbs',
'templating package.json.hbs',
'templating index.ts.hbs',
'templating module.ts.hbs',
'Installing:',
`moving plugins${sep}test-backend-module-tester-two`,
'backend adding dependency',
]);
await expect(
fs.readJson('/root/packages/backend/package.json'),
).resolves.toEqual({
dependencies: {
'backstage-plugin-test-backend-module-tester-two': '^1.0.0',
},
});
const moduleFile = await fs.readFile(
'/root/plugins/test-backend-module-tester-two/src/module.ts',
'utf-8',
);
expect(moduleFile).toContain(
`const testModuleTesterTwo = createBackendModule({`,
);
expect(moduleFile).toContain(`pluginId: 'test',`);
expect(moduleFile).toContain(`moduleId: 'tester-two',`);
expect(Task.forCommand).toHaveBeenCalledTimes(2);
expect(Task.forCommand).toHaveBeenCalledWith('yarn install', {
cwd: resolvePath('/root/plugins/test-backend-module-tester-two'),
optional: true,
});
expect(Task.forCommand).toHaveBeenCalledWith('yarn lint --fix', {
cwd: resolvePath('/root/plugins/test-backend-module-tester-two'),
optional: true,
});
});
});
@@ -0,0 +1,100 @@
/*
* 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 fs from 'fs-extra';
import chalk from 'chalk';
import camelCase from 'lodash/camelCase';
import { paths } from '../../paths';
import { addCodeownersEntry, getCodeownersFilePath } from '../../codeowners';
import { createFactory, CreateContext } from '../types';
import { addPackageDependency, Task } from '../../tasks';
import {
moduleIdIdPrompt,
ownerPrompt,
pluginIdPrompt,
} from './common/prompts';
import { executePluginPackageTemplate } from './common/tasks';
type Options = {
id: string;
moduleId: string;
owner?: string;
codeOwnersPath?: string;
};
export const backendModule = createFactory<Options>({
name: 'backend-module',
description: 'A new backend module',
optionsDiscovery: async () => ({
codeOwnersPath: await getCodeownersFilePath(paths.targetRoot),
}),
optionsPrompts: [pluginIdPrompt(), moduleIdIdPrompt(), ownerPrompt()],
async create(options: Options, ctx: CreateContext) {
const { id: pluginId, moduleId } = options;
const dirName = `${pluginId}-backend-module-${moduleId}`;
const name = ctx.scope
? `@${ctx.scope}/plugin-${dirName}`
: `backstage-plugin-${dirName}`;
Task.log();
Task.log(`Creating backend module ${chalk.cyan(name)}`);
const targetDir = ctx.isMonoRepo
? paths.resolveTargetRoot('plugins', dirName)
: paths.resolveTargetRoot(`backstage-plugin-${dirName}`);
const moduleCamelCase = camelCase(moduleId);
const modulePascalCase =
moduleCamelCase[0].toUpperCase() + moduleCamelCase.slice(1);
const moduleVar = `${camelCase(pluginId)}Module${modulePascalCase}`;
await executePluginPackageTemplate(ctx, {
targetDir,
templateName: 'default-backend-module',
values: {
pluginId,
moduleId,
name,
moduleVar,
packageVersion: ctx.defaultVersion,
privatePackage: ctx.private,
npmRegistry: ctx.npmRegistry,
},
});
if (await fs.pathExists(paths.resolveTargetRoot('packages/backend'))) {
await Task.forItem('backend', 'adding dependency', async () => {
await addPackageDependency(
paths.resolveTargetRoot('packages/backend/package.json'),
{
dependencies: {
[name]: `^${ctx.defaultVersion}`,
},
},
);
});
}
if (options.owner) {
await addCodeownersEntry(`/plugins/${dirName}`, options.owner);
}
await Task.forCommand('yarn install', { cwd: targetDir, optional: true });
await Task.forCommand('yarn lint --fix', {
cwd: targetDir,
optional: true,
});
},
});
@@ -33,6 +33,22 @@ export function pluginIdPrompt(): Prompt<{ id: string }> {
};
}
export function moduleIdIdPrompt(): Prompt<{ moduleId: string }> {
return {
type: 'input',
name: 'moduleId',
message: 'Enter the ID of the module [required]',
validate: (value: string) => {
if (!value) {
return 'Please enter the ID of the module';
} else if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(value)) {
return 'Module IDs must be lowercase and contain only letters, digits, and dashes.';
}
return true;
},
};
}
export function ownerPrompt(): Prompt<{
owner?: string;
codeOwnersPath?: string;
@@ -16,6 +16,7 @@
export { frontendPlugin } from './frontendPlugin';
export { backendPlugin } from './backendPlugin';
export { backendModule } from './backendModule';
export { webLibraryPackage } from './webLibraryPackage';
export { pluginCommon } from './pluginCommon';
export { pluginNode } from './pluginNode';
+4
View File
@@ -35,6 +35,8 @@ leaving any imports in place.
*/
import { version as backendCommon } from '../../../../packages/backend-common/package.json';
import { version as backendPluginApi } from '../../../../packages/backend-plugin-api/package.json';
import { version as backendTestUtils } from '../../../../packages/backend-test-utils/package.json';
import { version as cli } from '../../../../packages/cli/package.json';
import { version as config } from '../../../../packages/config/package.json';
import { version as coreAppApi } from '../../../../packages/core-app-api/package.json';
@@ -47,6 +49,8 @@ import { version as scaffolderBackend } from '../../../../plugins/scaffolder-bac
export const packageVersions: Record<string, string> = {
'@backstage/backend-common': backendCommon,
'@backstage/backend-plugin-api': backendPluginApi,
'@backstage/backend-test-utils': backendTestUtils,
'@backstage/cli': cli,
'@backstage/config': config,
'@backstage/core-app-api': coreAppApi,
@@ -0,0 +1 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
@@ -0,0 +1,5 @@
# {{name}}
The {{moduleId}} backend module for the {{pluginId}} plugin.
_This plugin was created through the Backstage CLI_
@@ -0,0 +1,42 @@
{
"name": "{{name}}",
"description": "The {{moduleId}} backend module for the {{pluginId}} plugin.",
"version": "{{packageVersion}}",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
{{#if privatePackage}}
"private": {{privatePackage}},
{{/if}}
"publishConfig": {
{{#if npmRegistry}}
"registry": "{{npmRegistry}}",
{{/if}}
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
},
"backstage": {
"role": "backend-plugin-module"
},
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"clean": "backstage-cli package clean",
"prepack": "backstage-cli package prepack",
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@backstage/backend-common": "{{versionQuery '@backstage/backend-common'}}",
"@backstage/backend-plugin-api": "{{versionQuery '@backstage/backend-plugin-api'}}"
},
"devDependencies": {
"@backstage/backend-test-utils": "{{versionQuery '@backstage/backend-test-utils'}}",
"@backstage/cli": "{{versionQuery '@backstage/cli'}}"
},
"files": [
"dist"
]
}
@@ -0,0 +1,8 @@
/***/
/**
* The {{moduleId}} backend module for the {{pluginId}} plugin.
*
* @packageDocumentation
*/
export { {{moduleVar}} } from './module';
@@ -0,0 +1,14 @@
import { coreServices, createBackendModule } from '@backstage/backend-plugin-api';
export const {{moduleVar}} = createBackendModule({
pluginId: '{{pluginId}}',
moduleId: '{{moduleId}}',
register(reg) {
reg.registerInit({
deps: { logger: coreServices.logger },
async init({ logger }) {
logger.info('Hello World!')
},
});
},
});
@@ -0,0 +1,9 @@
{
"extends": "@backstage/cli/config/tsconfig.json",
"include": ["src"],
"exclude": ["node_modules"],
"compilerOptions": {
"outDir": "dist-types",
"rootDir": "."
}
}
+6 -3
View File
@@ -56,6 +56,7 @@ import { ProfileInfo } from '@backstage/core-plugin-api';
import { ProfileInfoApi } from '@backstage/core-plugin-api';
import { PropsWithChildren } from 'react';
import PropTypes from 'prop-types';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { SessionApi } from '@backstage/core-plugin-api';
@@ -113,7 +114,7 @@ export type ApiFactoryScope = 'default' | 'app' | 'static';
// @public
export const ApiProvider: {
(props: PropsWithChildren<ApiProviderProps>): JSX.Element;
(props: PropsWithChildren<ApiProviderProps>): React_2.JSX.Element;
propTypes: {
apis: PropTypes.Validator<
NonNullable<
@@ -235,7 +236,7 @@ export type AppRouteBinder = <
) => void;
// @public
export function AppRouter(props: AppRouterProps): JSX.Element;
export function AppRouter(props: AppRouterProps): React_2.JSX.Element;
// @public
export interface AppRouterProps {
@@ -368,7 +369,9 @@ export type ErrorBoundaryFallbackProps = PropsWithChildren<{
}>;
// @public
export const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element;
export const FeatureFlagged: (
props: FeatureFlaggedProps,
) => React_2.JSX.Element;
// @public
export type FeatureFlaggedProps = {
+113 -81
View File
@@ -54,7 +54,9 @@ import { TooltipProps } from '@material-ui/core/Tooltip';
import { WithStyles } from '@material-ui/core/styles';
// @public
export function AlertDisplay(props: AlertDisplayProps): JSX.Element | null;
export function AlertDisplay(
props: AlertDisplayProps,
): React_2.JSX.Element | null;
// @public
export type AlertDisplayProps = {
@@ -66,7 +68,7 @@ export type AlertDisplayProps = {
};
// @public
export function Avatar(props: AvatarProps): JSX.Element;
export function Avatar(props: AvatarProps): React_2.JSX.Element;
// @public (undocumented)
export type AvatarClassKey = 'avatar';
@@ -94,7 +96,7 @@ export type BackstageOverrides = Overrides & {
export type BoldHeaderClassKey = 'root' | 'title' | 'subheader';
// @public
export function BottomLink(props: BottomLinkProps): JSX.Element;
export function BottomLink(props: BottomLinkProps): React_2.JSX.Element;
// @public (undocumented)
export type BottomLinkClassKey = 'root' | 'boxTitle' | 'arrow';
@@ -109,7 +111,7 @@ export type BottomLinkProps = {
// Warning: (ae-forgotten-export) The symbol "Props_19" needs to be exported by the entry point index.d.ts
//
// @public
export function Breadcrumbs(props: Props_19): JSX.Element;
export function Breadcrumbs(props: Props_19): React_2.JSX.Element;
// @public (undocumented)
export type BreadcrumbsClickableTextClassKey = 'root';
@@ -120,7 +122,7 @@ export type BreadcrumbsStyledBoxClassKey = 'root';
// Warning: (ae-forgotten-export) The symbol "IconComponentProps" needs to be exported by the entry point index.d.ts
//
// @public
export function BrokenImageIcon(props: IconComponentProps): JSX.Element;
export function BrokenImageIcon(props: IconComponentProps): React_2.JSX.Element;
// @public @deprecated (undocumented)
export const Button: (props: LinkButtonProps) => JSX.Element;
@@ -134,22 +136,24 @@ export type CardActionsTopRightClassKey = 'root';
// Warning: (ae-forgotten-export) The symbol "CardTabProps" needs to be exported by the entry point index.d.ts
//
// @public
export function CardTab(props: PropsWithChildren<CardTabProps>): JSX.Element;
export function CardTab(
props: PropsWithChildren<CardTabProps>,
): React_2.JSX.Element;
// @public (undocumented)
export type CardTabClassKey = 'root' | 'selected';
// @public (undocumented)
export function CatalogIcon(props: IconComponentProps): JSX.Element;
export function CatalogIcon(props: IconComponentProps): React_2.JSX.Element;
// @public (undocumented)
export function ChatIcon(props: IconComponentProps): JSX.Element;
export function ChatIcon(props: IconComponentProps): React_2.JSX.Element;
// @public (undocumented)
export type ClosedDropdownClassKey = 'icon';
// @public
export function CodeSnippet(props: CodeSnippetProps): JSX.Element;
export function CodeSnippet(props: CodeSnippetProps): React_2.JSX.Element;
// @public
export interface CodeSnippetProps {
@@ -164,14 +168,16 @@ export interface CodeSnippetProps {
// Warning: (ae-forgotten-export) The symbol "Props_13" needs to be exported by the entry point index.d.ts
//
// @public
export function Content(props: PropsWithChildren<Props_13>): JSX.Element;
export function Content(
props: PropsWithChildren<Props_13>,
): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "ContentHeaderProps" needs to be exported by the entry point index.d.ts
//
// @public
export function ContentHeader(
props: PropsWithChildren<ContentHeaderProps>,
): JSX.Element;
): React_2.JSX.Element;
// @public (undocumented)
export type ContentHeaderClassKey =
@@ -182,7 +188,7 @@ export type ContentHeaderClassKey =
| 'title';
// @public
export function CopyTextButton(props: CopyTextButtonProps): JSX.Element;
export function CopyTextButton(props: CopyTextButtonProps): React_2.JSX.Element;
// @public
export interface CopyTextButtonProps {
@@ -193,7 +199,9 @@ export interface CopyTextButtonProps {
}
// @public
export function CreateButton(props: CreateButtonProps): JSX.Element | null;
export function CreateButton(
props: CreateButtonProps,
): React_2.JSX.Element | null;
// @public
export type CreateButtonProps = {
@@ -204,12 +212,12 @@ export type CreateButtonProps = {
export type CustomProviderClassKey = 'form' | 'button';
// @public (undocumented)
export function DashboardIcon(props: IconComponentProps): JSX.Element;
export function DashboardIcon(props: IconComponentProps): React_2.JSX.Element;
// @public
export function DependencyGraph<NodeData, EdgeData>(
props: DependencyGraphProps<NodeData, EdgeData>,
): JSX.Element;
): React_2.JSX.Element;
// @public (undocumented)
export type DependencyGraphDefaultLabelClassKey = 'text';
@@ -301,7 +309,7 @@ export namespace DependencyGraphTypes {
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export const DismissableBanner: (props: Props) => JSX.Element;
export const DismissableBanner: (props: Props) => React_2.JSX.Element;
// @public (undocumented)
export type DismissableBannerClassKey =
@@ -317,15 +325,15 @@ export type DismissableBannerClassKey =
export type DismissbleBannerClassKey = DismissableBannerClassKey;
// @public (undocumented)
export function DocsIcon(props: IconComponentProps): JSX.Element;
export function DocsIcon(props: IconComponentProps): React_2.JSX.Element;
// @public (undocumented)
export function EmailIcon(props: IconComponentProps): JSX.Element;
export function EmailIcon(props: IconComponentProps): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props_2" needs to be exported by the entry point index.d.ts
//
// @public
export function EmptyState(props: Props_2): JSX.Element;
export function EmptyState(props: Props_2): React_2.JSX.Element;
// @public (undocumented)
export type EmptyStateClassKey = 'root' | 'action' | 'imageContainer';
@@ -347,7 +355,7 @@ export type ErrorBoundaryProps = {
// Warning: (ae-forgotten-export) The symbol "IErrorPageProps" needs to be exported by the entry point index.d.ts
//
// @public
export function ErrorPage(props: IErrorPageProps): JSX.Element;
export function ErrorPage(props: IErrorPageProps): React_2.JSX.Element;
// @public (undocumented)
export type ErrorPageClassKey = 'container' | 'title' | 'subtitle';
@@ -355,7 +363,7 @@ export type ErrorPageClassKey = 'container' | 'title' | 'subtitle';
// @public
export function ErrorPanel(
props: PropsWithChildren<ErrorPanelProps>,
): JSX.Element;
): React_2.JSX.Element;
// @public (undocumented)
export type ErrorPanelClassKey = 'text' | 'divider';
@@ -382,18 +390,18 @@ export type FeatureCalloutCircleClassKey =
// @public
export function FeatureCalloutCircular(
props: PropsWithChildren<Props_4>,
): JSX.Element;
): React_2.JSX.Element;
// @public (undocumented)
export type FiltersContainerClassKey = 'root' | 'title';
// @public
export function Gauge(props: GaugeProps): JSX.Element;
export function Gauge(props: GaugeProps): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props_10" needs to be exported by the entry point index.d.ts
//
// @public
export function GaugeCard(props: Props_10): JSX.Element;
export function GaugeCard(props: Props_10): React_2.JSX.Element;
// @public (undocumented)
export type GaugeCardClassKey = 'root';
@@ -429,18 +437,20 @@ export type GaugePropsGetColorOptions = {
};
// @public (undocumented)
export function GitHubIcon(props: IconComponentProps): JSX.Element;
export function GitHubIcon(props: IconComponentProps): React_2.JSX.Element;
// @public (undocumented)
export function GroupIcon(props: IconComponentProps): JSX.Element;
export function GroupIcon(props: IconComponentProps): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props_14" needs to be exported by the entry point index.d.ts
//
// @public
export function Header(props: PropsWithChildren<Props_14>): JSX.Element;
export function Header(props: PropsWithChildren<Props_14>): React_2.JSX.Element;
// @public (undocumented)
export function HeaderActionMenu(props: HeaderActionMenuProps): JSX.Element;
export function HeaderActionMenu(
props: HeaderActionMenuProps,
): React_2.JSX.Element;
// @public (undocumented)
export type HeaderActionMenuItem = {
@@ -471,7 +481,7 @@ export type HeaderClassKey =
// Warning: (ae-forgotten-export) The symbol "Props_5" needs to be exported by the entry point index.d.ts
//
// @public
export function HeaderIconLinkRow(props: Props_5): JSX.Element;
export function HeaderIconLinkRow(props: Props_5): React_2.JSX.Element;
// @public (undocumented)
export type HeaderIconLinkRowClassKey = 'links';
@@ -479,7 +489,7 @@ export type HeaderIconLinkRowClassKey = 'links';
// Warning: (ae-forgotten-export) The symbol "HeaderLabelProps" needs to be exported by the entry point index.d.ts
//
// @public
export function HeaderLabel(props: HeaderLabelProps): JSX.Element;
export function HeaderLabel(props: HeaderLabelProps): React_2.JSX.Element;
// @public (undocumented)
export type HeaderLabelClassKey = 'root' | 'label' | 'value';
@@ -487,7 +497,7 @@ export type HeaderLabelClassKey = 'root' | 'label' | 'value';
// Warning: (ae-forgotten-export) The symbol "HeaderTabsProps" needs to be exported by the entry point index.d.ts
//
// @public
export function HeaderTabs(props: HeaderTabsProps): JSX.Element;
export function HeaderTabs(props: HeaderTabsProps): React_2.JSX.Element;
// @public (undocumented)
export type HeaderTabsClassKey =
@@ -497,14 +507,14 @@ export type HeaderTabsClassKey =
| 'tabRoot';
// @public (undocumented)
export function HelpIcon(props: IconComponentProps): JSX.Element;
export function HelpIcon(props: IconComponentProps): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props_6" needs to be exported by the entry point index.d.ts
//
// @public
export function HorizontalScrollGrid(
props: PropsWithChildren<Props_6>,
): JSX.Element;
): React_2.JSX.Element;
// @public (undocumented)
export type HorizontalScrollGridClassKey =
@@ -563,16 +573,16 @@ export type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';
// Warning: (ae-forgotten-export) The symbol "IntroCardProps" needs to be exported by the entry point index.d.ts
//
// @public
export function IntroCard(props: IntroCardProps): JSX.Element;
export function IntroCard(props: IntroCardProps): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "ItemCardProps" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ItemCard" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public @deprecated
export function ItemCard(props: ItemCardProps): JSX.Element;
export function ItemCard(props: ItemCardProps): React_2.JSX.Element;
// @public
export function ItemCardGrid(props: ItemCardGridProps): JSX.Element;
export function ItemCardGrid(props: ItemCardGridProps): React_2.JSX.Element;
// @public (undocumented)
export type ItemCardGridClassKey = 'root';
@@ -585,7 +595,7 @@ export type ItemCardGridProps = Partial<WithStyles<typeof styles>> & {
};
// @public
export function ItemCardHeader(props: ItemCardHeaderProps): JSX.Element;
export function ItemCardHeader(props: ItemCardHeaderProps): React_2.JSX.Element;
// @public (undocumented)
export type ItemCardHeaderClassKey = 'root';
@@ -603,7 +613,7 @@ export type ItemCardHeaderProps = Partial<WithStyles<typeof styles_2>> & {
// Warning: (ae-missing-release-tag) "Lifecycle" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function Lifecycle(props: Props_7): JSX.Element;
export function Lifecycle(props: Props_7): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "LifecycleClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -614,7 +624,7 @@ export type LifecycleClassKey = 'alpha' | 'beta';
// Warning: (ae-missing-release-tag) "LinearGauge" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function LinearGauge(props: Props_11): JSX.Element | null;
export function LinearGauge(props: Props_11): React_2.JSX.Element | null;
// Warning: (ae-missing-release-tag) "Link" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -644,7 +654,7 @@ export type LinkProps = Omit<LinkProps_2, 'to'> &
export type LoginRequestListItemClassKey = 'root';
// @public
export function LogViewer(props: LogViewerProps): JSX.Element;
export function LogViewer(props: LogViewerProps): React_2.JSX.Element;
// @public
export type LogViewerClassKey =
@@ -691,7 +701,7 @@ export interface LogViewerProps {
// Warning: (ae-missing-release-tag) "MarkdownContent" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function MarkdownContent(props: Props_8): JSX.Element;
export function MarkdownContent(props: Props_8): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "MarkdownContentClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -727,7 +737,9 @@ export type MicDropClassKey = 'micDrop';
// Warning: (ae-missing-release-tag) "MissingAnnotationEmptyState" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function MissingAnnotationEmptyState(props: Props_3): JSX.Element;
export function MissingAnnotationEmptyState(
props: Props_3,
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "MissingAnnotationEmptyStateClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -735,7 +747,9 @@ export function MissingAnnotationEmptyState(props: Props_3): JSX.Element;
export type MissingAnnotationEmptyStateClassKey = 'code';
// @public
export const MobileSidebar: (props: MobileSidebarProps) => JSX.Element | null;
export const MobileSidebar: (
props: MobileSidebarProps,
) => React_2.JSX.Element | null;
// @public
export type MobileSidebarProps = {
@@ -745,7 +759,7 @@ export type MobileSidebarProps = {
// Warning: (ae-missing-release-tag) "OAuthRequestDialog" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function OAuthRequestDialog(_props: {}): JSX.Element;
export function OAuthRequestDialog(_props: {}): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "OAuthRequestDialogClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -765,7 +779,7 @@ export type OpenedDropdownClassKey = 'icon';
// Warning: (ae-missing-release-tag) "OverflowTooltip" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function OverflowTooltip(props: Props_9): JSX.Element;
export function OverflowTooltip(props: Props_9): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "OverflowTooltipClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -776,7 +790,7 @@ export type OverflowTooltipClassKey = 'container';
// Warning: (ae-missing-release-tag) "Page" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function Page(props: Props_16): JSX.Element;
export function Page(props: Props_16): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "PageClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -789,19 +803,19 @@ export type PageClassKey = 'root';
// @public (undocumented)
export function PageWithHeader(
props: PropsWithChildren<PageWithHeaderProps>,
): JSX.Element;
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "Progress" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function Progress(
props: PropsWithChildren<LinearProgressProps>,
): JSX.Element;
): React_2.JSX.Element;
// @public
export const ProxiedSignInPage: (
props: ProxiedSignInPageProps,
) => JSX.Element | null;
) => React_2.JSX.Element | null;
// @public
export type ProxiedSignInPageProps = SignInPageProps & {
@@ -812,7 +826,7 @@ export type ProxiedSignInPageProps = SignInPageProps & {
// Warning: (ae-missing-release-tag) "ResponseErrorPanel" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function ResponseErrorPanel(props: ErrorPanelProps): JSX.Element;
export function ResponseErrorPanel(props: ErrorPanelProps): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "ResponseErrorPanelClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -822,12 +836,14 @@ export type ResponseErrorPanelClassKey = 'text' | 'divider';
// Warning: (ae-missing-release-tag) "RoutedTabs" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function RoutedTabs(props: { routes: SubRoute_2[] }): JSX.Element;
export function RoutedTabs(props: {
routes: SubRoute_2[];
}): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "SelectProps" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export function Select(props: SelectProps): JSX.Element;
export function Select(props: SelectProps): React_2.JSX.Element;
// @public (undocumented)
export type SelectClassKey =
@@ -851,7 +867,7 @@ export type SelectItem = {
};
// @public
export const Sidebar: (props: SidebarProps) => JSX.Element;
export const Sidebar: (props: SidebarProps) => React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SIDEBAR_INTRO_LOCAL_STORAGE" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -905,10 +921,10 @@ export const SidebarDivider: React_2.ComponentType<
export type SidebarDividerClassKey = 'root';
// @public
export const SidebarExpandButton: () => JSX.Element | null;
export const SidebarExpandButton: () => React_2.JSX.Element | null;
// @public
export const SidebarGroup: (props: SidebarGroupProps) => JSX.Element;
export const SidebarGroup: (props: SidebarGroupProps) => React_2.JSX.Element;
// @public
export interface SidebarGroupProps extends BottomNavigationActionProps {
@@ -920,7 +936,7 @@ export interface SidebarGroupProps extends BottomNavigationActionProps {
// Warning: (ae-missing-release-tag) "SidebarIntro" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function SidebarIntro(_props: {}): JSX.Element | null;
export function SidebarIntro(_props: {}): React_2.JSX.Element | null;
// @public (undocumented)
export type SidebarIntroClassKey =
@@ -967,7 +983,7 @@ export type SidebarOpenState = {
export function SidebarOpenStateProvider(props: {
children: ReactNode;
value: SidebarOpenState;
}): JSX.Element;
}): React_2.JSX.Element;
// @public (undocumented)
export type SidebarOptions = {
@@ -978,7 +994,7 @@ export type SidebarOptions = {
// Warning: (ae-missing-release-tag) "SidebarPage" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function SidebarPage(props: SidebarPageProps): JSX.Element;
export function SidebarPage(props: SidebarPageProps): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SidebarPageClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1011,7 +1027,7 @@ export type SidebarPinStateContextType = {
export function SidebarPinStateProvider(props: {
children: ReactNode;
value: SidebarPinStateContextType;
}): JSX.Element;
}): React_2.JSX.Element;
// @public (undocumented)
export type SidebarProps = {
@@ -1036,7 +1052,9 @@ export const SidebarScrollWrapper: React_2.ComponentType<
// Warning: (ae-missing-release-tag) "SidebarSearchField" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function SidebarSearchField(props: SidebarSearchFieldProps): JSX.Element;
export function SidebarSearchField(
props: SidebarSearchFieldProps,
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SidebarSpace" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1067,12 +1085,14 @@ export const SidebarSpacer: React_2.ComponentType<
export type SidebarSpacerClassKey = 'root';
// @public
export const SidebarSubmenu: (props: SidebarSubmenuProps) => JSX.Element;
export const SidebarSubmenu: (
props: SidebarSubmenuProps,
) => React_2.JSX.Element;
// @public
export const SidebarSubmenuItem: (
props: SidebarSubmenuItemProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export type SidebarSubmenuItemDropdownItem = {
@@ -1100,7 +1120,7 @@ export type SidebarSubmenuProps = {
// Warning: (ae-missing-release-tag) "SignInPage" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function SignInPage(props: Props_17): JSX.Element;
export function SignInPage(props: Props_17): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SignInPageClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1123,7 +1143,7 @@ export type SignInProviderConfig = {
// @public (undocumented)
export function SimpleStepper(
props: PropsWithChildren<StepperProps>,
): JSX.Element;
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SimpleStepperFooterClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1136,7 +1156,7 @@ export type SimpleStepperFooterClassKey = 'root';
// @public (undocumented)
export function SimpleStepperStep(
props: PropsWithChildren<StepProps>,
): JSX.Element;
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SimpleStepperStepClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1146,7 +1166,9 @@ export type SimpleStepperStepClassKey = 'end';
// Warning: (ae-missing-release-tag) "StatusAborted" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StatusAborted(props: PropsWithChildren<{}>): JSX.Element;
export function StatusAborted(
props: PropsWithChildren<{}>,
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "StatusClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1163,33 +1185,39 @@ export type StatusClassKey =
// Warning: (ae-missing-release-tag) "StatusError" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StatusError(props: PropsWithChildren<{}>): JSX.Element;
export function StatusError(props: PropsWithChildren<{}>): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "StatusOK" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StatusOK(props: PropsWithChildren<{}>): JSX.Element;
export function StatusOK(props: PropsWithChildren<{}>): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "StatusPending" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StatusPending(props: PropsWithChildren<{}>): JSX.Element;
export function StatusPending(
props: PropsWithChildren<{}>,
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "StatusRunning" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StatusRunning(props: PropsWithChildren<{}>): JSX.Element;
export function StatusRunning(
props: PropsWithChildren<{}>,
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "StatusWarning" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StatusWarning(props: PropsWithChildren<{}>): JSX.Element;
export function StatusWarning(
props: PropsWithChildren<{}>,
): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props_12" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "StructuredMetadataTable" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function StructuredMetadataTable(props: Props_12): JSX.Element;
export function StructuredMetadataTable(props: Props_12): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "StructuredMetadataTableListClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1211,7 +1239,7 @@ export type SubmenuOptions = {
// Warning: (ae-missing-release-tag) "SubvalueCell" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function SubvalueCell(props: SubvalueCellProps): JSX.Element;
export function SubvalueCell(props: SubvalueCellProps): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SubvalueCellClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1222,7 +1250,7 @@ export type SubvalueCellClassKey = 'value' | 'subvalue';
// Warning: (ae-missing-release-tag) "SupportButton" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function SupportButton(props: SupportButtonProps): JSX.Element;
export function SupportButton(props: SupportButtonProps): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "SupportButtonClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1272,7 +1300,9 @@ export type Tab = {
// Warning: (ae-missing-release-tag) "TabbedCard" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function TabbedCard(props: PropsWithChildren<Props_18>): JSX.Element;
export function TabbedCard(
props: PropsWithChildren<Props_18>,
): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "TabbedCardClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -1283,7 +1313,7 @@ export type TabbedCardClassKey = 'root' | 'indicator';
// Warning: (ae-missing-release-tag) "TabbedLayout" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function TabbedLayout(props: PropsWithChildren<{}>): JSX.Element;
export function TabbedLayout(props: PropsWithChildren<{}>): React_2.JSX.Element;
// @public (undocumented)
export namespace TabbedLayout {
@@ -1296,7 +1326,9 @@ export namespace TabbedLayout {
// Warning: (ae-missing-release-tag) "Table" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function Table<T extends object = {}>(props: TableProps<T>): JSX.Element;
export function Table<T extends object = {}>(
props: TableProps<T>,
): React_2.JSX.Element;
// @public (undocumented)
export namespace Table {
@@ -1385,7 +1417,7 @@ export function TrendLine(
Pick<SparklinesLineProps, 'color'> & {
title?: string;
},
): JSX.Element | null;
): React_2.JSX.Element | null;
// @public
export function useContent(): {
@@ -1403,7 +1435,7 @@ export function useQueryParamState<T>(
): [T | undefined, SetQueryParams<T>];
// @public (undocumented)
export function UserIcon(props: IconComponentProps): JSX.Element;
export function UserIcon(props: IconComponentProps): React_2.JSX.Element;
// @public
export class UserIdentity implements IdentityApi {
@@ -1449,13 +1481,13 @@ export const useSidebarPinState: () => SidebarPinState;
export function useSupportConfig(): SupportConfig;
// @public (undocumented)
export function WarningIcon(props: IconComponentProps): JSX.Element;
export function WarningIcon(props: IconComponentProps): React_2.JSX.Element;
// Warning: (ae-forgotten-export) The symbol "WarningProps" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "WarningPanel" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function WarningPanel(props: WarningProps): JSX.Element;
export function WarningPanel(props: WarningProps): React_2.JSX.Element;
// Warning: (ae-missing-release-tag) "WarningPanelClassKey" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
+4 -2
View File
@@ -45,7 +45,7 @@ export const analyticsApiRef: ApiRef<AnalyticsApi>;
export const AnalyticsContext: (options: {
attributes: Partial<AnalyticsContextValue>;
children: ReactNode;
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public
export type AnalyticsContextValue = CommonAnalyticsContext & {
@@ -782,7 +782,9 @@ export function withApis<T extends {}>(
): <TProps extends T>(
WrappedComponent: React_2.ComponentType<TProps>,
) => {
(props: React_2.PropsWithChildren<Omit<TProps, keyof T>>): JSX.Element;
(
props: React_2.PropsWithChildren<Omit<TProps, keyof T>>,
): React_2.JSX.Element;
displayName: string;
};
```
+2 -3
View File
@@ -3,8 +3,6 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { ApiFactory } from '@backstage/core-plugin-api';
import { ApiRef } from '@backstage/core-plugin-api';
import { AuthRequestOptions } from '@backstage/core-plugin-api';
@@ -13,6 +11,7 @@ import { Config } from '@backstage/config';
import { OAuthApi } from '@backstage/core-plugin-api';
import { OpenIdConnectApi } from '@backstage/core-plugin-api';
import { ProfileInfoApi } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { ScmIntegrationRegistry } from '@backstage/integration';
import { SessionApi } from '@backstage/core-plugin-api';
@@ -108,7 +107,7 @@ export interface ScmAuthTokenResponse {
// @public
export const ScmIntegrationIcon: (
props: ScmIntegrationIconProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export type ScmIntegrationIconProps = {
+1 -1
View File
@@ -37,6 +37,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
@@ -53,7 +54,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+2 -1
View File
@@ -4,11 +4,12 @@
```ts
import { PropsWithChildren } from 'react';
import { default as React_2 } from 'react';
// @alpha
export const MockPluginProvider: ({
children,
}: PropsWithChildren<{}>) => JSX.Element;
}: PropsWithChildren<{}>) => React_2.JSX.Element;
// (No @packageDocumentation comment for this package)
```
+2 -1
View File
@@ -26,6 +26,7 @@ import { JsonValue } from '@backstage/types';
import { MatcherFunction } from '@testing-library/react';
import { Observable } from '@backstage/types';
import { PermissionApi } from '@backstage/plugin-permission-react';
import { default as React_2 } from 'react';
import { ReactElement } from 'react';
import { ReactNode } from 'react';
import { RenderOptions } from '@testing-library/react';
@@ -214,7 +215,7 @@ export type SyncLogCollector = () => void;
// @public
export const TestApiProvider: <T extends any[]>(
props: TestApiProviderProps<T>,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export type TestApiProviderProps<TApiPairs extends any[]> = {
+7 -2
View File
@@ -12,6 +12,8 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { FetchApi } from '@backstage/core-plugin-api';
import { isAdrAvailable } from '@backstage/plugin-adr-common';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { ResultHighlight } from '@backstage/plugin-search-common';
import { RouteRef } from '@backstage/core-plugin-api';
@@ -76,7 +78,10 @@ export const adrPlugin: BackstagePlugin<
// @public
export const AdrReader: {
(props: { adr: string; decorators?: AdrContentDecorator[] }): JSX.Element;
(props: {
adr: string;
decorators?: AdrContentDecorator[];
}): React_2.JSX.Element;
decorators: Readonly<{
createRewriteRelativeLinksDecorator(): AdrContentDecorator;
createRewriteRelativeEmbedsDecorator(): AdrContentDecorator;
@@ -107,7 +112,7 @@ export type AdrSearchResultListItemProps = {
export const EntityAdrContent: (props: {
contentDecorators?: AdrContentDecorator[] | undefined;
filePathFilterFn?: AdrFilePathFilterFn | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
export { isAdrAvailable };
```
+2 -3
View File
@@ -3,10 +3,9 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
@@ -19,7 +18,7 @@ export const airbrakePlugin: BackstagePlugin<
>;
// @public
export const EntityAirbrakeContent: () => JSX.Element;
export const EntityAirbrakeContent: () => React_2.JSX.Element;
// @public
export const isAirbrakeAvailable: (entity: Entity) => boolean;
+1 -1
View File
@@ -38,6 +38,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
@@ -55,7 +56,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+2 -1
View File
@@ -7,6 +7,7 @@
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
@@ -22,7 +23,7 @@ export const allurePlugin: BackstagePlugin<
>;
// @public (undocumented)
export const EntityAllureReportContent: () => JSX.Element;
export const EntityAllureReportContent: () => JSX_2.Element;
// @public (undocumented)
export const isAllureReportAvailable: (entity: Entity) => boolean;
+1 -1
View File
@@ -37,6 +37,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
@@ -54,7 +55,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+3 -2
View File
@@ -6,15 +6,16 @@
/// <reference types="react" />
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
export const ApacheAirflowDagTable: (props: {
dagIds?: string[] | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const ApacheAirflowPage: () => JSX.Element;
export const ApacheAirflowPage: () => JSX_2.Element;
// @public (undocumented)
export const apacheAirflowPlugin: BackstagePlugin<
+1 -1
View File
@@ -33,6 +33,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"qs": "^6.10.1",
"react-use": "^17.2.4"
@@ -52,7 +53,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
@@ -3,12 +3,12 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { default as React_2 } from 'react';
// @public (undocumented)
export const grpcDocsApiWidget: {
type: string;
title: string;
component: (definition: string) => JSX.Element;
component: (definition: string) => React_2.JSX.Element;
};
```
@@ -31,6 +31,7 @@
"postpack": "backstage-cli package postpack"
},
"dependencies": {
"@types/react": "^16.13.1 || ^17.0.0",
"grpc-docs": "^1.1.2"
},
"peerDependencies": {
@@ -40,8 +41,7 @@
},
"devDependencies": {
"@backstage/cli": "workspace:^",
"@testing-library/jest-dom": "^5.16.4",
"@types/react": "^16.13.1 || ^17.0.0"
"@testing-library/jest-dom": "^5.16.4"
},
"files": [
"dist"
+25 -22
View File
@@ -11,6 +11,7 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
import { CatalogTableRow } from '@backstage/plugin-catalog';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { TableColumn } from '@backstage/core-components';
@@ -18,14 +19,14 @@ import { TableProps } from '@backstage/core-components';
import { UserListFilterKind } from '@backstage/plugin-catalog-react';
// @public (undocumented)
export const ApiDefinitionCard: () => JSX.Element;
export const ApiDefinitionCard: () => React_2.JSX.Element;
// @public
export function ApiDefinitionDialog(props: {
open: boolean;
entity: ApiEntity;
onClose: () => void;
}): JSX.Element;
}): React_2.JSX.Element;
// @public (undocumented)
export type ApiDefinitionWidget = {
@@ -62,20 +63,22 @@ export { apiDocsPlugin as plugin };
// @public
export const ApiExplorerIndexPage: (
props: DefaultApiExplorerPageProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export const ApiExplorerPage: (
props: DefaultApiExplorerPageProps,
) => JSX.Element;
) => JSX_2.Element;
// @public (undocumented)
export const ApiTypeTitle: (props: { apiEntity: ApiEntity }) => JSX.Element;
export const ApiTypeTitle: (props: {
apiEntity: ApiEntity;
}) => React_2.JSX.Element;
// @public (undocumented)
export const AsyncApiDefinitionWidget: (
props: AsyncApiDefinitionWidgetProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type AsyncApiDefinitionWidgetProps = {
@@ -86,17 +89,17 @@ export type AsyncApiDefinitionWidgetProps = {
export const ConsumedApisCard: (props: {
variant?: InfoCardVariants;
columns?: TableColumn<ApiEntity>[];
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public (undocumented)
export const ConsumingComponentsCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public
export const DefaultApiExplorerPage: (
props: DefaultApiExplorerPageProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export type DefaultApiExplorerPageProps = {
@@ -109,40 +112,40 @@ export type DefaultApiExplorerPageProps = {
export function defaultDefinitionWidgets(): ApiDefinitionWidget[];
// @public (undocumented)
export const EntityApiDefinitionCard: () => JSX.Element;
export const EntityApiDefinitionCard: () => JSX_2.Element;
// @public (undocumented)
export const EntityConsumedApisCard: (props: {
variant?: InfoCardVariants | undefined;
columns?: TableColumn<ApiEntity>[] | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityConsumingComponentsCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityHasApisCard: (props: {
variant?: InfoCardVariants | undefined;
columns?: TableColumn<ApiEntity>[] | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityProvidedApisCard: (props: {
variant?: InfoCardVariants | undefined;
columns?: TableColumn<ApiEntity>[] | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityProvidingComponentsCard: (props: {
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const GraphQlDefinitionWidget: (
props: GraphQlDefinitionWidgetProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type GraphQlDefinitionWidgetProps = {
@@ -153,12 +156,12 @@ export type GraphQlDefinitionWidgetProps = {
export const HasApisCard: (props: {
variant?: InfoCardVariants;
columns?: TableColumn<ApiEntity>[];
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public (undocumented)
export const OpenApiDefinitionWidget: (
props: OpenApiDefinitionWidgetProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type OpenApiDefinitionWidgetProps = {
@@ -168,7 +171,7 @@ export type OpenApiDefinitionWidgetProps = {
// @public (undocumented)
export const PlainApiDefinitionWidget: (
props: PlainApiDefinitionWidgetProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type PlainApiDefinitionWidgetProps = {
@@ -180,17 +183,17 @@ export type PlainApiDefinitionWidgetProps = {
export const ProvidedApisCard: (props: {
variant?: InfoCardVariants;
columns?: TableColumn<ApiEntity>[];
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public (undocumented)
export const ProvidingComponentsCard: (props: {
variant?: InfoCardVariants;
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public (undocumented)
export const TrpcApiDefinitionWidget: (
props: TrpcApiDefinitionWidgetProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type TrpcApiDefinitionWidgetProps = {
+2 -1
View File
@@ -7,6 +7,7 @@
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { JSONObject } from '@apollo/explorer/src/helpers/types';
import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
@@ -30,7 +31,7 @@ export const ApolloExplorerPage: (props: {
}
| undefined;
}[];
}) => JSX.Element;
}) => JSX_2.Element;
// @public
export const apolloExplorerPlugin: BackstagePlugin<
+1 -1
View File
@@ -34,6 +34,7 @@
"@backstage/theme": "workspace:^",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@types/react": "^16.13.1 || ^17.0.0",
"react-use": "^17.2.4",
"use-deep-compare-effect": "^1.8.1"
},
@@ -52,7 +53,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "*",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+6
View File
@@ -10,6 +10,7 @@ import { AuthProviderFactory as AuthProviderFactory_2 } from '@backstage/plugin-
import { AuthProviderRouteHandlers as AuthProviderRouteHandlers_2 } from '@backstage/plugin-auth-node';
import { AuthResolverCatalogUserQuery as AuthResolverCatalogUserQuery_2 } from '@backstage/plugin-auth-node';
import { AuthResolverContext as AuthResolverContext_2 } from '@backstage/plugin-auth-node';
import { BackendFeature } from '@backstage/backend-plugin-api';
import { BackstageSignInResult } from '@backstage/plugin-auth-node';
import { CacheService } from '@backstage/backend-plugin-api';
import { CatalogApi } from '@backstage/catalog-client';
@@ -51,6 +52,9 @@ export type AuthHandlerResult = {
profile: ProfileInfo;
};
// @public
export const authPlugin: () => BackendFeature;
// @public @deprecated (undocumented)
export type AuthProviderConfig = AuthProviderConfig_2;
@@ -658,6 +662,8 @@ export interface RouterOptions {
// (undocumented)
database: PluginDatabaseManager;
// (undocumented)
disableDefaultProviderFactories?: boolean;
// (undocumented)
discovery: PluginEndpointDiscovery;
// (undocumented)
logger: LoggerService;
+10
View File
@@ -31,6 +31,16 @@ export interface Config {
secret?: string;
};
/**
* JWS "alg" (Algorithm) Header Parameter value. Defaults to ES256.
* Must match one of the algorithms defined for IdentityClient.
* When setting a different algorithm, check if the `key` field
* of the `signing_keys` table can fit the length of the generated keys.
* If not, add a knex migration file in the migrations folder.
* More info on supported algorithms: https://github.com/panva/jose
*/
identityTokenAlgorithm?: string;
/** To control how to store JWK data in auth-backend */
keyStore?: {
provider?: 'database' | 'memory' | 'firestore';
+26
View File
@@ -0,0 +1,26 @@
/*
* Copyright 2023 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 { createBackend } from '@backstage/backend-defaults';
import { authPlugin } from '../src';
import { authModuleGoogleProvider } from '@backstage/plugin-auth-backend-module-google-provider';
const backend = createBackend();
backend.add(authPlugin);
backend.add(authModuleGoogleProvider);
backend.start();
+2
View File
@@ -41,6 +41,7 @@
"@backstage/plugin-auth-backend-module-gcp-iap-provider": "workspace:^",
"@backstage/plugin-auth-backend-module-google-provider": "workspace:^",
"@backstage/plugin-auth-node": "workspace:^",
"@backstage/plugin-catalog-node": "workspace:^",
"@backstage/types": "workspace:^",
"@davidzemon/passport-okta-oauth": "^0.0.5",
"@google-cloud/firestore": "^6.0.0",
@@ -80,6 +81,7 @@
"yn": "^4.0.0"
},
"devDependencies": {
"@backstage/backend-defaults": "workspace:^",
"@backstage/backend-test-utils": "workspace:^",
"@backstage/cli": "workspace:^",
"@types/body-parser": "^1.19.0",
@@ -0,0 +1,45 @@
/*
* Copyright 2023 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 { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import request from 'supertest';
import { authPlugin } from './authPlugin';
describe('authPlugin', () => {
it('should provide an OpenID configuration', async () => {
const { server } = await startTestBackend({
features: [
authPlugin,
mockServices.rootConfig.factory({
data: {
app: {
baseUrl: 'http://localhost:3000',
},
},
}),
],
});
const res = await request(server).get(
'/api/auth/.well-known/openid-configuration',
);
expect(res.status).toBe(200);
expect(res.body).toMatchObject({
claims_supported: ['sub'],
issuer: `http://localhost:${server.port()}/api/auth`,
});
});
});
+82
View File
@@ -0,0 +1,82 @@
/*
* Copyright 2023 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 {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import {
AuthProviderFactory,
authProvidersExtensionPoint,
} from '@backstage/plugin-auth-node';
import { catalogServiceRef } from '@backstage/plugin-catalog-node/alpha';
import { createRouter } from './service/router';
/**
* Auth plugin
*
* @public
*/
export const authPlugin = createBackendPlugin({
pluginId: 'auth',
register(reg) {
const providers = new Map<string, AuthProviderFactory>();
reg.registerExtensionPoint(authProvidersExtensionPoint, {
registerProvider({ providerId, factory }) {
if (providers.has(providerId)) {
throw new Error(
`Auth provider '${providerId}' was already registered`,
);
}
providers.set(providerId, factory);
},
});
reg.registerInit({
deps: {
httpRouter: coreServices.httpRouter,
logger: coreServices.logger,
config: coreServices.rootConfig,
database: coreServices.database,
discovery: coreServices.discovery,
tokenManager: coreServices.tokenManager,
catalogApi: catalogServiceRef,
},
async init({
httpRouter,
logger,
config,
database,
discovery,
tokenManager,
catalogApi,
}) {
const router = await createRouter({
logger,
config,
database,
discovery,
tokenManager,
catalogApi,
providerFactories: Object.fromEntries(providers),
disableDefaultProviderFactories: true,
});
httpRouter.use(router);
},
});
},
});
+1
View File
@@ -20,6 +20,7 @@
* @packageDocumentation
*/
export { authPlugin } from './authPlugin';
export * from './service/router';
export type { TokenParams } from './identity';
export * from './providers';
+14 -9
View File
@@ -51,6 +51,7 @@ export interface RouterOptions {
tokenManager: TokenManager;
tokenFactoryAlgorithm?: string;
providerFactories?: ProviderFactories;
disableDefaultProviderFactories?: boolean;
catalogApi?: CatalogApi;
}
@@ -65,7 +66,7 @@ export async function createRouter(
database,
tokenManager,
tokenFactoryAlgorithm,
providerFactories,
providerFactories = {},
catalogApi,
} = options;
const router = Router();
@@ -85,7 +86,9 @@ export async function createRouter(
keyStore,
keyDurationSeconds,
logger: logger.child({ component: 'token-factory' }),
algorithm: tokenFactoryAlgorithm,
algorithm:
tokenFactoryAlgorithm ??
config.getOptionalString('auth.identityTokenAlgorithm'),
});
const secret = config.getOptionalString('auth.session.secret');
@@ -113,19 +116,21 @@ export async function createRouter(
router.use(express.urlencoded({ extended: false }));
router.use(express.json());
const allProviderFactories = {
...defaultAuthProviderFactories,
...providerFactories,
};
const providersConfig = config.getConfig('auth.providers');
const configuredProviders = providersConfig.keys();
const allProviderFactories = options.disableDefaultProviderFactories
? providerFactories
: {
...defaultAuthProviderFactories,
...providerFactories,
};
const providersConfig = config.getOptionalConfig('auth.providers');
const isOriginAllowed = createOriginFilter(config);
for (const [providerId, providerFactory] of Object.entries(
allProviderFactories,
)) {
if (configuredProviders.includes(providerId)) {
if (providersConfig?.has(providerId)) {
logger.info(`Configuring auth provider: ${providerId}`);
try {
const provider = providerFactory({
+10 -6
View File
@@ -14,8 +14,10 @@ import { DiscoveryApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { GitTag } from '@backstage/plugin-azure-devops-common';
import { IdentityApi } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
import { PullRequest } from '@backstage/plugin-azure-devops-common';
import { PullRequestOptions } from '@backstage/plugin-azure-devops-common';
import { default as React_2 } from 'react';
import { Readme } from '@backstage/plugin-azure-devops-common';
import { ReadmeConfig } from '@backstage/plugin-azure-devops-common';
import { RepoBuild } from '@backstage/plugin-azure-devops-common';
@@ -163,14 +165,16 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
export const azureDevOpsPlugin: BackstagePlugin<{}, {}, {}>;
// @public (undocumented)
export const AzurePullRequestsIcon: (props: SvgIconProps) => JSX.Element;
export const AzurePullRequestsIcon: (
props: SvgIconProps,
) => React_2.JSX.Element;
// @public (undocumented)
export const AzurePullRequestsPage: (props: {
projectName?: string | undefined;
pollingInterval?: number | undefined;
defaultColumnConfigs?: PullRequestColumnConfig[] | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export type BaseFilter = {
@@ -223,22 +227,22 @@ export type CreatedByUserFilter = BaseFilter &
);
// @public (undocumented)
export const EntityAzureGitTagsContent: () => JSX.Element;
export const EntityAzureGitTagsContent: () => JSX_2.Element;
// @public (undocumented)
export const EntityAzurePipelinesContent: (props: {
defaultLimit?: number | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityAzurePullRequestsContent: (props: {
defaultLimit?: number | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityAzureReadmeCard: (props: {
maxHeight?: number | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export type Filter =
+1 -1
View File
@@ -38,6 +38,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"humanize-duration": "^3.27.0",
"luxon": "^3.0.0",
"react-use": "^17.2.4"
@@ -57,7 +58,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+4 -2
View File
@@ -13,6 +13,8 @@ import { BackstagePlugin } from '@backstage/core-plugin-api';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { IdentityApi } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
@@ -40,7 +42,7 @@ export class AzureSitesApiBackendClient implements AzureSitesApi {
}
// @public (undocumented)
export const AzureSitesOverviewWidget: () => JSX.Element;
export const AzureSitesOverviewWidget: () => React_2.JSX.Element;
// @public (undocumented)
export const azureSitesPlugin: BackstagePlugin<
@@ -52,7 +54,7 @@ export const azureSitesPlugin: BackstagePlugin<
>;
// @public (undocumented)
export const EntityAzureSitesOverviewWidget: () => JSX.Element;
export const EntityAzureSitesOverviewWidget: () => JSX_2.Element;
// @public (undocumented)
export const isAzureWebSiteNameAvailable: (
+1 -1
View File
@@ -41,6 +41,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"luxon": "^3.0.0",
"react-use": "^17.2.4"
},
@@ -59,7 +60,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+2 -1
View File
@@ -6,6 +6,7 @@
/// <reference types="react" />
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
// @public (undocumented)
export const badgesPlugin: BackstagePlugin<{}, {}, {}>;
@@ -14,5 +15,5 @@ export const badgesPlugin: BackstagePlugin<{}, {}, {}>;
export const EntityBadgesDialog: (props: {
open: boolean;
onClose?: (() => any) | undefined;
}) => JSX.Element;
}) => JSX_2.Element;
```
+1
View File
@@ -38,6 +38,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
+6 -4
View File
@@ -8,12 +8,14 @@
import { ApiHolder } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
export const BazaarOverviewCard: (
props: BazaarOverviewCardProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type BazaarOverviewCardProps = {
@@ -24,7 +26,7 @@ export type BazaarOverviewCardProps = {
};
// @public (undocumented)
export const BazaarPage: (props: BazaarPageProps) => JSX.Element;
export const BazaarPage: (props: BazaarPageProps) => JSX_2.Element;
// @public (undocumented)
export type BazaarPageProps = {
@@ -44,7 +46,7 @@ export const bazaarPlugin: BackstagePlugin<
>;
// @public (undocumented)
export const EntityBazaarInfoCard: () => JSX.Element | null;
export const EntityBazaarInfoCard: () => React_2.JSX.Element | null;
// @public (undocumented)
export const isBazaarAvailable: (
@@ -55,7 +57,7 @@ export const isBazaarAvailable: (
) => Promise<boolean>;
// @public (undocumented)
export const SortView: (props: SortViewProps) => JSX.Element;
export const SortView: (props: SortViewProps) => React_2.JSX.Element;
// @public (undocumented)
export type SortViewProps = {
+2 -2
View File
@@ -43,6 +43,7 @@
"@material-ui/lab": "4.0.0-alpha.61",
"@material-ui/pickers": "^3.3.10",
"@testing-library/jest-dom": "^5.10.1",
"@types/react": "^16.13.1 || ^17.0.0",
"luxon": "^3.0.0",
"material-ui-search-bar": "^1.0.0",
"react-hook-form": "^7.13.0",
@@ -56,8 +57,7 @@
"devDependencies": {
"@backstage/cli": "workspace:^",
"@backstage/dev-utils": "workspace:^",
"@testing-library/jest-dom": "^5.10.1",
"@types/react": "^16.13.1 || ^17.0.0"
"@testing-library/jest-dom": "^5.10.1"
},
"files": [
"dist"
+2 -1
View File
@@ -7,6 +7,7 @@
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { JSX as JSX_2 } from 'react';
// @public (undocumented)
export const BITRISE_APP_ANNOTATION = 'bitrise.io/app';
@@ -15,7 +16,7 @@ export const BITRISE_APP_ANNOTATION = 'bitrise.io/app';
export const bitrisePlugin: BackstagePlugin<{}, {}, {}>;
// @public (undocumented)
export const EntityBitriseContent: () => JSX.Element;
export const EntityBitriseContent: () => JSX_2.Element;
// @public (undocumented)
export const isBitriseAvailable: (entity: Entity) => boolean;
+1 -1
View File
@@ -37,6 +37,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"lodash": "^4.17.21",
"luxon": "^3.0.0",
"qs": "^6.9.6",
@@ -58,7 +59,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"@types/recharts": "^1.8.15",
"msw": "^1.0.0"
},
@@ -14,15 +14,7 @@
* limitations under the License.
*/
import { getVoidLogger } from '@backstage/backend-common';
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
@@ -40,12 +32,12 @@ describe('catalogModuleAwsS3EntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -66,16 +58,7 @@ describe('catalogModuleAwsS3EntityProvider', () => {
features: [
catalogModuleAwsS3EntityProvider(),
mockServices.rootConfig.factory({ data: config }),
createServiceFactory(() => ({
service: coreServices.logger,
deps: {},
factory: getVoidLogger,
}))(),
createServiceFactory(() => ({
service: coreServices.scheduler,
deps: {},
factory: () => scheduler,
}))(),
scheduler.factory,
],
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
@@ -39,12 +32,12 @@ describe('catalogModuleAzureDevOpsEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -69,11 +62,7 @@ describe('catalogModuleAzureDevOpsEntityProvider', () => {
catalogModuleAzureDevOpsEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
mockServices.logger.factory(),
createServiceFactory(() => ({
deps: {},
service: coreServices.scheduler,
factory: async () => scheduler,
})),
scheduler.factory,
],
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { startTestBackend, mockServices } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { eventsExtensionPoint } from '@backstage/plugin-events-node/alpha';
@@ -46,12 +39,12 @@ describe('catalogModuleBitbucketCloudEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
await startTestBackend({
extensionPoints: [
@@ -75,11 +68,7 @@ describe('catalogModuleBitbucketCloudEntityProvider', () => {
},
},
}),
createServiceFactory({
service: coreServices.scheduler,
deps: {},
factory: async () => scheduler,
}),
scheduler.factory,
],
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { catalogModuleBitbucketServerEntityProvider } from './catalogModuleBitbucketServerEntityProvider';
@@ -39,12 +32,12 @@ describe('catalogModuleBitbucketServerEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -73,11 +66,7 @@ describe('catalogModuleBitbucketServerEntityProvider', () => {
catalogModuleBitbucketServerEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
mockServices.logger.factory(),
createServiceFactory({
service: coreServices.scheduler,
deps: {},
factory: async () => scheduler,
}),
scheduler.factory,
],
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
@@ -39,12 +32,12 @@ describe('catalogModuleGerritEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -79,11 +72,7 @@ describe('catalogModuleGerritEntityProvider', () => {
catalogModuleGerritEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
mockServices.logger.factory(),
createServiceFactory({
service: coreServices.scheduler,
deps: {},
factory: async () => scheduler,
}),
scheduler.factory,
],
});
@@ -14,19 +14,12 @@
* limitations under the License.
*/
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
import { catalogModuleGithubEntityProvider } from './catalogModuleGithubEntityProvider';
import { GithubEntityProvider } from '../providers/GithubEntityProvider';
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
describe('catalogModuleGithubEntityProvider', () => {
it('should register provider at the catalog extension point', async () => {
@@ -39,12 +32,12 @@ describe('catalogModuleGithubEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -65,11 +58,7 @@ describe('catalogModuleGithubEntityProvider', () => {
features: [
catalogModuleGithubEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
createServiceFactory({
service: coreServices.scheduler,
deps: {},
factory: async () => scheduler,
}),
scheduler.factory,
],
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
@@ -39,12 +32,12 @@ describe('catalogModuleGitlabDiscoveryEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
integrations: {
@@ -78,11 +71,7 @@ describe('catalogModuleGitlabDiscoveryEntityProvider', () => {
catalogModuleGitlabDiscoveryEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
mockServices.logger.factory(),
createServiceFactory({
deps: {},
service: coreServices.scheduler,
factory: async () => scheduler,
}),
scheduler.factory,
],
});
@@ -14,12 +14,8 @@
* limitations under the License.
*/
import {
coreServices,
createBackendModule,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import { startTestBackend } from '@backstage/backend-test-utils';
import { createBackendModule } from '@backstage/backend-plugin-api';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { IncrementalEntityProvider } from '../types';
import {
@@ -40,18 +36,15 @@ describe('catalogModuleIncrementalIngestionEntityProvider', () => {
};
const addEntityProvider = jest.fn();
const httpRouterUse = jest.fn();
const httpRouterMock = mockServices.httpRouter.mock();
await startTestBackend({
extensionPoints: [
[catalogProcessingExtensionPoint, { addEntityProvider }],
],
features: [
createServiceFactory({
service: coreServices.httpRouter,
deps: {},
factory: () => ({ use: httpRouterUse }),
}),
httpRouterMock.factory,
catalogModuleIncrementalIngestionEntityProvider(),
createBackendModule({
pluginId: 'catalog',
@@ -79,6 +72,6 @@ describe('catalogModuleIncrementalIngestionEntityProvider', () => {
expect(addEntityProvider.mock.calls[0][0].getProviderName()).toBe(
'provider1',
);
expect(httpRouterUse).toHaveBeenCalledTimes(1);
expect(httpRouterMock.use).toHaveBeenCalledTimes(1);
});
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { Duration } from 'luxon';
@@ -39,12 +32,12 @@ describe('catalogModuleMicrosoftGraphOrgEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -70,11 +63,7 @@ describe('catalogModuleMicrosoftGraphOrgEntityProvider', () => {
features: [
catalogModuleMicrosoftGraphOrgEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
createServiceFactory(() => ({
deps: {},
service: coreServices.scheduler,
factory: async () => scheduler,
})),
scheduler.factory,
],
});
@@ -14,14 +14,7 @@
* limitations under the License.
*/
import {
coreServices,
createServiceFactory,
} from '@backstage/backend-plugin-api';
import {
PluginTaskScheduler,
TaskScheduleDefinition,
} from '@backstage/backend-tasks';
import { TaskScheduleDefinition } from '@backstage/backend-tasks';
import { mockServices, startTestBackend } from '@backstage/backend-test-utils';
import { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';
import { catalogModulePuppetDbEntityProvider } from './catalogModulePuppetDbEntityProvider';
@@ -38,12 +31,12 @@ describe('catalogModulePuppetDbEntityProvider', () => {
},
};
const runner = jest.fn();
const scheduler = {
createScheduledTaskRunner: (schedule: TaskScheduleDefinition) => {
const scheduler = mockServices.scheduler.mock({
createScheduledTaskRunner(schedule) {
usedSchedule = schedule;
return runner;
return { run: runner };
},
} as unknown as PluginTaskScheduler;
});
const config = {
catalog: {
@@ -64,11 +57,7 @@ describe('catalogModulePuppetDbEntityProvider', () => {
features: [
catalogModulePuppetDbEntityProvider(),
mockServices.rootConfig.factory({ data: config }),
createServiceFactory(() => ({
deps: {},
service: coreServices.scheduler,
factory: async () => scheduler,
})),
scheduler.factory,
],
});
+1 -1
View File
@@ -86,5 +86,5 @@ some example entities.
## Links
- [catalog](https://github.com/backstage/backstage/tree/master/plugins/catalog-backend)
- [catalog](https://github.com/backstage/backstage/tree/master/plugins/catalog)
is the frontend interface for this plugin.
+5 -3
View File
@@ -11,8 +11,10 @@ import { DependencyGraphTypes } from '@backstage/core-components';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { JsonObject } from '@backstage/types';
import { JSX as JSX_2 } from 'react';
import { MouseEvent as MouseEvent_2 } from 'react';
import { MouseEventHandler } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
@@ -35,7 +37,7 @@ export const CatalogGraphPage: (
}
| undefined;
} & Partial<EntityRelationsGraphProps>,
) => JSX.Element;
) => JSX_2.Element;
// @public
export const catalogGraphPlugin: BackstagePlugin<
@@ -73,7 +75,7 @@ export const EntityCatalogGraphCard: (
height?: number | undefined;
title?: string | undefined;
},
) => JSX.Element;
) => JSX_2.Element;
// @public
export type EntityEdge = DependencyGraphTypes.DependencyEdge<EntityEdgeData>;
@@ -102,7 +104,7 @@ export type EntityNodeData = {
// @public
export const EntityRelationsGraph: (
props: EntityRelationsGraphProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type EntityRelationsGraphProps = {
+14 -11
View File
@@ -16,6 +16,7 @@ import { Entity } from '@backstage/catalog-model';
import { FieldErrors } from 'react-hook-form';
import { IdentityApi } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { ScmAuthApi } from '@backstage/integration-react';
@@ -46,7 +47,7 @@ export type AnalyzeResult =
// @public
export const AutocompleteTextField: <TFieldValue extends string>(
props: AutocompleteTextFieldProps<TFieldValue>,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface AutocompleteTextFieldProps<TFieldValue extends string> {
@@ -126,7 +127,7 @@ export class CatalogImportClient implements CatalogImportApi {
}
// @public
export const CatalogImportPage: () => JSX.Element;
export const CatalogImportPage: () => JSX_2.Element;
// @public
const catalogImportPlugin: BackstagePlugin<
@@ -148,12 +149,12 @@ export function defaultGenerateStepper(
): StepperProvider;
// @public
export const DefaultImportPage: () => JSX.Element;
export const DefaultImportPage: () => React_2.JSX.Element;
// @public
export const EntityListComponent: (
props: EntityListComponentProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface EntityListComponentProps {
@@ -182,7 +183,9 @@ export type ImportFlows =
| 'no-location';
// @public
export const ImportInfoCard: (props: ImportInfoCardProps) => JSX.Element;
export const ImportInfoCard: (
props: ImportInfoCardProps,
) => React_2.JSX.Element;
// @public
export interface ImportInfoCardProps {
@@ -205,7 +208,7 @@ export type ImportState = State & {
};
// @public
export const ImportStepper: (props: ImportStepperProps) => JSX.Element;
export const ImportStepper: (props: ImportStepperProps) => React_2.JSX.Element;
// @public
export interface ImportStepperProps {
@@ -223,7 +226,7 @@ export interface ImportStepperProps {
// @public
export const PreparePullRequestForm: <TFieldValues extends Record<string, any>>(
props: PreparePullRequestFormProps<TFieldValues>,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export type PreparePullRequestFormProps<
@@ -266,7 +269,7 @@ export type PrepareResult =
// @public
export const PreviewCatalogInfoComponent: (
props: PreviewCatalogInfoComponentProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface PreviewCatalogInfoComponentProps {
@@ -284,7 +287,7 @@ export interface PreviewCatalogInfoComponentProps {
// @public
export const PreviewPullRequestComponent: (
props: PreviewPullRequestComponentProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface PreviewPullRequestComponentProps {
@@ -302,7 +305,7 @@ export interface PreviewPullRequestComponentProps {
// @public
export const StepInitAnalyzeUrl: (
props: StepInitAnalyzeUrlProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface StepInitAnalyzeUrlProps {
@@ -326,7 +329,7 @@ export interface StepInitAnalyzeUrlProps {
// @public
export const StepPrepareCreatePullRequest: (
props: StepPrepareCreatePullRequestProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface StepPrepareCreatePullRequestProps {
+30 -24
View File
@@ -3,8 +3,6 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="react" />
import { ApiRef } from '@backstage/core-plugin-api';
import { CATALOG_FILTER_EXISTS } from '@backstage/catalog-client';
import { CatalogApi } from '@backstage/catalog-client';
@@ -30,7 +28,7 @@ import { TableOptions } from '@backstage/core-components';
// @public
export const AsyncEntityProvider: (
props: AsyncEntityProviderProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export interface AsyncEntityProviderProps {
@@ -62,15 +60,15 @@ export const catalogApiRef: ApiRef<CatalogApi>;
// @public (undocumented)
export const CatalogFilterLayout: {
(props: { children: React_2.ReactNode }): JSX.Element;
(props: { children: React_2.ReactNode }): React_2.JSX.Element;
Filters: (props: {
children: React_2.ReactNode;
options?: {
drawerBreakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number;
drawerAnchor?: 'left' | 'right' | 'top' | 'bottom';
};
}) => JSX.Element;
Content: (props: { children: React_2.ReactNode }) => JSX.Element;
}) => React_2.JSX.Element;
Content: (props: { children: React_2.ReactNode }) => React_2.JSX.Element;
};
// @public (undocumented)
@@ -177,7 +175,7 @@ export class EntityKindFilter implements EntityFilter {
// @public (undocumented)
export const EntityKindPicker: (
props: EntityKindPickerProps,
) => JSX.Element | null;
) => React_2.JSX.Element | null;
// @public
export interface EntityKindPickerProps {
@@ -202,7 +200,7 @@ export class EntityLifecycleFilter implements EntityFilter {
// @public (undocumented)
export const EntityLifecyclePicker: (props: {
initialFilter?: string[];
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public
export const EntityListContext: React_2.Context<
@@ -229,7 +227,7 @@ export type EntityListContextProps<
// @public
export const EntityListProvider: <EntityFilters extends DefaultEntityFilters>(
props: PropsWithChildren<{}>,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type EntityLoadingStatus<TEntity extends Entity = Entity> = {
@@ -251,7 +249,7 @@ export class EntityNamespaceFilter implements EntityFilter {
}
// @public (undocumented)
export const EntityNamespacePicker: () => JSX.Element;
export const EntityNamespacePicker: () => React_2.JSX.Element;
// @public
export class EntityOrphanFilter implements EntityFilter {
@@ -275,7 +273,7 @@ export class EntityOwnerFilter implements EntityFilter {
// @public (undocumented)
export const EntityOwnerPicker: (
props?: EntityOwnerPickerProps,
) => JSX.Element | null;
) => React_2.JSX.Element | null;
// @public (undocumented)
export type EntityOwnerPickerProps = {
@@ -285,7 +283,7 @@ export type EntityOwnerPickerProps = {
// @public
export const EntityPeekAheadPopover: (
props: EntityPeekAheadPopoverProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public
export type EntityPeekAheadPopoverProps = PropsWithChildren<{
@@ -294,10 +292,12 @@ export type EntityPeekAheadPopoverProps = PropsWithChildren<{
}>;
// @public (undocumented)
export const EntityProcessingStatusPicker: () => JSX.Element;
export const EntityProcessingStatusPicker: () => React_2.JSX.Element;
// @public
export const EntityProvider: (props: EntityProviderProps) => JSX.Element;
export const EntityProvider: (
props: EntityProviderProps,
) => React_2.JSX.Element;
// @public
export interface EntityProviderProps {
@@ -321,7 +321,7 @@ export type EntityRefLinkProps = {
// @public
export function EntityRefLinks<
TRef extends string | CompoundEntityRef | Entity,
>(props: EntityRefLinksProps<TRef>): JSX.Element;
>(props: EntityRefLinksProps<TRef>): React_2.JSX.Element;
// @public
export type EntityRefLinksProps<
@@ -357,7 +357,7 @@ export const entityRouteRef: RouteRef<{
}>;
// @public
export const EntitySearchBar: () => JSX.Element;
export const EntitySearchBar: () => React_2.JSX.Element;
// @public (undocumented)
export type EntitySourceLocation = {
@@ -367,7 +367,7 @@ export type EntitySourceLocation = {
// @public
export const EntityTable: {
<T extends Entity>(props: EntityTableProps<T>): JSX.Element;
<T extends Entity>(props: EntityTableProps<T>): React_2.JSX.Element;
columns: Readonly<{
createEntityRefColumn<T_1 extends Entity>(options: {
defaultKind?: string | undefined;
@@ -421,7 +421,9 @@ export class EntityTagFilter implements EntityFilter {
}
// @public (undocumented)
export const EntityTagPicker: (props: EntityTagPickerProps) => JSX.Element;
export const EntityTagPicker: (
props: EntityTagPickerProps,
) => React_2.JSX.Element;
// @public (undocumented)
export type EntityTagPickerProps = {
@@ -453,7 +455,7 @@ export class EntityTypeFilter implements EntityFilter {
// @public (undocumented)
export const EntityTypePicker: (
props: EntityTypePickerProps,
) => JSX.Element | null;
) => React_2.JSX.Element | null;
// @public
export interface EntityTypePickerProps {
@@ -464,7 +466,9 @@ export interface EntityTypePickerProps {
}
// @public
export const FavoriteEntity: (props: FavoriteEntityProps) => JSX.Element;
export const FavoriteEntity: (
props: FavoriteEntityProps,
) => React_2.JSX.Element;
// @public (undocumented)
export type FavoriteEntityProps = ComponentProps<typeof IconButton> & {
@@ -500,7 +504,7 @@ export function InspectEntityDialog(props: {
open: boolean;
entity: Entity;
onClose: () => void;
}): JSX.Element | null;
}): React_2.JSX.Element | null;
// @public (undocumented)
export function MockEntityListContextProvider<
@@ -509,7 +513,7 @@ export function MockEntityListContextProvider<
props: PropsWithChildren<{
value?: Partial<EntityListContextProps<T>>;
}>,
): JSX.Element;
): React_2.JSX.Element;
// @public
export class MockStarredEntitiesApi implements StarredEntitiesApi {
@@ -531,7 +535,7 @@ export const starredEntitiesApiRef: ApiRef<StarredEntitiesApi>;
// @public (undocumented)
export const UnregisterEntityDialog: (
props: UnregisterEntityDialogProps,
) => JSX.Element;
) => React_2.JSX.Element;
// @public (undocumented)
export type UnregisterEntityDialogProps = {
@@ -607,7 +611,9 @@ export class UserListFilter implements EntityFilter {
export type UserListFilterKind = 'owned' | 'starred' | 'all';
// @public (undocumented)
export const UserListPicker: (props: UserListPickerProps) => JSX.Element;
export const UserListPicker: (
props: UserListPickerProps,
) => React_2.JSX.Element;
// @public (undocumented)
export type UserListPickerProps = {
@@ -8,6 +8,8 @@
import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public
@@ -25,7 +27,7 @@ export type CatalogUnprocessedEntitiesApiResponse = {
};
// @public
export const CatalogUnprocessedEntitiesPage: () => JSX.Element;
export const CatalogUnprocessedEntitiesPage: () => JSX_2.Element;
// @public
export const catalogUnprocessedEntitiesPlugin: BackstagePlugin<
@@ -37,7 +39,7 @@ export const catalogUnprocessedEntitiesPlugin: BackstagePlugin<
>;
// @public (undocumented)
export const UnprocessedEntitiesContent: () => JSX.Element;
export const UnprocessedEntitiesContent: () => React_2.JSX.Element;
// @public
export type UnprocessedEntity = {
@@ -36,6 +36,7 @@
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.60",
"@types/react": "^16.13.1 || ^17.0.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
+24 -13
View File
@@ -15,6 +15,7 @@ import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { IconComponent } from '@backstage/core-plugin-api';
import { IndexableDocument } from '@backstage/plugin-search-common';
import { InfoCardVariants } from '@backstage/core-components';
import { JSX as JSX_2 } from 'react';
import { Observable } from '@backstage/types';
import { Overrides } from '@material-ui/core/styles/overrides';
import { default as React_2 } from 'react';
@@ -39,7 +40,7 @@ export interface AboutCardProps {
}
// @public (undocumented)
export function AboutContent(props: AboutContentProps): JSX.Element;
export function AboutContent(props: AboutContentProps): React_2.JSX.Element;
// @public
export interface AboutContentProps {
@@ -48,7 +49,7 @@ export interface AboutContentProps {
}
// @public (undocumented)
export function AboutField(props: AboutFieldProps): JSX.Element;
export function AboutField(props: AboutFieldProps): React_2.JSX.Element;
// @public
export interface AboutFieldProps {
@@ -79,7 +80,9 @@ export const CatalogEntityPage: () => JSX.Element;
export const CatalogIndexPage: (props: DefaultCatalogPageProps) => JSX.Element;
// @public @deprecated (undocumented)
export function CatalogKindHeader(props: CatalogKindHeaderProps): JSX.Element;
export function CatalogKindHeader(
props: CatalogKindHeaderProps,
): React_2.JSX.Element;
// @public
export interface CatalogKindHeaderProps {
@@ -137,7 +140,7 @@ export interface CatalogSearchResultListItemProps {
// @public (undocumented)
export const CatalogTable: {
(props: CatalogTableProps): JSX.Element;
(props: CatalogTableProps): React_2.JSX.Element;
columns: Readonly<{
createNameColumn(
options?:
@@ -303,7 +306,7 @@ export const EntityHasSubcomponentsCard: (
export const EntityHasSystemsCard: (props: HasSystemsCardProps) => JSX.Element;
// @public (undocumented)
export const EntityLabelsCard: (props: EntityLabelsCardProps) => JSX.Element;
export const EntityLabelsCard: (props: EntityLabelsCardProps) => JSX_2.Element;
// @public (undocumented)
export interface EntityLabelsCardProps {
@@ -315,7 +318,7 @@ export interface EntityLabelsCardProps {
// @public
export const EntityLayout: {
(props: EntityLayoutProps): JSX.Element;
(props: EntityLayoutProps): React_2.JSX.Element;
Route: (props: EntityLayoutRouteProps) => null;
};
@@ -350,7 +353,7 @@ export type EntityLayoutRouteProps = {
};
// @public (undocumented)
export const EntityLinksCard: (props: EntityLinksCardProps) => JSX.Element;
export const EntityLinksCard: (props: EntityLinksCardProps) => JSX_2.Element;
// @public (undocumented)
export interface EntityLinksCardProps {
@@ -366,10 +369,10 @@ export type EntityLinksEmptyStateClassKey = 'code';
// @public @deprecated (undocumented)
export const EntityListContainer: (props: {
children: ReactNode;
}) => JSX.Element;
}) => JSX_2.Element;
// @public
export function EntityOrphanWarning(): JSX.Element;
export function EntityOrphanWarning(): React_2.JSX.Element;
// @public (undocumented)
export interface EntityPredicates {
@@ -380,14 +383,14 @@ export interface EntityPredicates {
}
// @public
export function EntityProcessingErrorsPanel(): JSX.Element | null;
export function EntityProcessingErrorsPanel(): React_2.JSX.Element | null;
// @public
export function EntityRelationWarning(): JSX.Element | null;
export function EntityRelationWarning(): React_2.JSX.Element | null;
// @public (undocumented)
export const EntitySwitch: {
(props: EntitySwitchProps): JSX.Element;
(props: EntitySwitchProps): React_2.JSX.Element;
Case: (_props: EntitySwitchCaseProps) => null;
};
@@ -428,7 +431,7 @@ export const FilterContainer: (props: {
drawerAnchor?: 'left' | 'top' | 'bottom' | 'right' | undefined;
}
| undefined;
}) => JSX.Element;
}) => JSX_2.Element;
// @public @deprecated (undocumented)
export const FilteredEntityLayout: (props: {
@@ -445,6 +448,8 @@ export function hasCatalogProcessingErrors(
// @public (undocumented)
export interface HasComponentsCardProps {
// (undocumented)
title?: string;
// (undocumented)
variant?: InfoCardVariants;
}
@@ -462,6 +467,8 @@ export function hasRelationWarnings(
// @public (undocumented)
export interface HasResourcesCardProps {
// (undocumented)
title?: string;
// (undocumented)
variant?: InfoCardVariants;
}
@@ -471,11 +478,15 @@ export interface HasSubcomponentsCardProps {
// (undocumented)
tableOptions?: TableOptions;
// (undocumented)
title?: string;
// (undocumented)
variant?: InfoCardVariants;
}
// @public (undocumented)
export interface HasSystemsCardProps {
// (undocumented)
title?: string;
// (undocumented)
variant?: InfoCardVariants;
}
@@ -59,6 +59,50 @@ describe('EntitySwitch', () => {
expect(screen.queryByText('C')).not.toBeInTheDocument();
});
it('should render the default case if entity is not found', () => {
const content = (
<EntitySwitch>
<EntitySwitch.Case if={isKind('component')} children="A" />
<EntitySwitch.Case if={isKind('api')} children="B" />
<EntitySwitch.Case children="C" />
</EntitySwitch>
);
render(
<Wrapper>
<AsyncEntityProvider entity={undefined} loading={false}>
{content}
</AsyncEntityProvider>
</Wrapper>,
);
expect(screen.queryByText('A')).not.toBeInTheDocument();
expect(screen.queryByText('B')).not.toBeInTheDocument();
expect(screen.queryByText('C')).toBeInTheDocument();
});
it(`shouldn't render any children if entity is loading and no entity exists in the context`, () => {
const content = (
<EntitySwitch>
<EntitySwitch.Case if={isKind('component')} children="A" />
<EntitySwitch.Case if={isKind('api')} children="B" />
<EntitySwitch.Case children="C" />
</EntitySwitch>
);
render(
<Wrapper>
<AsyncEntityProvider entity={undefined} loading>
{content}
</AsyncEntityProvider>
</Wrapper>,
);
expect(screen.queryByText('A')).not.toBeInTheDocument();
expect(screen.queryByText('B')).not.toBeInTheDocument();
expect(screen.queryByText('C')).not.toBeInTheDocument();
});
it('should render the fallback if no cases are matching', () => {
const content = (
<EntitySwitch>
@@ -170,7 +214,7 @@ describe('EntitySwitch', () => {
expect(screen.queryByText('A')).not.toBeInTheDocument();
expect(screen.queryByText('B')).not.toBeInTheDocument();
expect(screen.queryByText('C')).not.toBeInTheDocument();
expect(screen.queryByText('C')).toBeInTheDocument();
});
it('should switch child when filters switch', () => {
@@ -64,7 +64,7 @@ export interface EntitySwitchProps {
/** @public */
export const EntitySwitch = (props: EntitySwitchProps) => {
const { entity } = useAsyncEntity();
const { entity, loading } = useAsyncEntity();
const apis = useApiHolder();
const results = useElementFilter(
@@ -77,14 +77,21 @@ export const EntitySwitch = (props: EntitySwitchProps) => {
})
.getElements()
.flatMap<SwitchCaseResult>((element: ReactElement) => {
// If the entity is missing or there is an error, render nothing
if (!entity) {
if (loading && !entity) {
return [];
}
const { if: condition, children: elementsChildren } =
element.props as EntitySwitchCase;
if (!entity) {
return [
{
if: condition === undefined,
children: elementsChildren,
},
];
}
return [
{
if: condition?.(entity, { apis }),
@@ -92,7 +99,7 @@ export const EntitySwitch = (props: EntitySwitchProps) => {
},
];
}),
[apis, entity],
[apis, entity, loading],
);
const hasAsyncCases = results.some(
@@ -27,14 +27,15 @@ import {
/** @public */
export interface HasComponentsCardProps {
variant?: InfoCardVariants;
title?: string;
}
export function HasComponentsCard(props: HasComponentsCardProps) {
const { variant = 'gridItem' } = props;
const { variant = 'gridItem', title = 'Has components' } = props;
return (
<RelatedEntitiesCard
variant={variant}
title="Has components"
title={title}
entityKind="Component"
relationType={RELATION_HAS_PART}
columns={componentEntityColumns}
@@ -27,14 +27,15 @@ import {
/** @public */
export interface HasResourcesCardProps {
variant?: InfoCardVariants;
title?: string;
}
export function HasResourcesCard(props: HasResourcesCardProps) {
const { variant = 'gridItem' } = props;
const { variant = 'gridItem', title = 'Has resources' } = props;
return (
<RelatedEntitiesCard
variant={variant}
title="Has resources"
title={title}
entityKind="Resource"
relationType={RELATION_HAS_PART}
columns={resourceEntityColumns}
@@ -27,14 +27,19 @@ import {
export interface HasSubcomponentsCardProps {
variant?: InfoCardVariants;
tableOptions?: TableOptions;
title?: string;
}
export function HasSubcomponentsCard(props: HasSubcomponentsCardProps) {
const { variant = 'gridItem', tableOptions = {} } = props;
const {
variant = 'gridItem',
tableOptions = {},
title = 'Has subcomponents',
} = props;
return (
<RelatedEntitiesCard
variant={variant}
title="Has subcomponents"
title={title}
entityKind="Component"
relationType={RELATION_HAS_PART}
columns={componentEntityColumns}
@@ -27,14 +27,15 @@ import {
/** @public */
export interface HasSystemsCardProps {
variant?: InfoCardVariants;
title?: string;
}
export function HasSystemsCard(props: HasSystemsCardProps) {
const { variant = 'gridItem' } = props;
const { variant = 'gridItem', title = 'Has systems' } = props;
return (
<RelatedEntitiesCard
variant={variant}
title="Has systems"
title={title}
entityKind="System"
relationType={RELATION_HAS_PART}
columns={systemEntityColumns}
+4 -2
View File
@@ -15,8 +15,10 @@ import { CircleCIOptions } from 'circleci-api';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { GitType } from 'circleci-api';
import { JSX as JSX_2 } from 'react';
import { Me } from 'circleci-api';
import { PathParams } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
import { SubRouteRef } from '@backstage/core-plugin-api';
@@ -69,7 +71,7 @@ export { circleCIPlugin as plugin };
export const circleCIRouteRef: RouteRef<undefined>;
// @public (undocumented)
export const EntityCircleCIContent: () => JSX.Element;
export const EntityCircleCIContent: () => JSX_2.Element;
export { GitType };
@@ -79,5 +81,5 @@ export { isCircleCIAvailable };
export { isCircleCIAvailable as isPluginApplicableToEntity };
// @public (undocumented)
export const Router: () => JSX.Element;
export const Router: () => React_2.JSX.Element;
```
+1 -1
View File
@@ -41,6 +41,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"circleci-api": "^4.0.0",
"humanize-duration": "^3.27.0",
"lodash": "^4.17.21",
@@ -63,7 +64,6 @@
"@testing-library/user-event": "^14.0.0",
"@types/humanize-duration": "^3.25.1",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
+10 -6
View File
@@ -8,7 +8,9 @@
import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { Entity } from '@backstage/catalog-model';
import { JSX as JSX_2 } from 'react';
import { OAuthApi } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
@@ -109,17 +111,17 @@ export { cloudbuildPlugin };
export { cloudbuildPlugin as plugin };
// @public (undocumented)
export const EntityCloudbuildContent: () => JSX.Element;
export const EntityCloudbuildContent: () => JSX_2.Element;
// @public (undocumented)
export const EntityLatestCloudbuildRunCard: (props: {
branch: string;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export const EntityLatestCloudbuildsForBranchCard: (props: {
branch: string;
}) => JSX.Element;
}) => JSX_2.Element;
// @public (undocumented)
export interface FETCHSOURCE {
@@ -135,12 +137,14 @@ export { isCloudbuildAvailable };
export { isCloudbuildAvailable as isPluginApplicableToEntity };
// @public (undocumented)
export const LatestWorkflowRunCard: (props: { branch: string }) => JSX.Element;
export const LatestWorkflowRunCard: (props: {
branch: string;
}) => React_2.JSX.Element;
// @public (undocumented)
export const LatestWorkflowsForBranchCard: (props: {
branch: string;
}) => JSX.Element;
}) => React_2.JSX.Element;
// @public (undocumented)
export interface Options {
@@ -181,7 +185,7 @@ export interface Results {
}
// @public (undocumented)
export const Router: () => JSX.Element;
export const Router: () => React_2.JSX.Element;
// @public (undocumented)
export interface Source {
+1 -1
View File
@@ -41,6 +41,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"luxon": "^3.0.0",
"qs": "^6.9.4",
"react-use": "^17.2.4"
@@ -60,7 +61,6 @@
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^14.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"cross-fetch": "^3.1.5",
"msw": "^1.0.0"
},
+2 -1
View File
@@ -9,6 +9,7 @@ import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { DiscoveryApi } from '@backstage/core-plugin-api';
import { FetchApi } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
@@ -46,7 +47,7 @@ export const codeClimatePlugin: BackstagePlugin<
>;
// @public (undocumented)
export const EntityCodeClimateCard: () => JSX.Element;
export const EntityCodeClimateCard: () => JSX_2.Element;
// @public (undocumented)
export class MockCodeClimateApi implements CodeClimateApi {
+1 -1
View File
@@ -36,6 +36,7 @@
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.61",
"@types/react": "^16.13.1 || ^17.0.0",
"humanize-duration": "^3.27.1",
"luxon": "^3.0.0",
"react-use": "^17.2.4"
@@ -56,7 +57,6 @@
"@types/humanize-duration": "^3.27.1",
"@types/luxon": "^3.0.0",
"@types/node": "^16.11.26",
"@types/react": "^16.13.1 || ^17.0.0",
"msw": "^1.0.0"
},
"files": [
+16 -9
View File
@@ -20,10 +20,13 @@ import {
} from '@backstage/catalog-model';
import { ResponseError } from '@backstage/errors';
import { JsonCodeCoverage, JsonCoverageHistory } from './types';
import { createApiRef, DiscoveryApi } from '@backstage/core-plugin-api';
import {
createApiRef,
DiscoveryApi,
FetchApi,
} from '@backstage/core-plugin-api';
export type CodeCoverageApi = {
discovery: DiscoveryApi;
getCoverageForEntity: (
entity: CompoundEntityRef,
) => Promise<JsonCodeCoverage>;
@@ -42,18 +45,22 @@ export const codeCoverageApiRef = createApiRef<CodeCoverageApi>({
});
export class CodeCoverageRestApi implements CodeCoverageApi {
url: string = '';
private readonly discoveryApi: DiscoveryApi;
private readonly fetchApi: FetchApi;
constructor(public discovery: DiscoveryApi) {}
public constructor(options: {
discoveryApi: DiscoveryApi;
fetchApi: FetchApi;
}) {
this.discoveryApi = options.discoveryApi;
this.fetchApi = options.fetchApi;
}
private async fetch<T = unknown | string | JsonCoverageHistory>(
path: string,
init?: RequestInit,
): Promise<T | string> {
if (!this.url) {
this.url = await this.discovery.getBaseUrl('code-coverage');
}
const resp = await fetch(`${this.url}${path}`, init);
const url = await this.discoveryApi.getBaseUrl('code-coverage');
const resp = await this.fetchApi.fetch(`${url}${path}`);
if (!resp.ok) {
throw await ResponseError.fromResponse(resp);
}
+4 -2
View File
@@ -21,6 +21,7 @@ import {
createPlugin,
createRoutableExtension,
discoveryApiRef,
fetchApiRef,
} from '@backstage/core-plugin-api';
/**
@@ -34,8 +35,9 @@ export const codeCoveragePlugin = createPlugin({
apis: [
createApiFactory({
api: codeCoverageApiRef,
deps: { discoveryApi: discoveryApiRef },
factory: ({ discoveryApi }) => new CodeCoverageRestApi(discoveryApi),
deps: { discoveryApi: discoveryApiRef, fetchApi: fetchApiRef },
factory: ({ discoveryApi, fetchApi }) =>
new CodeCoverageRestApi({ discoveryApi, fetchApi }),
}),
],
});
+3 -2
View File
@@ -7,13 +7,14 @@
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { IconComponent } from '@backstage/core-plugin-api';
import { JSX as JSX_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @public (undocumented)
export const CodeSceneIcon: IconComponent;
// @public (undocumented)
export const CodeScenePage: () => JSX.Element;
export const CodeScenePage: () => JSX_2.Element;
// @public (undocumented)
export const codescenePlugin: BackstagePlugin<
@@ -28,7 +29,7 @@ export const codescenePlugin: BackstagePlugin<
>;
// @public (undocumented)
export const CodeSceneProjectDetailsPage: () => JSX.Element;
export const CodeSceneProjectDetailsPage: () => JSX_2.Element;
// (No @packageDocumentation comment for this package)
```

Some files were not shown because too many files have changed in this diff Show More