From e592565e0d7707626587f5e0ae7fb7279c84f050 Mon Sep 17 00:00:00 2001 From: Dimitris Klouvas Date: Mon, 2 Oct 2023 12:01:02 +0300 Subject: [PATCH] fix(clerk-js, clerk-react,gatsby-clerk-plugin): Cleanup subpath imports (#1804) * fix(clerk-js,clerk-react): Replace `@clerk/types/src` subpath import with top level * fix(gatsby-plugin-clerk): Replace IsomorphicClerkOptions subpath import with top level --- .changeset/strange-lamps-knock.md | 7 +++++++ packages/clerk-js/src/ui/common/SSOCallback.tsx | 2 +- .../ui/components/UserProfile/ConnectedAccountsSection.tsx | 2 +- .../components/UserProfile/EnterpriseAccountsSection.tsx | 2 +- .../src/ui/hooks/useEnabledThirdPartyProviders.tsx | 2 +- packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts | 2 +- packages/gatsby-plugin-clerk/src/GatsbyClerkProvider.tsx | 2 +- packages/react/src/isomorphicClerk.ts | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .changeset/strange-lamps-knock.md diff --git a/.changeset/strange-lamps-knock.md b/.changeset/strange-lamps-knock.md new file mode 100644 index 0000000000..8a2dbd8c1f --- /dev/null +++ b/.changeset/strange-lamps-knock.md @@ -0,0 +1,7 @@ +--- +'gatsby-plugin-clerk': patch +'@clerk/clerk-js': patch +'@clerk/clerk-react': patch +--- + +Fix internal subpath imports by replacing them with top level imports. diff --git a/packages/clerk-js/src/ui/common/SSOCallback.tsx b/packages/clerk-js/src/ui/common/SSOCallback.tsx index cc6ef21c49..1284fed623 100644 --- a/packages/clerk-js/src/ui/common/SSOCallback.tsx +++ b/packages/clerk-js/src/ui/common/SSOCallback.tsx @@ -1,4 +1,4 @@ -import type { HandleOAuthCallbackParams, HandleSamlCallbackParams } from '@clerk/types/src'; +import type { HandleOAuthCallbackParams, HandleSamlCallbackParams } from '@clerk/types'; import React from 'react'; import { useCoreClerk } from '../contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx index da44223842..164f9b9b29 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx @@ -1,5 +1,5 @@ import type { OAuthProvider, OAuthScope, OAuthStrategy } from '@clerk/types'; -import type { ExternalAccountResource } from '@clerk/types/src'; +import type { ExternalAccountResource } from '@clerk/types'; import { useRouter } from '../../../ui/router'; import { appendModalState } from '../../../utils'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx index 09ec4c20e4..d85cdb17aa 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx @@ -1,4 +1,4 @@ -import type { SamlAccountResource } from '@clerk/types/src'; +import type { SamlAccountResource } from '@clerk/types'; import { useRouter } from '../../../ui/router'; import { useCoreUser } from '../../contexts'; diff --git a/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx b/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx index c613607b66..1063ba7a23 100644 --- a/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx +++ b/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx @@ -1,6 +1,6 @@ import type { OAuthProvider, OAuthStrategy, Web3Provider, Web3Strategy } from '@clerk/types'; // TODO: This import shouldn't be part of @clerk/types -import { OAUTH_PROVIDERS, WEB3_PROVIDERS } from '@clerk/types/src'; +import { OAUTH_PROVIDERS, WEB3_PROVIDERS } from '@clerk/types'; import { iconImageUrl } from '../common/constants'; import { useEnvironment } from '../contexts/EnvironmentContext'; diff --git a/packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts b/packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts index 653302ae0e..191827b0bf 100644 --- a/packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts +++ b/packages/clerk-js/src/ui/utils/test/fixtureHelpers.ts @@ -15,7 +15,7 @@ import type { UserJSON, UserSettingsJSON, } from '@clerk/types'; -import type { MembershipRole, PublicUserDataJSON } from '@clerk/types/src'; +import type { MembershipRole, PublicUserDataJSON } from '@clerk/types'; import { createUser, getOrganizationId } from '../../../core/test/fixtures'; import { createUserFixture } from './fixtures'; diff --git a/packages/gatsby-plugin-clerk/src/GatsbyClerkProvider.tsx b/packages/gatsby-plugin-clerk/src/GatsbyClerkProvider.tsx index 28d4ffe271..fb248cf6b9 100644 --- a/packages/gatsby-plugin-clerk/src/GatsbyClerkProvider.tsx +++ b/packages/gatsby-plugin-clerk/src/GatsbyClerkProvider.tsx @@ -1,9 +1,9 @@ +import type { IsomorphicClerkOptions } from '@clerk/clerk-react'; import { __internal__setErrorThrowerOptions, ClerkLoaded, ClerkProvider as ReactClerkProvider, } from '@clerk/clerk-react'; -import type { IsomorphicClerkOptions } from '@clerk/clerk-react/dist/types'; import { navigate } from 'gatsby'; import React from 'react'; diff --git a/packages/react/src/isomorphicClerk.ts b/packages/react/src/isomorphicClerk.ts index 7a1200ecf6..9fa62ef93e 100644 --- a/packages/react/src/isomorphicClerk.ts +++ b/packages/react/src/isomorphicClerk.ts @@ -27,7 +27,7 @@ import type { UserProfileProps, UserResource, } from '@clerk/types'; -import type { OrganizationProfileProps, OrganizationSwitcherProps } from '@clerk/types/src'; +import type { OrganizationProfileProps, OrganizationSwitcherProps } from '@clerk/types'; import { unsupportedNonBrowserDomainOrProxyUrlFunction } from './errors'; import type {