Updated files with mixed named/default exports to use only named exports (#19385)

no issue

Fixes a warning in yarn dev
This commit is contained in:
Jono M 2023-12-14 16:01:28 +00:00 committed by GitHub
parent 6b50585a0e
commit 51ee276e97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 9 additions and 14 deletions

View File

@ -1,3 +1,3 @@
import adminXPlaywrightConfig from '@tryghost/admin-x-framework/playwright'; import {adminXPlaywrightConfig} from '@tryghost/admin-x-framework/playwright';
export default adminXPlaywrightConfig(); export default adminXPlaywrightConfig();

View File

@ -1,4 +1,4 @@
export {default as FrameworkProvider, useFramework} from './providers/FrameworkProvider'; export {FrameworkProvider, useFramework} from './providers/FrameworkProvider';
export type {FrameworkContextType, FrameworkProviderProps, TopLevelFrameworkProps} from './providers/FrameworkProvider'; export type {FrameworkContextType, FrameworkProviderProps, TopLevelFrameworkProps} from './providers/FrameworkProvider';
export {useQueryClient} from '@tanstack/react-query'; export {useQueryClient} from '@tanstack/react-query';

View File

@ -2,7 +2,7 @@ import {defineConfig, devices, PlaywrightTestConfig} from '@playwright/test';
export const E2E_PORT = 5173; export const E2E_PORT = 5173;
export default function adminXPlaywrightConfig(overrides: Partial<PlaywrightTestConfig> = {}) { export function adminXPlaywrightConfig(overrides: Partial<PlaywrightTestConfig> = {}) {
/** /**
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */

View File

@ -42,7 +42,7 @@ const FrameworkContext = createContext<FrameworkContextType>({
onDelete: () => {} onDelete: () => {}
}); });
function FrameworkProvider({children, ...props}: FrameworkProviderProps) { export function FrameworkProvider({children, ...props}: FrameworkProviderProps) {
return ( return (
<SentryErrorBoundary> <SentryErrorBoundary>
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
@ -54,6 +54,4 @@ function FrameworkProvider({children, ...props}: FrameworkProviderProps) {
); );
} }
export default FrameworkProvider;
export const useFramework = () => useContext(FrameworkContext); export const useFramework = () => useContext(FrameworkContext);

View File

@ -97,7 +97,7 @@ export interface RoutingProviderProps {
children: React.ReactNode; children: React.ReactNode;
} }
const RoutingProvider: React.FC<RoutingProviderProps> = ({basePath, modals, children}) => { export const RoutingProvider: React.FC<RoutingProviderProps> = ({basePath, modals, children}) => {
const {externalNavigate} = useFramework(); const {externalNavigate} = useFramework();
const [route, setRoute] = useState<string | undefined>(undefined); const [route, setRoute] = useState<string | undefined>(undefined);
const [loadingModal, setLoadingModal] = useState(false); const [loadingModal, setLoadingModal] = useState(false);
@ -172,8 +172,6 @@ const RoutingProvider: React.FC<RoutingProviderProps> = ({basePath, modals, chil
); );
}; };
export default RoutingProvider;
export function useRouting() { export function useRouting() {
return useContext(RouteContext); return useContext(RouteContext);
} }

View File

@ -1,3 +1,3 @@
export {default as RoutingProvider, useRouteChangeCallback, useRouting} from './providers/RoutingProvider'; export {RoutingProvider, useRouteChangeCallback, useRouting} from './providers/RoutingProvider';
export type {ExternalLink, InternalLink, ModalComponent, RoutingModalProps} from './providers/RoutingProvider'; export type {ExternalLink, InternalLink, ModalComponent, RoutingModalProps} from './providers/RoutingProvider';

View File

@ -1,12 +1,11 @@
import {renderHook} from '@testing-library/react'; import {renderHook} from '@testing-library/react';
import React, {ReactNode} from 'react'; import React, {ReactNode} from 'react';
import FrameworkProvider from '../../../../src/providers/FrameworkProvider'; import {FrameworkProvider} from '../../../../src/providers/FrameworkProvider';
import {useFetchApi} from '../../../../src/utils/api/fetchApi'; import {useFetchApi} from '../../../../src/utils/api/fetchApi';
import {withMockFetch} from '../../../utils/mockFetch'; import {withMockFetch} from '../../../utils/mockFetch';
const wrapper: React.FC<{ children: ReactNode }> = ({children}) => ( const wrapper: React.FC<{ children: ReactNode }> = ({children}) => (
<FrameworkProvider <FrameworkProvider
basePath=''
externalNavigate={() => {}} externalNavigate={() => {}}
ghostVersion='5.x' ghostVersion='5.x'
sentryDSN='' sentryDSN=''

View File

@ -1,7 +1,7 @@
import {InfiniteData, QueryClient, QueryClientProvider} from '@tanstack/react-query'; import {InfiniteData, QueryClient, QueryClientProvider} from '@tanstack/react-query';
import {act, renderHook, waitFor} from '@testing-library/react'; import {act, renderHook, waitFor} from '@testing-library/react';
import React, {ReactNode} from 'react'; import React, {ReactNode} from 'react';
import FrameworkProvider from '../../../../src/providers/FrameworkProvider'; import {FrameworkProvider} from '../../../../src/providers/FrameworkProvider';
import {createInfiniteQuery, createMutation, createPaginatedQuery, createQuery, createQueryWithId} from '../../../../src/utils/api/hooks'; import {createInfiniteQuery, createMutation, createPaginatedQuery, createQuery, createQueryWithId} from '../../../../src/utils/api/hooks';
import {withMockFetch} from '../../../utils/mockFetch'; import {withMockFetch} from '../../../utils/mockFetch';

View File

@ -1,3 +1,3 @@
import adminXPlaywrightConfig from '@tryghost/admin-x-framework/playwright'; import {adminXPlaywrightConfig} from '@tryghost/admin-x-framework/playwright';
export default adminXPlaywrightConfig(); export default adminXPlaywrightConfig();