Repository: facebook/docusaurus
File: packages/docusaurus-theme-common/src/index.ts (TypeScript)

Code before:
export function useCurrentSidebarCategory(...args: unknown[]): unknown {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  return require('@docusaurus/plugin-content-docs/client').useCurrentSidebarCategory(
    ...args,
  );
}
export function filterDocCardListItems(...args: unknown[]): unknown {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  return require('@docusaurus/plugin-content-docs/client').filterDocCardListItems(
    ...args,
  );
}
export function useDocsPreferredVersion(...args: unknown[]): unknown {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  return require('@docusaurus/plugin-content-docs/client').useDocsPreferredVersion(
    ...args,
  );
}

/*
 * APIs to document
 */

export {
  useThemeConfig,
  type ThemeConfig,
  type UserThemeConfig,
  type Navbar,
  type NavbarItem,
  type NavbarLogo,
  type MultiColumnFooter,
  type SimpleFooter,
  type Footer,
  type FooterLogo,
  type FooterLinkItem,
  type ColorModeConfig,
} from './utils/useThemeConfig';

export {default as ThemedComponent} from './components/ThemedComponent';

export {
  createStorageSlot,
  useStorageSlot,
  listStorageKeys,
} from './utils/storageUtils';

export {usePluralForm} from './utils/usePluralForm';

export {useCollapsible, Collapsible} from './components/Collapsible';

export {ThemeClassNames} from './utils/ThemeClassNames';

Review comment (suggestion):
I suspect this line to be the one causing me troubles on the official build of fast-check's documentation. This require makes `theme-common` pull things from `@docusaurus/plugin-content-docs`, which is just a peer.

The issue I'm facing appeared on 3.5.0. I need to come up with a repro implying a simplified version of my setup: yarn berry with docs being on.

Code after:
//  and remove docs plugin peerDeps in theme-common/package.json
//  This is public API surface that we need to keep for v3
//  See https://github.com/facebook/docusaurus/pull/10316
export function useCurrentSidebarCategory(...args: unknown[]): unknown {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  return require('@docusaurus/plugin-content-docs/client').useCurrentSidebarCategory(
    ...args,
  );
}
export function filterDocCardListItems(...args: unknown[]): unknown {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  return require('@docusaurus/plugin-content-docs/client').filterDocCardListItems(
    ...args,
  );
}
export function useDocsPreferredVersion(...args: unknown[]): unknown {
  // eslint-disable-next-line @typescript-eslint/no-var-requires
  return require('@docusaurus/plugin-content-docs/client').useDocsPreferredVersion(
    ...args,
  );
}
export function useContextualSearchFilters() {
  const {i18n} = useDocusaurusContext();
  const docsTags =
    // eslint-disable-next-line @typescript-eslint/no-var-requires
    require('@docusaurus/plugin-content-docs/client').useDocsContextualSearchTags();
  const tags = [DEFAULT_SEARCH_TAG, ...docsTags];
  return {locale: i18n.currentLocale, tags};
}

/*
 * APIs to document
 */

export {
  useThemeConfig,
  type ThemeConfig,
  type UserThemeConfig,
  type Navbar,
  type NavbarItem,
  type NavbarLogo,
  type MultiColumnFooter,
  type SimpleFooter,
  type Footer,
  type FooterLogo,
  type FooterLinkItem,
  type ColorModeConfig,
} from './utils/useThemeConfig';

export {default as ThemedComponent} from './components/ThemedComponent';