From cc5aea604b2a811589bceadfee2fa02cd40bf0d0 Mon Sep 17 00:00:00 2001 From: mnajdova Date: Fri, 12 Jul 2024 12:58:46 +0200 Subject: [PATCH] fix CI --- packages/api-docs-builder-core/baseUi/projectSettings.ts | 3 +++ packages/api-docs-builder/ProjectSettings.ts | 4 ++++ packages/api-docs-builder/buildApi.ts | 3 +++ packages/mui-base/src/utils/appendOwnerState.ts | 7 +++---- packages/mui-base/src/utils/useSlotProps.ts | 8 +++----- .../src/appendOwnerState/appendOwnerState.spec.tsx | 2 +- packages/mui-utils/src/appendOwnerState/index.ts | 3 ++- packages/mui-utils/src/index.ts | 7 ++----- packages/mui-utils/src/mergeSlotProps/index.ts | 5 +++-- packages/mui-utils/src/useSlotProps/index.ts | 3 ++- 10 files changed, 26 insertions(+), 19 deletions(-) diff --git a/packages/api-docs-builder-core/baseUi/projectSettings.ts b/packages/api-docs-builder-core/baseUi/projectSettings.ts index d032f45b30f755..5c276df37500e9 100644 --- a/packages/api-docs-builder-core/baseUi/projectSettings.ts +++ b/packages/api-docs-builder-core/baseUi/projectSettings.ts @@ -27,6 +27,9 @@ export const projectSettings: ProjectSettings = { getHookInfo: getBaseUiHookInfo, translationLanguages: LANGUAGES, skipComponent: () => false, + skipHook: (filename) => { + return filename.match(/(useSlotProps)/) !== null; + }, onCompleted: async () => { await generateBaseUIApiPages(); }, diff --git a/packages/api-docs-builder/ProjectSettings.ts b/packages/api-docs-builder/ProjectSettings.ts index 4844b59a7cc289..42af79c27432eb 100644 --- a/packages/api-docs-builder/ProjectSettings.ts +++ b/packages/api-docs-builder/ProjectSettings.ts @@ -54,6 +54,10 @@ export interface ProjectSettings { * Fuction called to detemine whether to skip the generation of a particular component's API docs */ skipComponent: (filename: string) => boolean; + /** + * Fuction called to detemine whether to skip the generation of a particular hook's API docs + */ + skipHook?: (filename: string) => boolean; /** * Determine is the component definition should be updated. */ diff --git a/packages/api-docs-builder/buildApi.ts b/packages/api-docs-builder/buildApi.ts index fd8d324599377b..38fe6469cedf29 100644 --- a/packages/api-docs-builder/buildApi.ts +++ b/packages/api-docs-builder/buildApi.ts @@ -134,6 +134,9 @@ async function buildSingleProject( ); const projectHooks = findHooks(path.join(project.rootPath, 'src')).filter((hook) => { + if (projectSettings.skipHook?.(hook.filename)) { + return false; + } if (grep === null) { return true; } diff --git a/packages/mui-base/src/utils/appendOwnerState.ts b/packages/mui-base/src/utils/appendOwnerState.ts index 45d1992e00a38b..9c4b778bef1add 100644 --- a/packages/mui-base/src/utils/appendOwnerState.ts +++ b/packages/mui-base/src/utils/appendOwnerState.ts @@ -1,4 +1,3 @@ -export { - default as appendOwnerState, - AppendOwnerStateReturnType, -} from '@mui/utils/appendOwnerState'; +export { default as appendOwnerState } from '@mui/utils/appendOwnerState'; + +export type { AppendOwnerStateReturnType } from '@mui/utils/appendOwnerState'; diff --git a/packages/mui-base/src/utils/useSlotProps.ts b/packages/mui-base/src/utils/useSlotProps.ts index d959bd2b14e899..3d11566e23eb35 100644 --- a/packages/mui-base/src/utils/useSlotProps.ts +++ b/packages/mui-base/src/utils/useSlotProps.ts @@ -1,6 +1,4 @@ 'use client'; -export { - default as useSlotProps, - UseSlotPropsParameters, - UseSlotPropsResult, -} from '@mui/utils/useSlotProps'; +export { default as useSlotProps } from '@mui/utils/useSlotProps'; + +export type { UseSlotPropsParameters, UseSlotPropsResult } from '@mui/utils/useSlotProps'; diff --git a/packages/mui-utils/src/appendOwnerState/appendOwnerState.spec.tsx b/packages/mui-utils/src/appendOwnerState/appendOwnerState.spec.tsx index 73ebb2a4a5700d..2a6f571cc555b0 100644 --- a/packages/mui-utils/src/appendOwnerState/appendOwnerState.spec.tsx +++ b/packages/mui-utils/src/appendOwnerState/appendOwnerState.spec.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { appendOwnerState } from './appendOwnerState'; +import appendOwnerState from './appendOwnerState'; const divProps = appendOwnerState('div', { otherProp: true }, { ownerStateProps: true }); diff --git a/packages/mui-utils/src/appendOwnerState/index.ts b/packages/mui-utils/src/appendOwnerState/index.ts index d0f77d4d732ee2..7960208c3e81e3 100644 --- a/packages/mui-utils/src/appendOwnerState/index.ts +++ b/packages/mui-utils/src/appendOwnerState/index.ts @@ -1 +1,2 @@ -export { default, AppendOwnerStateReturnType } from './appendOwnerState'; +export { default } from './appendOwnerState'; +export type { AppendOwnerStateReturnType } from './appendOwnerState'; diff --git a/packages/mui-utils/src/index.ts b/packages/mui-utils/src/index.ts index a379698e329f38..e95754b2a2b5bd 100644 --- a/packages/mui-utils/src/index.ts +++ b/packages/mui-utils/src/index.ts @@ -41,11 +41,8 @@ export * from './generateUtilityClass'; export { default as unstable_generateUtilityClasses } from './generateUtilityClasses'; export { default as unstable_ClassNameGenerator } from './ClassNameGenerator'; export { default as clamp } from './clamp'; -export { - default as unstable_useSlotProps, - UseSlotPropsParameters, - UseSlotPropsResult, -} from './useSlotProps'; +export { default as unstable_useSlotProps } from './useSlotProps'; +export type { UseSlotPropsParameters, UseSlotPropsResult } from './useSlotProps'; export { default as unstable_resolveComponentProps } from './resolveComponentProps'; export { default as unstable_extractEventHandlers } from './extractEventHandlers'; export * from './types'; diff --git a/packages/mui-utils/src/mergeSlotProps/index.ts b/packages/mui-utils/src/mergeSlotProps/index.ts index 28fddd5756635a..5c4d0cc59f400c 100644 --- a/packages/mui-utils/src/mergeSlotProps/index.ts +++ b/packages/mui-utils/src/mergeSlotProps/index.ts @@ -1,5 +1,6 @@ -export { - default, +export { default } from './mergeSlotProps'; + +export type { WithCommonProps, MergeSlotPropsParameters, MergeSlotPropsResult, diff --git a/packages/mui-utils/src/useSlotProps/index.ts b/packages/mui-utils/src/useSlotProps/index.ts index dd9584f8bcd683..730ac5e809d1c5 100644 --- a/packages/mui-utils/src/useSlotProps/index.ts +++ b/packages/mui-utils/src/useSlotProps/index.ts @@ -1 +1,2 @@ -export { default, UseSlotPropsParameters, UseSlotPropsResult } from './useSlotProps'; +export { default } from './useSlotProps'; +export type { UseSlotPropsParameters, UseSlotPropsResult } from './useSlotProps';