diff --git a/.changeset/proud-carrots-prove.md b/.changeset/proud-carrots-prove.md new file mode 100644 index 0000000000..8d18b27282 --- /dev/null +++ b/.changeset/proud-carrots-prove.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Fix duplication checks to stop looking for the old core packages, and to allow some explicitly diff --git a/docs/auth/auth0/provider.md b/docs/auth/auth0/provider.md index b546285c94..05553c3fd3 100644 --- a/docs/auth/auth0/provider.md +++ b/docs/auth/auth0/provider.md @@ -5,8 +5,8 @@ sidebar_label: Auth0 description: Adding Auth0 as an authentication provider in Backstage --- -The Backstage `core-api` package comes with an Auth0 authentication provider -that can authenticate users using OAuth. +The Backstage `core-plugin-api` package comes with an Auth0 authentication +provider that can authenticate users using OAuth. ## Create an Auth0 Application diff --git a/docs/auth/github/provider.md b/docs/auth/github/provider.md index 81b2e98f2c..05726e8a4e 100644 --- a/docs/auth/github/provider.md +++ b/docs/auth/github/provider.md @@ -5,8 +5,8 @@ sidebar_label: GitHub description: Adding GitHub OAuth as an authentication provider in Backstage --- -The Backstage `core-api` package comes with a GitHub authentication provider -that can authenticate users using GitHub or GitHub Enterprise OAuth. +The Backstage `core-plugin-api` package comes with a GitHub authentication +provider that can authenticate users using GitHub or GitHub Enterprise OAuth. ## Create an OAuth App on GitHub diff --git a/docs/auth/gitlab/provider.md b/docs/auth/gitlab/provider.md index c7ac2cedc9..fd64ddac14 100644 --- a/docs/auth/gitlab/provider.md +++ b/docs/auth/gitlab/provider.md @@ -5,8 +5,8 @@ sidebar_label: GitLab description: Adding GitLab OAuth as an authentication provider in Backstage --- -The Backstage `core-api` package comes with a GitLab authentication provider -that can authenticate users using GitLab OAuth. +The Backstage `core-plugin-api` package comes with a GitLab authentication +provider that can authenticate users using GitLab OAuth. ## Create an OAuth App on GitLab diff --git a/docs/auth/google/provider.md b/docs/auth/google/provider.md index 457224b2db..6216b21704 100644 --- a/docs/auth/google/provider.md +++ b/docs/auth/google/provider.md @@ -5,8 +5,8 @@ sidebar_label: Google description: Adding Google OAuth as an authentication provider in Backstage --- -The Backstage `core-api` package comes with a Google authentication provider -that can authenticate users using Google OAuth. +The Backstage `core-plugin-api` package comes with a Google authentication +provider that can authenticate users using Google OAuth. ## Create OAuth Credentials diff --git a/docs/auth/microsoft/provider.md b/docs/auth/microsoft/provider.md index 52f463bab4..1b81ff76f1 100644 --- a/docs/auth/microsoft/provider.md +++ b/docs/auth/microsoft/provider.md @@ -5,8 +5,8 @@ sidebar_label: Azure description: Adding Microsoft Azure as an authentication provider in Backstage --- -The Backstage `core-api` package comes with a Microsoft authentication provider -that can authenticate users using Azure OAuth. +The Backstage `core-plugin-api` package comes with a Microsoft authentication +provider that can authenticate users using Azure OAuth. ## Create an App Registration on Azure diff --git a/docs/auth/okta/provider.md b/docs/auth/okta/provider.md index bbd23a1b2a..b5aaabe4f1 100644 --- a/docs/auth/okta/provider.md +++ b/docs/auth/okta/provider.md @@ -5,8 +5,8 @@ sidebar_label: Okta description: Adding Okta OAuth as an authentication provider in Backstage --- -The Backstage `core-api` package comes with a Okta authentication provider that -can authenticate users using Okta OpenID Connect. +The Backstage `core-plugin-api` package comes with a Okta authentication +provider that can authenticate users using Okta OpenID Connect. ## Create an Application on Okta diff --git a/docs/auth/onelogin/provider.md b/docs/auth/onelogin/provider.md index 62c1657fea..a11304ae84 100644 --- a/docs/auth/onelogin/provider.md +++ b/docs/auth/onelogin/provider.md @@ -5,8 +5,8 @@ sidebar_label: OneLogin description: Adding OneLogin OIDC as an authentication provider in Backstage --- -The Backstage `core-api` package comes with a OneLogin authentication provider -that can authenticate users using OpenID Connect. +The Backstage `core-plugin-api` package comes with a OneLogin authentication +provider that can authenticate users using OpenID Connect. ## Create an Application on OneLogin diff --git a/docs/getting-started/project-structure.md b/docs/getting-started/project-structure.md index bf2cc93ea5..687743f99d 100644 --- a/docs/getting-started/project-structure.md +++ b/docs/getting-started/project-structure.md @@ -166,12 +166,12 @@ are separated out into their own folder, see further down. plugin and [techdocs-cli](https://github.com/backstage/techdocs-cli). - [`test-utils/`](https://github.com/backstage/backstage/tree/master/packages/test-utils) - - This package contains specific testing facilities used when testing - `core-api`. + This package contains more general purpose testing facilities for testing a + Backstage App or its plugins. - [`test-utils-core/`](https://github.com/backstage/backstage/tree/master/packages/test-utils-core) - - This package contains more general purpose testing facilities for testing a - Backstage App. + This package contains specific testing facilities used when testing Backstage + core internals. - [`theme/`](https://github.com/backstage/backstage/tree/master/packages/theme) - Holds the Backstage Theme. diff --git a/packages/cli/src/commands/versions/lint.ts b/packages/cli/src/commands/versions/lint.ts index c542da6dfb..527245d6f5 100644 --- a/packages/cli/src/commands/versions/lint.ts +++ b/packages/cli/src/commands/versions/lint.ts @@ -27,13 +27,21 @@ export const includedFilter = (name: string) => // Packages that are not allowed to have any duplicates const FORBID_DUPLICATES = [ - /^@backstage\/core$/, - /^@backstage\/core-api$/, + /^@backstage\/core-app-api$/, /^@backstage\/plugin-/, ]; +// There are some packages that ARE explicitly allowed to have duplicates since +// they handle that appropriately. This takes precedence over FORBID_DUPLICATES +// above. +const ALLOW_DUPLICATES = [ + /^@backstage\/core-plugin-api$/, + /^@backstage\/plugin-catalog-react$/, +]; + export const forbiddenDuplicatesFilter = (name: string) => - FORBID_DUPLICATES.some(pattern => pattern.test(name)); + FORBID_DUPLICATES.some(pattern => pattern.test(name)) && + !ALLOW_DUPLICATES.some(pattern => pattern.test(name)); export default async (cmd: Command) => { const fix = Boolean(cmd.fix); diff --git a/packages/core-app-api/src/app/createApp.tsx b/packages/core-app-api/src/app/createApp.tsx index a2d22c8dd0..e9c37a1420 100644 --- a/packages/core-app-api/src/app/createApp.tsx +++ b/packages/core-app-api/src/app/createApp.tsx @@ -90,11 +90,6 @@ export const defaultConfigLoader: AppConfigLoader = async ( return configs; }; -// createApp is defined in core, and not core-api, since we need access -// to the components inside core to provide defaults. -// The actual implementation of the app class still lives in core-api, -// as it needs to be used by dev- and test-utils. - export function OptionallyWrapInRouter({ children }: PropsWithChildren<{}>) { if (useInRouterContext()) { return <>{children}; diff --git a/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts b/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts index c3b2f5c6c9..a924c80242 100644 --- a/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts +++ b/plugins/auth-backend/src/lib/flow/authFlowHelpers.ts @@ -58,7 +58,7 @@ export const postMessageResponse = ( (window.opener || window.parent).postMessage(JSON.parse(authResponse), origin); setTimeout(() => { window.close(); - }, 100); // same as the interval of the core-api lib/loginPopup.ts (to address race conditions) + }, 100); // same as the interval of the core-app-api lib/loginPopup.ts (to address race conditions) `; const hash = crypto.createHash('sha256').update(script).digest('base64');