diff --git a/.changeset/popular-apples-sparkle.md b/.changeset/popular-apples-sparkle.md new file mode 100644 index 0000000000..b8437795da --- /dev/null +++ b/.changeset/popular-apples-sparkle.md @@ -0,0 +1,26 @@ +--- +'@backstage/backend-common': patch +'@backstage/catalog-model': patch +'@backstage/cli': patch +'@backstage/config-loader': patch +'@backstage/core-app-api': patch +'@backstage/errors': patch +'@backstage/search-common': patch +'@backstage/test-utils': patch +'@backstage/plugin-app-backend': patch +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-catalog-backend-module-ldap': patch +'@backstage/plugin-catalog-graphql': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-config-schema': patch +'@backstage/plugin-scaffolder': patch +'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-scaffolder-backend-module-cookiecutter': patch +'@backstage/plugin-scaffolder-backend-module-rails': patch +'@backstage/plugin-scaffolder-backend-module-yeoman': patch +'@backstage/plugin-scaffolder-common': patch +'@backstage/plugin-search': patch +'@backstage/plugin-shortcuts': patch +--- + +Switch to use the json and observable types from `@backstage/types` diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 594a0825a7..03c29daa01 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -40,8 +40,7 @@ import { IconComponent } from '@backstage/core-plugin-api'; import { microsoftAuthApiRef } from '@backstage/core-plugin-api'; import { OAuthApi } from '@backstage/core-plugin-api'; import { OAuthRequestApi } from '@backstage/core-plugin-api'; -import { Observable } from '@backstage/core-plugin-api'; -import { Observable as Observable_2 } from '@backstage/types'; +import { Observable } from '@backstage/types'; import { oktaAuthApiRef } from '@backstage/core-plugin-api'; import { oneloginAuthApiRef } from '@backstage/core-plugin-api'; import { OpenIdConnectApi } from '@backstage/core-plugin-api'; @@ -341,7 +340,7 @@ export const defaultConfigLoader: AppConfigLoader; export class ErrorAlerter implements ErrorApi { constructor(alertApi: AlertApi, errorApi: ErrorApi); // (undocumented) - error$(): Observable_2<{ + error$(): Observable<{ error: { name: string; message: string; diff --git a/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts b/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts index 0ba275ea4d..5e649e2f4c 100644 --- a/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts +++ b/packages/core-app-api/src/apis/implementations/AlertApi/AlertApiForwarder.ts @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AlertApi, AlertMessage, Observable } from '@backstage/core-plugin-api'; + +import { AlertApi, AlertMessage } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { PublishSubject } from '../../../lib/subjects'; /** diff --git a/packages/core-app-api/src/apis/implementations/AppThemeApi/AppThemeSelector.ts b/packages/core-app-api/src/apis/implementations/AppThemeApi/AppThemeSelector.ts index 4dceed4749..3dfa43b661 100644 --- a/packages/core-app-api/src/apis/implementations/AppThemeApi/AppThemeSelector.ts +++ b/packages/core-app-api/src/apis/implementations/AppThemeApi/AppThemeSelector.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { AppThemeApi, AppTheme, Observable } from '@backstage/core-plugin-api'; +import { AppThemeApi, AppTheme } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { BehaviorSubject } from '../../../lib/subjects'; const STORAGE_KEY = 'theme'; diff --git a/packages/core-app-api/src/apis/implementations/ErrorApi/ErrorApiForwarder.ts b/packages/core-app-api/src/apis/implementations/ErrorApi/ErrorApiForwarder.ts index 9c9a6f20f1..0edbd2f353 100644 --- a/packages/core-app-api/src/apis/implementations/ErrorApi/ErrorApiForwarder.ts +++ b/packages/core-app-api/src/apis/implementations/ErrorApi/ErrorApiForwarder.ts @@ -13,7 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { ErrorApi, ErrorContext, Observable } from '@backstage/core-plugin-api'; + +import { ErrorApi, ErrorContext } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { PublishSubject } from '../../../lib/subjects'; /** diff --git a/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthPendingRequests.ts b/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthPendingRequests.ts index d91cb0ebb0..be643d274b 100644 --- a/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthPendingRequests.ts +++ b/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthPendingRequests.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { BehaviorSubject } from '../../../lib/subjects'; type RequestQueueEntry = { diff --git a/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthRequestManager.ts b/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthRequestManager.ts index 6c00cd85cd..1cd25c4b56 100644 --- a/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthRequestManager.ts +++ b/packages/core-app-api/src/apis/implementations/OAuthRequestApi/OAuthRequestManager.ts @@ -19,8 +19,8 @@ import { PendingAuthRequest, AuthRequester, AuthRequesterOptions, - Observable, } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { OAuthPendingRequests, PendingRequest } from './OAuthPendingRequests'; import { BehaviorSubject } from '../../../lib/subjects'; diff --git a/packages/core-app-api/src/apis/implementations/StorageApi/WebStorage.ts b/packages/core-app-api/src/apis/implementations/StorageApi/WebStorage.ts index d1f712e72a..08c4df7e8c 100644 --- a/packages/core-app-api/src/apis/implementations/StorageApi/WebStorage.ts +++ b/packages/core-app-api/src/apis/implementations/StorageApi/WebStorage.ts @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { StorageApi, StorageValueChange, ErrorApi, - Observable, } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import ObservableImpl from 'zen-observable'; const buckets = new Map(); diff --git a/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.ts b/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.ts index 85e3e79ad5..72b4209a34 100644 --- a/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/github/GithubAuth.ts @@ -24,8 +24,8 @@ import { ProfileInfo, BackstageIdentity, AuthRequestOptions, - Observable, } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { SessionManager } from '../../../../lib/AuthSessionManager/types'; import { AuthSessionStore, diff --git a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts index 24db8d2560..8f685b9266 100644 --- a/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts +++ b/packages/core-app-api/src/apis/implementations/auth/oauth2/OAuth2.ts @@ -28,8 +28,8 @@ import { SessionState, SessionApi, BackstageIdentityApi, - Observable, } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { OAuth2Session } from './types'; import { OAuthApiCreateOptions } from '../types'; diff --git a/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts b/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts index ae4f80c9b1..0a7fb50101 100644 --- a/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts +++ b/packages/core-app-api/src/apis/implementations/auth/saml/SamlAuth.ts @@ -25,8 +25,8 @@ import { ProfileInfoApi, BackstageIdentityApi, SessionApi, - Observable, } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { SamlSession } from './types'; import { AuthSessionStore, diff --git a/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.test.ts b/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.test.ts index 919948f531..35b9a808b2 100644 --- a/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.test.ts +++ b/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.test.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Observable, SessionState } from '@backstage/core-plugin-api'; +import { SessionState } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { OptionalRefreshSessionManagerMux } from './OptionalRefreshSessionManagerMux'; import { MutableSessionManager, SessionManager } from './types'; diff --git a/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.ts b/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.ts index 221a7635ea..80dfa1879e 100644 --- a/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.ts +++ b/packages/core-app-api/src/lib/AuthSessionManager/OptionalRefreshSessionManagerMux.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Observable, SessionState } from '@backstage/core-plugin-api'; +import { SessionState } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { SessionManager, MutableSessionManager, diff --git a/packages/core-app-api/src/lib/AuthSessionManager/SessionStateTracker.ts b/packages/core-app-api/src/lib/AuthSessionManager/SessionStateTracker.ts index b70b4bf4ca..4523a868b4 100644 --- a/packages/core-app-api/src/lib/AuthSessionManager/SessionStateTracker.ts +++ b/packages/core-app-api/src/lib/AuthSessionManager/SessionStateTracker.ts @@ -15,7 +15,8 @@ */ import { BehaviorSubject } from '../subjects'; -import { Observable, SessionState } from '@backstage/core-plugin-api'; +import { SessionState } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; export class SessionStateTracker { private readonly subject = new BehaviorSubject( diff --git a/packages/core-app-api/src/lib/AuthSessionManager/types.ts b/packages/core-app-api/src/lib/AuthSessionManager/types.ts index 43655b8395..a2a5800974 100644 --- a/packages/core-app-api/src/lib/AuthSessionManager/types.ts +++ b/packages/core-app-api/src/lib/AuthSessionManager/types.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Observable, SessionState } from '@backstage/core-plugin-api'; +import { SessionState } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; export type GetSessionOptions = { optional?: boolean; diff --git a/packages/core-app-api/src/lib/subjects.ts b/packages/core-app-api/src/lib/subjects.ts index e122da819b..79c2c25675 100644 --- a/packages/core-app-api/src/lib/subjects.ts +++ b/packages/core-app-api/src/lib/subjects.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import ObservableImpl from 'zen-observable'; // TODO(Rugvip): These are stopgap and probably incomplete implementations of subjects. diff --git a/packages/test-utils/api-report.md b/packages/test-utils/api-report.md index f4b3fe12bb..9bd51c4795 100644 --- a/packages/test-utils/api-report.md +++ b/packages/test-utils/api-report.md @@ -9,7 +9,7 @@ import { ComponentType } from 'react'; import { ErrorApi } from '@backstage/core-plugin-api'; import { ErrorContext } from '@backstage/core-plugin-api'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { RenderResult } from '@testing-library/react'; diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 22dc950bd4..f6f4ac901a 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -33,6 +33,7 @@ "@backstage/core-plugin-api": "^0.1.11", "@backstage/test-utils-core": "^0.1.3", "@backstage/theme": "^0.2.11", + "@backstage/types": "^0.1.1", "@material-ui/core": "^4.12.2", "@testing-library/jest-dom": "^5.10.1", "@testing-library/react": "^11.2.5", diff --git a/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts b/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts index 20b6bd1724..01ee412182 100644 --- a/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts +++ b/packages/test-utils/src/testUtils/apis/ErrorApi/MockErrorApi.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { ErrorApi, ErrorContext, Observable } from '@backstage/core-plugin-api'; +import { ErrorApi, ErrorContext } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; type Options = { collect?: boolean; diff --git a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts index ab5d26afc5..d928c35435 100644 --- a/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts +++ b/packages/test-utils/src/testUtils/apis/StorageApi/MockStorageApi.ts @@ -14,11 +14,8 @@ * limitations under the License. */ -import { - Observable, - StorageApi, - StorageValueChange, -} from '@backstage/core-plugin-api'; +import { StorageApi, StorageValueChange } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import ObservableImpl from 'zen-observable'; export type MockStorageBucket = { [key: string]: any }; diff --git a/plugins/catalog-react/api-report.md b/plugins/catalog-react/api-report.md index e28b8b0d32..06dccf4b7f 100644 --- a/plugins/catalog-react/api-report.md +++ b/plugins/catalog-react/api-report.md @@ -16,7 +16,7 @@ import { Entity } from '@backstage/catalog-model'; import { EntityName } from '@backstage/catalog-model'; import { IconButton } from '@material-ui/core'; import { LinkProps } from '@backstage/core-components'; -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; import { ReactNode } from 'react'; diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 3373641d16..404ba6893f 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -36,6 +36,7 @@ "@backstage/core-plugin-api": "^0.1.11", "@backstage/errors": "^0.1.3", "@backstage/integration": "^0.6.8", + "@backstage/types": "^0.1.1", "@backstage/version-bridge": "^0.1.0", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", diff --git a/plugins/catalog-react/src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts b/plugins/catalog-react/src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts index 87d99c8904..46a8e63084 100644 --- a/plugins/catalog-react/src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts +++ b/plugins/catalog-react/src/apis/StarredEntitiesApi/DefaultStarredEntitiesApi.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { Observable, StorageApi } from '@backstage/core-plugin-api'; +import { StorageApi } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import ObservableImpl from 'zen-observable'; import { performMigrationToTheNewBucket } from './migration'; import { StarredEntitiesApi } from './StarredEntitiesApi'; diff --git a/plugins/catalog-react/src/apis/StarredEntitiesApi/StarredEntitiesApi.ts b/plugins/catalog-react/src/apis/StarredEntitiesApi/StarredEntitiesApi.ts index 4c4c68d66a..56c7664bfb 100644 --- a/plugins/catalog-react/src/apis/StarredEntitiesApi/StarredEntitiesApi.ts +++ b/plugins/catalog-react/src/apis/StarredEntitiesApi/StarredEntitiesApi.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import { ApiRef, createApiRef, Observable } from '@backstage/core-plugin-api'; +import { ApiRef, createApiRef } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; /** * An API to store starred entities diff --git a/plugins/config-schema/api-report.md b/plugins/config-schema/api-report.md index 15c00acc18..efeb1646eb 100644 --- a/plugins/config-schema/api-report.md +++ b/plugins/config-schema/api-report.md @@ -7,7 +7,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { RouteRef } from '@backstage/core-plugin-api'; import { Schema } from 'jsonschema'; diff --git a/plugins/config-schema/src/api/StaticSchemaLoader.ts b/plugins/config-schema/src/api/StaticSchemaLoader.ts index 8958f4cb5b..48a125f38e 100644 --- a/plugins/config-schema/src/api/StaticSchemaLoader.ts +++ b/plugins/config-schema/src/api/StaticSchemaLoader.ts @@ -18,7 +18,7 @@ import ObservableImpl from 'zen-observable'; import { ResponseError } from '@backstage/errors'; import { Schema } from 'jsonschema'; import { ConfigSchemaApi, ConfigSchemaResult } from './types'; -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; const DEFAULT_URL = 'config-schema.json'; diff --git a/plugins/config-schema/src/api/types.ts b/plugins/config-schema/src/api/types.ts index 464ef970fb..13cd4f602b 100644 --- a/plugins/config-schema/src/api/types.ts +++ b/plugins/config-schema/src/api/types.ts @@ -15,7 +15,8 @@ */ import { Schema } from 'jsonschema'; -import { createApiRef, Observable } from '@backstage/core-plugin-api'; +import { createApiRef } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; export interface ConfigSchemaResult { schema?: Schema; diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 74abada9a8..740685e922 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -22,7 +22,7 @@ import { IdentityApi } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/types'; import { JSONSchema } from '@backstage/catalog-model'; import { JsonValue } from '@backstage/types'; -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import { default as React_2 } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; import { ScmIntegrationRegistry } from '@backstage/integration'; diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index 1511899c65..1b531b652d 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -15,7 +15,7 @@ */ import { EntityName } from '@backstage/catalog-model'; -import { JsonObject, JsonValue } from '@backstage/types'; +import { JsonObject, JsonValue, Observable } from '@backstage/types'; import { ResponseError } from '@backstage/errors'; import { ScmIntegrationRegistry } from '@backstage/integration'; import { Field, FieldValidation } from '@rjsf/core'; @@ -25,7 +25,6 @@ import { createApiRef, DiscoveryApi, IdentityApi, - Observable, } from '@backstage/core-plugin-api'; export const scaffolderApiRef = createApiRef({ diff --git a/plugins/scaffolder/src/components/hooks/useEventStream.ts b/plugins/scaffolder/src/components/hooks/useEventStream.ts index 9eb1666db4..7414a35189 100644 --- a/plugins/scaffolder/src/components/hooks/useEventStream.ts +++ b/plugins/scaffolder/src/components/hooks/useEventStream.ts @@ -17,7 +17,8 @@ import { useImmerReducer } from 'use-immer'; import { useEffect } from 'react'; import { scaffolderApiRef, LogEvent } from '../../api'; import { ScaffolderTask, Status, TaskOutput } from '../../types'; -import { Subscription, useApi } from '@backstage/core-plugin-api'; +import { useApi } from '@backstage/core-plugin-api'; +import { Subscription } from '@backstage/types'; type Step = { id: string; diff --git a/plugins/shortcuts/api-report.md b/plugins/shortcuts/api-report.md index 0e1442b53f..d85d427c99 100644 --- a/plugins/shortcuts/api-report.md +++ b/plugins/shortcuts/api-report.md @@ -7,7 +7,7 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; -import { Observable } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; import ObservableImpl from 'zen-observable'; import { StorageApi } from '@backstage/core-plugin-api'; diff --git a/plugins/shortcuts/package.json b/plugins/shortcuts/package.json index c9afe49c5a..14dfd16896 100644 --- a/plugins/shortcuts/package.json +++ b/plugins/shortcuts/package.json @@ -24,6 +24,7 @@ "@backstage/core-components": "^0.7.1", "@backstage/core-plugin-api": "^0.1.11", "@backstage/theme": "^0.2.11", + "@backstage/types": "^0.1.1", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "4.0.0-alpha.57", diff --git a/plugins/shortcuts/src/api/ShortcutApi.ts b/plugins/shortcuts/src/api/ShortcutApi.ts index c7802a0385..dcecc9945b 100644 --- a/plugins/shortcuts/src/api/ShortcutApi.ts +++ b/plugins/shortcuts/src/api/ShortcutApi.ts @@ -15,7 +15,8 @@ */ import { Shortcut } from '../types'; -import { createApiRef, Observable } from '@backstage/core-plugin-api'; +import { createApiRef } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; export const shortcutsApiRef = createApiRef({ id: 'plugin.shortcuts.api',